?(2)t?1????1?m?1????10.8???1?11?1??3?1???0.8?3????3???1.1162 (3)s(t?1)?e?(0.8?1)3?59.92% 练习8.3 DATA ex8_3;
INPUT stime out g @@; COUNTROL=1; CARDS;
6 1 1 10 0 1 22 1 1 1 1 2 5 1 2 11 1 6 1 1 11 0 1 23 1 1 1 1 2 5 1 2 12 1 6 1 1 13 1 1 25 0 1 2 1 2 8 1 2 12 1 2 2 2
6 0 1 16 1 1 32 0 1 2 1 2 8 1 2 15 1 2 7 1 1 17 0 1 32 0 1 3 1 2 8 1 2 17 1 2 9 0 1 19 0 1 34 0 1 4 1 2 8 1 2 22 1 2 10 1 1 20 0 1 35 0 1 4 1 2 1 1 2 23 1 2 ;
PROC LIFEREG OUTEST =MODELS COVOUT; A:MODEL stime * out(0)=g;
B:MODEL stime * out(0)=g/DIST=EXPONENTIAL; C:MODEL stime * out(0)=G/DIST=WEIBULL; RUN; 练习8.4 DATA ex8 _4; INPUT time @@ ; G=1; OUT=1;
CARDS;
1 2 3 4 5 5 9 13 16. 5 17. 5 12. 5 7 6 17. 5 6 14 25 49 37. 5 49 28 PROC LIFEREG OUTEST=MODELS COVOUT; A :MODEL time=g/DIST=WEIBULL; B:MODEL time=g /DIST=EXPONENTIAL ; RUN;
PROC PRINT DATA=MODELS ; ID _MODEL -; RUN;
练习 8. 5 DATA ex8 _5;
INPUT id group stime censor kidney @@; CARDS;
1 0 8 1 1 2 0 852 0 0 ... ... ...
25 1 1990 0 0
/ *指数回归和 Weibull回归 * /
PROC LIFEREG OUTEST=MODELS COVOUT;
A : MODEL stime * censor (0) = group kidney /DIST = WEIBULL ;
B : MODEL stime * censor ( O) = group kidney /DIST = EXPONENTIAL ; RUN;
PROC PRINT DATA=MODELS ; ID _MODEI_ _; RUN;
/ * Cox比例风险 * / PROC PHREG ;
MODEL stime * censor (O) = group kidney ; RUN;
练习 8. 6 DATA ex8 _6;
INPUT id censor stime agel bmi ageo smk sbp dbp ecg chd; mbp=sbp/3+2 * dbp/3; CARDS ;
1 0 12. 4 44 34. 2 41 0 132 96 0 ... ... ...
149 0 10. 5 49 30. 8 47 1 146 86 0 PROC PHREG; .
MODEL stime * censor (0) = agel mbp ecg/SELECTION = STEPWISE SLENTRY = 0. 2 SLSTAY = 0. I ; RUN;
综习 8. 7
OPTION ls=100; DATA ex8 _7;
INPUT age gender to YYMMDDIO. response tl YYMMDDlO. outcome ii bl 12 b2 13 b3 14 b4 is b5;
sl=ii * bl; s2=12 * b2; s3=13 * b3;s4=14 * b4; s5=is * b5; time=tl-t0; CARDS;
0 0 53 0 1977/3/31 1 1977/11/1 0 7 7 23 23 0 0 25 25 0 0 ... ... ...
59 1 1977/3/4 0 1977/4/2 1 0 0 0 0 0 0 16 16 0 0 ; run;
proc phreg;
model time * outcome(0)=age gender response s1 s2 s3 s4 s5; run;
?1??1??0????10.9???1??0??答案:9-1点A到均数的距离为:?????????????????1.0526316
100.91???1??0??????????1??1??0????10.9???1??0?? 点B到均数的距离为:?????????????????20
???1??0???0.91????1??0??答案:9-2 DATA ex9-2;
INPUT item $ y1 y2; CARDS;
X1 27.892 61.42 ……
X13 20.913 61.25 ;
PROC STANDARD MEAN=0 STD=1 OUT=temp; VAR y1 y2;
/* 最长距离法 */
PROC CLUSTER DATA=temp METHOD=SINGLE STD NOSQUARE CCC; VAR y1 y2; ID item; RUN;
PROC TREE HORIZONTAL SPACE=3; ID item; RUN;
/* 最长距离法 */
PROC CLUSTER DATA=temp METHOD=COMPLETE STD NOSQUARE CCC; VAR y1 y2; ID item; RUN;
PROC TREE HORIZONTAL SPACE=3; ID item; RUN;