wmdnht等在“纵向数据下广义估计方程估计”一文从数学角度对广义估计方程进行了探讨,这里转载个sas做广义估计方程的例子:
data thall; input id y visit trt bline age; intercpt=1; cards;104 5 1 0 11 31104 3 2 0 11 31104 3 3 0 11 31104 3 4 0 11 31106 3 1 0 11 30106 5 2 0 11 30106 3 3 0 11 30106 3 4 0 11 30107 2 1 0 6 25107 4 2 0 6 25107 0 3 0 6 25107 5 4 0 6 25114 4 1 0 8 36114 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;