/****************************************************************** CHAPTER 12, EXAMPLE 1 Fit a loglinear regression model to the epileptic seizure data. These are count data, thus we use the Poisson mean/variance assumptions. This model is fitted with different working correlation matrics. ******************************************************************/ options ls=80 ps=59 nodate; run; /****************************************************************** The data look like (first 8 records on first 2 subjects) 104 11 0 0 11 31 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 11 0 0 11 30 106 3 1 0 11 30 106 5 2 0 11 30 106 3 3 0 11 30 106 3 4 0 11 30 ... column 1 subject column 2 number of seizures column 3 visit (baseine (0) and 1--4 biweekly visits) column 4 =0 if placebo, = 1 if progabide column 5 baseline number of seizures in 8 weeks prior to study column 6 age ******************************************************************/ data seizure; infile "seize.dat.txt"; input subject seize visit trt base age; run; proc print data=seizure; run; proc means data=seizure; class visit trt; run; data seizure; set seizure; o=2; v=1; if visit=0 then o=8; if visit=0 then v=0; logo=log(o); run; /***************************************************************** Fit the loglinear regression model using PROC GENMOD and three different working correlation matrix assumptions: - unstructured The DIST=POISSON option in the model statement specifies that the Poisson requirement that mean = variance, be used. The LINK=LOG option asks for the loglinear model. Other LINK= choices are available. The REPEATED statement specifies the "working" correlation structure to be assumed. The CORRW option in the REPEATED statement prints out the estimated working correlation matrix under the assumption given in the TYPE= option. The COVB option prints out the estimated covariance matrix of the estimate of beta -- both the usual estimate and the "robust" version are printed. The MODELSE option specifies that the standard error estimates printed for the elements of betahat are based on the usual theory. By default, the ones based on the "robust" version of the sampling covariance matrix are printed, too. The dispersion parameter phi is estimated rather then being held fixed at 1 -- this allows for the possibility of "overdispersion" ******************************************************************/ title "INDEPENDENCE CORRELATION"; proc genmod data=seizure; class subject; model seize = v trt trt*v / dist = poisson link = log offset=logo; repeated subject=subject / corrw covb modelse; run; /************************************************************************* INDEPENDENCE CORRELATION 56 The GENMOD Procedure Covariance Matrix (Model-Based) Prm1 Prm2 Prm3 Prm4 Prm1 0.02286 -0.02286 -0.02286 0.02286 Prm2 -0.02286 0.04332 0.02286 -0.04332 Prm3 -0.02286 0.02286 0.04296 -0.04296 Prm4 0.02286 -0.04332 -0.04296 0.08338 Covariance Matrix (Empirical) Prm1 Prm2 Prm3 Prm4 Prm1 0.02476 -0.001152 -0.02476 0.001152 Prm2 -0.001152 0.01348 0.001152 -0.01348 Prm3 -0.02476 0.001152 0.04922 0.01525 Prm4 0.001152 -0.01348 0.01525 0.04563 Algorithm converged. Working Correlation Matrix Col1 Col2 Col3 Col4 Col5 Row1 1.0000 0.0000 0.0000 0.0000 0.0000 Row2 0.0000 1.0000 0.0000 0.0000 0.0000 Row3 0.0000 0.0000 1.0000 0.0000 0.0000 Row4 0.0000 0.0000 0.0000 1.0000 0.0000 Row5 0.0000 0.0000 0.0000 0.0000 1.0000 GEE Fit Criteria QIC -659.5869 QICu -668.6570 Analysis Of GEE Parameter Estimates Empirical Standard Error Estimates Standard 95% Confidence Parameter Estimate Error Limits Z Pr > |Z| Intercept 1.3476 0.1574 1.0392 1.6560 8.56 <.0001 v 0.1108 0.1161 -0.1168 0.3383 0.95 0.3399 trt 0.0265 0.2219 -0.4083 0.4613 0.12 0.9049 v*trt -0.1037 0.2136 -0.5223 0.3150 -0.49 0.6274 **************************************************************************/ title "UNSTRUCTURED CORRELATION"; proc genmod data=seizure; class subject; model seize = v trt trt*v / dist = poisson link = log offset=logo; repeated subject=subject / type=un corrw covb modelse; run; /****************************************************************** Extracts from OUTPUT: Parameter Information Parameter Effect Prm1 Intercept Prm2 v Prm3 trt Prm4 v*trt UNSTRUCTURED CORRELATION 10 The GENMOD Procedure Covariance Matrix (Model-Based) Prm1 Prm2 Prm3 Prm4 Prm1 0.01205 0.01924 -0.01205 -0.01924 Prm2 0.01924 0.03091 -0.01924 -0.03091 Prm3 -0.01205 -0.01924 0.02220 0.03696 Prm4 -0.01924 -0.03091 0.03696 0.06209 Covariance Matrix (Empirical) Prm1 Prm2 Prm3 Prm4 Prm1 0.23193 0.0007209 -0.23193 -0.000721 Prm2 0.0007209 0.01564 -0.000721 -0.01564 Prm3 -0.23193 -0.000721 0.32478 -0.03058 Prm4 -0.000721 -0.01564 -0.03058 0.06334 Algorithm converged. Working Correlation Matrix Col1 Col2 Col3 Col4 Col5 Row1 1.0000 0.9435 0.7324 0.8213 0.6856 Row2 0.9435 1.0000 0.8187 0.9435 0.7819 Row3 0.7324 0.8187 1.0000 0.7146 0.5375 Row4 0.8213 0.9435 0.7146 1.0000 0.6841 Row5 0.6856 0.7819 0.5375 0.6841 1.0000 Analysis Of GEE Parameter Estimates Empirical Standard Error Estimates Standard 95% Confidence Parameter Estimate Error Limits Z Pr > |Z| Intercept 1.1186 0.4816 0.1747 2.0625 2.32 0.0202 v 0.1233 0.1251 -0.1218 0.3684 0.99 0.3241 trt 0.0711 0.5699 -1.0459 1.1881 0.12 0.9007 v*trt -0.1140 0.2517 -0.6072 0.3793 -0.45 0.6507 UNSTRUCTURED CORRELATION 11 The GENMOD Procedure Analysis Of GEE Parameter Estimates Model-Based Standard Error Estimates Standard 95% Confidence Parameter Estimate Error Limits Z Pr > |Z| Intercept 1.1186 0.1098 0.9034 1.3338 10.19 <.0001 v 0.1233 0.1758 -0.2213 0.4679 0.70 0.4831 trt 0.0711 0.1490 -0.2209 0.3631 0.48 0.6331 v*trt -0.1140 0.2492 -0.6023 0.3744 -0.46 0.6474 Scale 4.9502 . . . . . NOTE: The scale parameter for GEE estimation was computed as the square root of the normalized Pearson's chi-square. ******************************************************************/ title "EXCHANGEABLE (COMPOUND SYMMETRY) CORRELATION"; proc genmod data=seizure; class subject; model seize = v trt trt*v / dist = poisson link = log offset=logo; repeated subject=subject / type=cs corrw covb modelse; estimate 'multiplicative progabide effect' trt*v 1 ; run; /****************************************************************** Analysis Of GEE Parameter Estimates Model-Based Standard Error Estimates Standard 95% Confidence Parameter Estimate Error Limits Z Pr > |Z| Intercept 1.3476 0.1512 1.0513 1.6439 8.91 <.0001 v 0.1108 0.1547 -0.1924 0.4140 0.72 0.4739 trt 0.0265 0.2073 -0.3797 0.4328 0.13 0.8982 v*trt -0.1037 0.2199 -0.5348 0.3274 -0.47 0.6374 Scale 4.4388 . . . . . NOTE: The scale parameter for GEE estimation was computed as the square root of the normalized Pearson's chi-square. Contrast Estimate Results Mean Mean L'Beta Label Estimate Confidence Limits Estimate multiplicative progabide effect 0.9015 0.5931 1.3702 -0.1037 Contrast Estimate Results Standard L'Beta Chi- Label Error Alpha Confidence Limits Square multiplicative progabide effect 0.2136 0.05 -0.5223 0.3150 0.24 Contrast Estimate Results Label Pr > ChiSq multiplicative progabide effect 0.6274 ******************************************************************/ title "AR(1) CORRELATION"; proc genmod data=seizure; class subject; model seize = v trt trt*v / dist = poisson link = log offset=logo; repeated subject=subject / type=ar(1) corrw covb modelse; run; /****************************************************************** AR(1) CORRELATION 17 The GENMOD Procedure Analysis Of GEE Parameter Estimates Model-Based Standard Error Estimates Standard 95% Confidence Parameter Estimate Error Limits Z Pr > |Z| Intercept 1.3119 0.1430 1.0316 1.5923 9.17 <.0001 v 0.1515 0.1682 -0.1782 0.4811 0.90 0.3678 trt 0.0188 0.1965 -0.3663 0.4038 0.10 0.9240 v*trt -0.1283 0.2404 -0.5996 0.3429 -0.53 0.5935 Scale 4.4907 . . . . . NOTE: The scale parameter for GEE estimation was computed as the square root of the normalized Pearson's chi-square. ******************************************************************/ /****************************************************************** Delete the unusual subject and run again; we only use the compound symmetric covariance for the rest of the analyses. ******************************************************************/ data weird; set seizure; if subject=207 then delete; run; title "SUBJECT 207 DELETED"; proc genmod data=weird; class subject; model seize = v trt trt*v / dist = poisson link = log offset=logo; repeated subject=subject / type=cs corrw covb modelse; run; /************************************************************************** SUBJECT 207 DELETED 68 The GENMOD Procedure Covariance Matrix (Model-Based) Prm1 Prm2 Prm3 Prm4 Prm1 0.01223 0.001520 -0.01223 -0.001520 Prm2 0.001520 0.01519 -0.001520 -0.01519 Prm3 -0.01223 -0.001520 0.02495 0.005427 Prm4 -0.001520 -0.01519 0.005427 0.03748 Covariance Matrix (Empirical) Prm1 Prm2 Prm3 Prm4 Prm1 0.02476 -0.001152 -0.02476 0.001152 Prm2 -0.001152 0.01348 0.001152 -0.01348 Prm3 -0.02476 0.001152 0.03751 -0.002999 Prm4 0.001152 -0.01348 -0.002999 0.02931 Algorithm converged. Working Correlation Matrix Col1 Col2 Col3 Col4 Col5 Row1 1.0000 0.5941 0.5941 0.5941 0.5941 Row2 0.5941 1.0000 0.5941 0.5941 0.5941 Row3 0.5941 0.5941 1.0000 0.5941 0.5941 Row4 0.5941 0.5941 0.5941 1.0000 0.5941 Row5 0.5941 0.5941 0.5941 0.5941 1.0000 Exchangeable Working Correlation Correlation 0.5941485833 GEE Fit Criteria QIC -1052.5376 QICu -1060.3906 Analysis Of GEE Parameter Estimates Empirical Standard Error Estimates Standard 95% Confidence Parameter Estimate Error Limits Z Pr > |Z| Intercept 1.3476 0.1574 1.0392 1.6560 8.56 <.0001 v 0.1108 0.1161 -0.1168 0.3383 0.95 0.3399 trt -0.1080 0.1937 -0.4876 0.2716 -0.56 0.5770 Analysis Of GEE Parameter Estimates Model-Based Standard Error Estimates Standard 95% Confidence Parameter Estimate Error Limits Z Pr > |Z| Intercept 1.3476 0.1106 1.1309 1.5644 12.19 <.0001 v 0.1108 0.1233 -0.1308 0.3524 0.90 0.3687 trt -0.1080 0.1579 -0.4176 0.2015 -0.68 0.4940 v*trt -0.3016 0.1936 -0.6811 0.0779 -1.56 0.1193 Scale 3.2469 . . . . . NOTE: The scale parameter for GEE estimation was computed as the square root of the normalized Pearson's chi-square. **********************************************************************************/ /****************************************************************** Now we fit two additional models on the full data (with 207). In the first, we add logage as a covariate. ******************************************************************/ data seizure; set seizure; visit4=1; if visit<4 then visit4=0; logage=log(age); run; proc print data =seizure; run; /****************************************************************** We then add age as a covariate to allow for systematic differences in baseline response due to age. We use log(age) as has been the case in other analyses. ******************************************************************/ title "AGE ADDED"; proc genmod data=seizure; class subject; model seize = logage v trt trt*v / dist = poisson link = log offset=logo; repeated subject=subject / type=cs corrw covb modelse; run; /***************************************************************************** In the second, we allow an additional shift at visit 4. To do this, we define visit4 to be an indicator of the last visit. *****************************************************************************/ title "MODIFIED MODEL"; proc genmod data=seizure; class subject; model seize = v visit4 trt trt*v trt*visit4 / dist = poisson link = log offset=logo; repeated subject=subject / type=cs corrw covb modelse; run;