In the following examplethe data is from Example 50.5Probability Plotting—Right Censoring.
SAS提供不同的方法来估计实际的分布函数,但是方法和结果大同小异. 以下展示的方法为Expected Rank Plotting Position(mi).而对mi进行变换将得到PPLOT的Y轴.X的取值可以是时间或者log(时间).而与其对比的理论分布直线来源于模型分布本身.对于伪不分布,Y =log(1/(1-cdf)).
cdf是分布参数的函树.其中更加详细的计算我将在我blog里给出.如果计算合适,得出的结果应该和SAS给出的吻合一致.
datat;
set samp.fan;
time=lifetime;
censored=censor;
proc sort ; by time censored;
run;
/* ExpectedRank Plotting Position*/
Data PPOS_exprank;
set tnobs=ri end=Eof;
by time;
retain r 1;
if censored=0 then do;
c=ri/(ri +1);
r =r*c;
ai_exprank=1-r;
end;
ir =ri;
ri ++(-1);
if _n_=1 then do;
put "Table 1.1 Expected Rank PlottingPositionCalculations";
put 72*"-";
put @1 "Ordered Obs" @15 "ReverseRank" @30 "ri/(ri+1)" @44 "Ri" @53 "ai=1-Ri" @65 "mi=G^-1(ai)";
put 72*"-";
end;
timec=cats(time,ifc(censored =1,'+',''));
rc=ifn(censored =1, .,r);
mi=log(1/(1-ai_exprank));
put @1 timec $8.-R @15 ir best8. @30 c fract9.@44 rc f9.4-L @53 ai_exprank f9.4-L @65 mi f9.4-L;
if Eof then do;
put 72*"-";
put "+ Censored Times";
end;
run;
京剧
http://blog.sina.com.cn/s/blog_a3a926360102v76v.html



雷达卡


京公网安备 11010802022788号







