/* Use GLIMMIX in SAS to fit a Poisson regression model with random suject effects to the epileptic seizure data rom Thall and Vail(1990). */ /* This program is stored in the file seizglmm.sas */ options linesize=64; data set1; infile 'c:\stat565\seizures.dat'; input y1-y4 trt base age; patient = _N_; age=(age-29); y0 = base/4; z = 1; run; proc format; value trt 0 = 'Placebo' 1 = 'Progabide'; proc print data=set1; run; /* Modify the data file to put repeated measures on different lines. Also create a time variable. */ data set2; set set1; y = y0; time=0; xt=time; output; y = y1; time=2; xt=time; output; y = y2; time=4; xt=time; output; y = y3; time=6; xt=time; output; y = y4; time=8; xt=time; output; run; /* Fit a model use GLIMMIX to include a random patient effect */ %inc 'c:\stat565\glmm800.sas' / nosource; run; /* Log-linear models with fixed and random effects */ %glimmix(data=set2, stmts=%str( class patient; model y = trt time time*time age age*trt / solution; random intercept / type=un subject=patient;), error=poisson, link=log, converge=1e-8, maxit=20, out=setp ) run; proc print data=setp (obs=5); run;