[R] glm(weights) and standard errors

Steve Taylor steve.taylor at aut.ac.nz
Tue May 22 04:58:29 CEST 2012


Is there a way to tell glm() that rows in the data represent a certain number of observations other than one?  Perhaps even fractional values?

Using the weights argument has no effect on the standard errors.  Compare the following; is there a way to get the first and last models to produce the same results?

data(sleep)
coef(summary(glm(extra ~ group, data=sleep)))
coef(summary(glm(extra ~ group, data=sleep, weights=rep(10L,nrow(sleep)))))
sleep10 = sleep[rep(1:nrow(sleep),10),]
coef(summary(glm(extra ~ group, data=sleep10)))
coef(summary(glm(extra ~ group, data=sleep10, weights=rep(0.1,nrow(sleep10)))))

My reason for asking is so that I can fit a model to a stacked multiple imputation data set, as suggested by:

Wood, A. M., White, I. R. and Royston, P. (2008), How should variable selection be performed with multiply imputed data?. Statist. Med., 27: 3227-3246. doi: 10.1002/sim.3177

Other suggestions would be most welcome.

_______________________________________________

Steve Taylor
Biostatistician
Pacific Islands Families Study
Faculty of Health and Environmental Sciences
AUT University



More information about the R-help mailing list