lm.mi {mi}R Documentation

Linear Regression Function for Multiply Imputed Dataset

Description

Linear Regression Function that pulls together the estimates from multiply imputed dataset.

Usage

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

Arguments

formula View lm for detail.
mi.object mi object.
x mi.lm object.
object mi.lm object.
digits number of significant digits to display, default=2.
... Any option to pass on to lm function.

Details

Extracs the starting values from mi.method object family.

Value

call the matched call.
mi.pooled pulled estimates from the multiple dataset.
mi.fit estimates from each dataset. See lm 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 <- lm.mi(y ~ x, dat.mi)
  display(fit)
  coef(fit)
  se.coef(fit)

[Package mi version 0.04-6 Index]