Dear R-helpers, I am using the package "gee" to run a marginal model. Here is the output. In my simulated data, both x and z are time-varying, so I include their interaction terms with time indicator (i.e. tind=0, if time 1, and 1 if time 2) The data is simulated, so the true parameter of z both at time 1 and time 2 is 5, which is very close from the model output for time 1, z = 5.0757760, and for time 2, z is 5.0757760-0.6379866 = ~5> model=gee(y~x+z+x*tind+z*tind, family=gaussian(link = "identity"), id=sid,corstr="exchangeable") Beginning Cgee S-function, @(#) geeformula.q 4.13 98/01/27 running glm to get initial regression estimate (Intercept) x z tind x:tind z:tind 2.9342186 1.5002601 5.0757760 2.0846327 0.1869748 -0.6379866 However, when I use the summary command, the coefficients are changed. Am I missing anything here ??> summary(model)GEE: GENERALIZED LINEAR MODELS FOR DEPENDENT DATA gee S-function, version 4.13 modified 98/01/27 (1998) Model: Link: Identity Variance to Mean Relation: Gaussian Correlation Structure: Exchangeable Call: gee(formula = y ~ x + z + x * tind + z * tind, id = sid, family gaussian(link = "identity"), corstr = "exchangeable") Summary of Residuals: Min 1Q Median 3Q Max -5.9273676 -2.0072725 -0.7169515 2.3709969 8.2377283 Coefficients: Estimate Naive S.E. Naive z Robust S.E. Robust z (Intercept) 4.1450504 0.331866699 12.490106 0.264666616 15.661403 x 1.5155102 0.008479614 178.723972 0.006854627 221.093020 z 0.6463947 0.111148094 5.815617 0.100379444 6.439513 tind 1.5986872 0.163851622 9.756920 0.175947744 9.086148 x:tind 0.1434216 0.005288708 27.118450 0.005924767 24.207123 z:tind 4.2951055 0.168647198 25.467992 0.166776520 25.753658 Estimated Scale Parameter: 6.800334 Number of Iterations: 10 Any helps would be very much appreciated! Thank you, Carrie-- [[alternative HTML version deleted]]
Thomas Lumley
2011-May-08 20:48 UTC
[R] questions about the output of "gee" and its summary
On Sun, May 8, 2011 at 6:36 PM, Carrie Li <carrieandstat at gmail.com> wrote:> Dear R-helpers, > > I am using the package "gee" to run a marginal model. > > Here is the output. > In my simulated data, both x and z are time-varying, so I include their > interaction terms with time indicator (i.e. tind=0, if time 1, and 1 if time > 2) > The data is simulated, so the true parameter of z both at time 1 and time 2 > is 5, which is very close from the model output > for time 1, z = 5.0757760, and for time 2, z is 5.0757760-0.6379866 = ~5 > >> model=gee(y~x+z+x*tind+z*tind, family=gaussian(link = "identity"), id=sid, > corstr="exchangeable") > Beginning Cgee S-function, @(#) geeformula.q 4.13 98/01/27 > running glm to get initial regression estimate > (Intercept) ? ? ? ? ? ? ? ? x ? ? ? ? ? ? ? ? ?z ? ? ? ? ? ?tind > x:tind ? ? ? ? ?z:tind > ?2.9342186 ? 1.5002601 ? 5.0757760 ? 2.0846327 ? 0.1869748 ?-0.6379866 > > > > However, when I use the summary command, the coefficients are changed. > Am I missing anything here ??Yes. The printout above gives the starting values obtained by running glm(), not the results of gee(). If you use summary() on the model object, or just print the model object you will get the results of gee(). -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland