/* Use the GEE option in PROC GENMOD to fit a Poisson regression model to the epileptic seizure data from Thall and Vail(1990). */ /* This program is stored in the file seizure2.sas */ options linesize=64; data set1; infile 'c:\mydocuments\courses\st557\sas\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; proc sort data=set2; by trt time; run; proc means data=set2 n mean stderr noprint; by trt time; var y; output out=means mean=y; run; axis1 label=(f=swiss h=1.2 a=90 r=0 "Seizures per 2 weeks") order = 5 to 10 by 1 length= 4.5in value=(f=swiss h=1.0); axis2 label=(f=swiss h=1.2 "Time(weeks)") order = 0 to 8 by 2 value=(f=swiss h=1.0) w= 4.0 length = 6. in; SYMBOL1 V=dot H=1.5 w=4 l=1 i=join cv=black; SYMBOL2 V=circle H=1.5 w=4 l=3 i=join cv=black; PROC GPLOT DATA=means; PLOT y*time=trt / vaxis=axis1 haxis=axis2; TITLE1 ls=0.4 H=2.0 F=swiss "Two-Week Seizure Rates"; legend frame across=2 down=3; footnote h=2 " "; format trt trt.; RUN; /* Use PROC GENMOD in SAS to fit a log-linear model with no correlation among repeated measurements. Standard errors are based on independent Poisson counts. */ proc genmod data=set2; class patient; model y = z time trt time*time age trt*age / noint dist=poisson link=log covb itprint converge=.0000001 maxit=50; run; /* Use PROC GENMOD in SAS to obtain GEE estimates of coefficients in a log-linear model with an exchangeable correlation structure for repeated measurements. Standard errors are based on this correlation structure. Results for a robust covariance estimator are also provided. */ proc genmod data=set2; class patient; model y = z time trt time*time age trt*age / noint dist=poisson link=log covb itprint converge=.0000001 maxit=50; repeated subject=patient / type=exch modelse covb corrw; run; /* Use PROC GENMOD in SAS to obtain GEE estimates of coefficients in a log-linear model with an autoregressive correlation structure for repeated measurements. Standard errors are based on the model and also on a robust covariance estimator. */ proc genmod data=set2; class patient; model y = z time trt time*time age trt*age / noint dist=poisson link=log covb obstats itprint converge=.0000001 maxit=50; repeated subject=patient / type=ar(1) modelse covb corrw; run;