SAS中文论坛
标题:
SAS优势比资料的Meta分析程序
[打印本页]
作者:
shiyiming
时间:
2004-4-14 13:07
标题:
SAS优势比资料的Meta分析程序
[code:ba26a]OPTIONS LS=74 PS=MAX NOCENTER NODATE;
DATA A;
INPUT NAI NBI NCI NDI;
OR=(NAI*NDI)/(NBI*NCI);
YI=LOG(OR);
WI=(1/NAI+1/NBI+1/NCI+1/NDI)**(-1);
NI=NAI+NBI+NCI+NDI;
S_NUM=14;
CARDS;
36 496 60 478
1 68 5 56
14 117 20 117
3 64 7 52
8 48 10 61
3 61 12 46
1 70 7 68
4 77 11 52
32 339 34 338
5 44 4 27
7 114 13 111
0.1 23 1 21
9 31 11 31
6 89 9 85
;
DATA B; SET A;
WI2=WI**2;WIYI=WI*YI; WIYI2=WI*YI**2;
SWI1+WI; SWI21+WI2;
SWIYI1+WIYI; SWIYI21+WIYI2;
ID=_N_;
IF _N_=S_NUM THEN DO;
SWI=SWI1;SWI2=SWI21;
SWIYI=SWIYI1; SWIYI2=SWIYI21;
YWBAR=SWIYI/SWI; SYBAR2=1/SWI;
Q=SWIYI2-YWBAR**2*SWI;
SMU2=(Q-S_NUM+1)/(SWI-SWI2/SWI);
END;
P=1-PROBCHI(Q,S_NUM-1);
PROC SORT; BY DESCENDING ID;
DATA C; SET B;
FORC=EXP(YWBAR);
FORLOW=EXP(YWBAR-1.96*SYBAR2**0.5);
FORUP=EXP(YWBAR+1.96*SYBAR2**0.5);
SMU2S+SMU2;
WIS=1/(WI**(-1)+SMU2S);
WISYI=WIS*YI;
SWIS1+WIS;SWISYI1+WISYI;
IF _N_=S_NUM THEN DO;
SWIS=SWIS1;SWISYI=SWISYI1;
YBAR=SWISYI/SWIS;
SY2=1/SWIS;
ORC=EXP(YBAR);
ORLOW=EXP(YBAR-1.96*SY2**0.5);
ORUP=EXP(YBAR+1.96*SY2**0.5);
END;
PROC PRINT;
RUN;[/code:ba26a]
欢迎光临 SAS中文论坛 (http://mysas.net/forum/)
Powered by Discuz! X3.2