Showing posts with label multiple imputation. Show all posts
Showing posts with label multiple imputation. Show all posts

Friday, February 26, 2016

Multiple imputation using R

R has a long list of packages for multiple imputation. The main problem is integration: statistical procedures in other packages may or may not work with the imputation procedures. I have been using Amelia together with Zelig. Because they were written by the same group, they work well together. However, I have been having trouble with making multiple imputation to work with the plm package. After searching the internet, here comes the solution:

  1. Impute the missing data using Amelia or Mice.
  2. Estimate the model on each imputed data.
  3. Use the mitools package to extract and combine results. 
For example, here is a simple example:
...
imp <- mice(d)
mydata <- imputationList(lapply(1:5, complete, x = imp))
fit <- lapply(mydata$imputations, function(x){
plm(cog3pl ~ oc + grade9 + boy + han + ruralbirth, data = x,
index = c("schids"), model = "pooling")})
betas <- MIextract(fit, fun = coef)
vars <- MIextract(fit, fun = vcov)
summary(MIcombine(betas, vars))
I bet this will work for most, if not all, estimation procedures in R.

Sunday, October 30, 2011

Using externally generated multiply imputed data sets with Zelig

This post provides some hints. This may be what I need to improve my infant mortality paper.

The same can be achieved using the "mi()" function provided by the Zelig package.

Wednesday, March 21, 2007

Multiple imputation with growth modeling

Several days ago, a new user-contributed Stata module "MIM" appears in the Stata software repository. This module can automate the process of combing estimates from multiply imputed data sets and calculating confidence intervals for a wide array of Stata estimation commands, including "XTMIXED". This means that the complete process of imputation, estimation, and post-estimation can be done without leaving Stata.

Saturday, March 10, 2007

Multiple imputation with longitudinal data

Have been working with Sarah on revising our comparative paper. One problem we need to solve in this revision is the presence of large amount of missing values. I use "ICE", a user contributed module in Stata to do the imputation. Unfortunately, the built-in estimation procedures does not include "XTMIXED" or "GLLAMM". I have to import the imputed data sets into Mplus and do the estimation there.

Counter