/* Use the GEE option in PROC GENMOD to fit a Poisson regression model to the epileptic seizure data from Thall and Vail(1990). */ proc format; value trt 0 = 'Placebo' 1 = 'progabide'; proc print data=set1; run; /* This program is stored in the file seizure2.sas */ data set1; infile 'c:\courses\st557\sas\seizures.dat'; input y1-y4 trt base age; case = _N_; age=(age-29); base = base-30; /* label base = number of siezures in 8 weeks prior to treatment trt = treatment age = age in years case = subject y1 = seizures 1-2 weeks after treatment y2 = seizures 3-4 weeks after treatment y3 = seizures 5-6 weeks after treatment y4 = seizures 7-8 weeks after treatment; */ run; /* Use the interactive data analysis feature in SAS to examine box plots or scatter plots for y1 through y4 versus age or base, or make those plots with the following code */ proc sort data=set1; by trt; proc univariate data=set1 plot; by trt; var y1-y4 base age; format trt trt.; run; proc plot data=set1; plot (y1-y4)*base = trt; plot (y1-y4)*age = trt; run; 1252 1251 /* Modify the data file to put repeated measures on different lines. Also create a time variable. */ data set2; set set1; y = y1; time=1; xt=time; y = y2; time=2; xt=time; y = y3; time=3; xt=time; y = y4; time=4; xt=time; 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 case time; model y = time trt(time) age(time) base(time) / noint dist=poisson link=log covb obstats itprint converge=.0000001 maxit=50; run; output; output; output; output; 1253 1254 Criteria For Assessing Goodness Of Fit Criterion DF Deviance Scaled Deviance Pearson Chi-Square Scaled Pearson X2 Log Likelihood Parameter Intercept time time time time trt(time) trt(time) trt(time) trt(time) age(time) age(time) age(time) age(time) base(time) base(time) base(time) base(time) Scale 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 220 220 220 220 Value Value/DF 977.2344 977.2344 1204.6348 1204.6348 2899.0845 4.4420 4.4420 5.4756 5.4756 DF Estimate Standard Error ChiSquare Pr>ChiSq 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0.0000 1.9845 1.9603 1.9660 1.7886 -0.2417 -0.1123 -0.2127 -0.2263 0.0259 0.0056 0.0205 0.0124 0.0243 0.0199 0.0224 0.0221 1.0000 0.0000 0.0666 0.0683 0.0677 0.0739 0.0893 0.0923 0.0916 0.1011 0.0064 0.0068 0.0066 0.0074 0.0010 0.0010 0.0010 0.0011 0.0000 . 887.43 824.68 842.25 585.41 7.32 1.48 5.39 5.01 16.31 0.68 9.71 2.82 634.33 380.03 498.83 405.26 . <.0001 <.0001 <.0001 <.0001 0.0068 0.2235 0.0203 0.0252 <.0001 0.4088 0.0018 0.0933 <.0001 <.0001 <.0001 <.0001 /* Use PROC GENMOD in SAS to fit a log-linear model with no correlation among repeated measurements. Standard errors are first based on a model with extra-Poisson variation, then a robust covariance estimator is used. */ proc genmod data=set2; class case time; make 'obstats' out=set3; model y = time trt(time) age(time) base(time) / noint dist=poisson link=log covb obstats pscale itprint converge=.0000001 maxit=50; repeated subject=case / type=ind modelse covb corrw; run; NOTE: The scale parameter was held fixed. 1256 1255 Criteria For Assessing Goodness Of Fit Criterion Deviance Scaled Deviance Pearson Chi-Square Scaled Pearson X2 Parameter Intercept time time time time trt(time) trt(time) trt(time) trt(time) age(time) age(time) age(time) age(time) base(time) base(time) base(time) base(time) Scale 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 DF Value Value/DF 220 220 220 220 977.2344 178.4703 1204.6348 220.0000 4.4420 0.8112 5.4756 1.0000 GEE Model Information DF Estimate Standard Error ChiSquare Pr > ChiSq 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0.0000 1.9845 1.9603 1.9660 1.7886 -0.2417 -0.1123 -0.2127 -0.2263 0.0259 0.0056 0.0205 0.0124 0.0243 0.0199 0.0224 0.0221 2.3400 0.0000 0.1559 0.1597 0.1585 0.1730 0.2090 0.2159 0.2144 0.2366 0.0150 0.0158 0.0154 0.0174 0.0023 0.0024 0.0024 0.0026 0.0000 . 162.07 150.61 153.82 106.91 1.34 0.27 0.98 0.91 2.98 0.12 1.77 0.51 115.85 69.40 91.10 74.01 . <.0001 <.0001 <.0001 <.0001 0.2474 0.6029 0.3212 0.3388 0.0843 0.7241 0.1829 0.4733 <.0001 <.0001 <.0001 <.0001 Correlation Structure Subject Effect Number of Clusters Correlation Matrix Dimension Maximum Cluster Size Minimum Cluster Size Independent case (59 levels) 59 4 4 4 Working Correlation Matrix Row1 Row2 Row3 Row4 Col1 1.0000 0.0000 0.0000 0.0000 Col2 0.0000 1.0000 0.0000 0.0000 Col3 0.0000 0.0000 1.0000 0.0000 Col4 0.0000 0.0000 0.0000 1.0000 NOTE: The scale parameter was estimated by the square root of Pearson's Chi-Square/DOF. 1257 1258 Analysis Of GEE Parameter Estimates Model-Based Standard Error Estimates Analysis Of GEE Parameter Estimates Empirical Standard Error Estimates Parameter Estimate Standard Error Intercept time time time time trt(time) trt(time) trt(time) trt(time) age(time) age(time) age(time) age(time) base(time) base(time) base(time) base(time) 0.0000 1.9845 1.9603 1.9660 1.7886 -0.2417 -0.1123 -0.2127 -0.2263 0.0259 0.0056 0.0205 0.0124 0.0243 0.0199 0.0224 0.0221 0.0000 0.1627 0.1200 0.2730 0.1180 0.1940 0.1614 0.3289 0.1676 0.0154 0.0094 0.0157 0.0097 0.0020 0.0014 0.0018 0.0012 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 Parameter Z . 12.20 16.33 7.20 15.16 -1.25 -0.70 -0.65 -1.35 1.68 0.59 1.30 1.28 12.30 14.29 12.51 19.10 Pr > |Z| . <.0001 <.0001 <.0001 <.0001 0.2128 0.4865 0.5179 0.1769 0.0937 0.5526 0.1934 0.2013 <.0001 <.0001 <.0001 <.0001 Estimate Intercept time 1 time 2 time 3 time 4 trt(time) 1 trt(time) 2 trt(time) 3 trt(time) 4 age(time) 1 age(time) 2 age(time) 3 age(time) 4 base(time) 1 base(time) 2 base(time) 3 base(time) 4 Scale NOTE: The scale 0.0000 1.9845 1.9603 1.9660 1.7886 -0.2417 -0.1123 -0.2127 -0.2263 0.0259 0.0056 0.0205 0.0124 0.0243 0.0199 0.0224 0.0221 2.3400 parameter Standard Error Z Pr > |Z| 0.0000 0.1559 0.1597 0.1585 0.1730 0.2090 0.2159 0.2144 0.2366 0.0150 0.0158 0.0154 0.0174 0.0023 0.0024 0.0024 0.0026 . 12.73 12.27 12.40 10.34 -1.16 -0.52 -0.99 -0.96 1.73 0.35 1.33 0.72 10.76 8.33 9.54 8.60 . <.0001 <.0001 <.0001 <.0001 0.2474 0.6029 0.3212 0.3388 0.0843 0.7241 0.1829 0.4733 <.0001 <.0001 <.0001 <.0001 was held fixed. 1259 /* 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 case time; make 'obstats' out=set4; model y = time trt(time) age(time) base(time) / noint dist=poisson link=log covb obstats pscale itprint converge=.0000001 maxit=50; repeated subject=case / type=exch modelse covb corrw; run; 1260 GEE Model Information Correlation Structure Subject Effect Number of Clusters Correlation Matrix Dimension Maximum Cluster Size Minimum Cluster Size Exchangeable case (59 levels) 59 4 4 4 Working Correlation Matrix Row1 Row2 Row3 Row4 1261 Col1 1.0000 0.3947 0.3947 0.3947 Col2 0.3947 1.0000 0.3947 0.3947 Col3 0.3947 0.3947 1.0000 0.3947 Col4 0.3947 0.3947 0.3947 1.0000 1262 Analysis Of GEE Parameter Estimates Model-Based Standard Error Estimates Analysis Of GEE Parameter Estimates Empirical Standard Error Estimates Parameter Estimate Standard Error Intercept time time time time trt(time) trt(time) trt(time) trt(time) age(time) age(time) age(time) age(time) base(time) base(time) base(time) base(time) 0.0000 1.9809 1.9570 1.9624 1.7850 -0.2378 -0.1036 -0.2057 -0.2206 0.0255 0.0051 0.0201 0.0118 0.0243 0.0199 0.0224 0.0221 0.0000 0.1629 0.1207 0.2740 0.1194 0.1935 0.1632 0.3301 0.1694 0.0155 0.0097 0.0158 0.0098 0.0019 0.0014 0.0018 0.0012 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 Z Pr > |Z| . 12.16 16.21 7.16 14.95 -1.23 -0.63 -0.62 -1.30 1.65 0.52 1.27 1.21 12.47 14.12 12.46 19.00 . <.0001 <.0001 <.0001 <.0001 0.2192 0.5256 0.5331 0.1928 0.0998 0.5997 0.2036 0.2259 <.0001 <.0001 <.0001 <.0001 Parameter Estimate Standard Error Z Intercept 0.0000 0.0000 . time 1 1.9809 0.1560 12.70 time 2 1.9570 0.1599 12.24 time 3 1.9624 0.1587 12.36 time 4 1.7850 0.1732 10.31 trt(time) 1 -0.2378 0.2089 -1.14 trt(time) 2 -0.1036 0.2157 -0.48 trt(time) 3 -0.2057 0.2143 -0.96 trt(time) 4 -0.2206 0.2365 -0.93 age(time) 1 0.0255 0.0150 1.70 age(time) 2 0.0051 0.0158 0.32 age(time) 3 0.0201 0.0154 1.31 age(time) 4 0.0118 0.0174 0.68 base(time) 1 0.0243 0.0022 10.80 base(time) 2 0.0199 0.0024 8.31 base(time) 3 0.0224 0.0023 9.55 base(time) 4 0.0221 0.0026 8.62 Scale 2.3400 NOTE: The scale parameter was held fixed. proc genmod data=set2; class case time; make 'obstats' out=set5; model y = time trt(time) age(time) base(time) / noint dist=poisson link=log covb obstats itprint converge=.000001 maxit=50; repeated subject=case / type=un modelse covb corrw; run; . <.0001 <.0001 <.0001 <.0001 0.2548 0.6312 0.3370 0.3508 0.0885 0.7474 0.1903 0.4954 <.0001 <.0001 <.0001 <.0001 1264 1263 /* Use PROC GENMOD in SAS to obtain GEE estimates of coefficients in a log-linear model with an unstructured correlation structure for repeated measurements. Standard errors are based on the model and also on a robust covariance estimator. (This procedure failed to converge.) */ Pr > |Z| GEE Model Information Correlation Structure Subject Effect Number of Clusters Correlation Matrix Dimension Maximum Cluster Size Minimum Cluster Size Unstructured case (59 levels) 59 4 4 4 ERROR: Error in estimation routine. 1265 1266