您的位置:首页 > 其它

sas做广义估计方程

2012-04-26 21:04 246 查看
赵目等在“纵向数据下广义估计方程估计”一文从数学角度对广义估计方程进行了探讨,这里转载个sas做广义估计方程的例子:

data thall;
input id y visit trt bline age;
intercpt=1;
cards;
104 5 1 0 11 31
104 3 2 0 11 31
104 3 3 0 11 31
104 3 4 0 11 31
106 3 1 0 11 30
106 5 2 0 11 30
106 3 3 0 11 30
106 3 4 0 11 30
107 2 1 0 6 25
107 4 2 0 6 25
107 0 3 0 6 25
107 5 4 0 6 25
114 4 1 0 8 36
114 4 2 0 8 36
;run;
data new;
set thall;
output;
if visit=1 then do;
y=bline; visit=0; output;
end;
run;
data new2;
set new;
if id ne 107;
if visit=0 then do; x1=0; ltime=log(8); end;
else do; x1=1; ltime=log(2); end;
x1trt=x1*trt;
run;

proc genmod data=new2;
model y=x1 | trt / d=poisson offset=ltime itprint;
class id;
repeated subject=id / corrw type=exch;
run;
quit;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: