glm.mi {mi}R Documentation

Generalized Linear Modeling Function for Multiply Imputed Dataset

Description

Generalized Linear Modeling Function that pulls together the estimates from multiple imputed dataset.

Usage

glm.mi(formula, mi.object, family = gaussian, ...)
bayesglm.mi(formula, mi.object, family = gaussian, ...)
## S3 method for class 'mi.glm':
print(x, ...)
## S4 method for signature 'mi.glm':
coef(object)
## S4 method for signature 'mi.glm':
se.coef(object)
## S4 method for signature 'mi.glm':
display(object, digits=2)

Arguments

formula See glm for detail.
mi.object mi object.
family See glm for detail.
x mi.glm object.
object mi.glm object.
digits number of significant digits to display, default=2.
... Any option to pass on to glm or bayesglm function.

Details

See glm, bayesglm.

Value

call the matched call.
mi.pooled pulled estimates from the multiple dataset.
mi.fit estimates from each dataset. See glm for details.

Author(s)

Masanao Yajima yajima@stat.columbia.edu, Yu-Sung Su ys463@columbia.edu, M.Grazia Pittau grazia@stat.columbia.edu, Andrew Gelman gelman@stat.columbia.edu

References

Andrew Gelman and Jennifer Hill, Data Analysis Using Regression and Multilevel/Hierarchical Models, Cambridge University Press, 2007.

See Also

mi, lm.mi

Examples

  # true data
  x <- rnorm(100,0,1) # N(0,1)
  y <- rnorm(100,(1+2*x),1.2) # y ~ 1 + 2*x + N(0,1.2)

  # create artificial missingness
  x[seq(1,100,10)]<-NA
  y[seq(2,98,10)]<-NA
  dat.xy <- data.frame(x,y)

  # imputation 
  dat.mi <- mi(dat.xy)

  # fitting linear regression 
  fit <- glm.mi(y ~ x, dat.mi, family = gaussian)
  display(fit)
  coef(fit)
  se.coef(fit)
  
  fit2 <- bayesglm.mi(y ~ x, dat.mi, family = gaussian)
  display(fit2)
  coef(fit2)
  se.coef(fit2)


[Package mi version 0.04-6 Index]