Artikel-Schlagworte: „Multiple Imputation“
Multiple imputation (ordinary ANOVA) with R
At first, if you are not familiar with R, you need to install R from CRAN and (under Win32) Tinn-R. Tinn-R enables to control R via script. If you use Linux, just install R via your distribution of choice and then there is an add-on for Emacs to control R (ESS). The next is to start R via Tinn-R or Emacs. Don’t forget to choose you ‘hotkeys‘ in Tinn-R (or any other editor of your choice to control R).
For multiple imputation, I choose the R-package ‘mice‘ from van Buuren et al. You have to install it manually. There are also other packages that deal with it, see:
library.search("imputation")
If you are not familiar with the R-style to formulate linear models, start with
?lm example(lm)
or read the usual intros and manuals that are linked via CRAN (or the contributed documentations) – otherwise search on the internet with your search machine of choice with the add-on ‘cran’ like ‘mulitple imputation cran’ or ‘missing data cran’, etc.
The folllowing are excerpts from the man-pages of ‘mice’-package commandos.
?read.table # import of data - see tutorials and intros to R
# of 'how to import data'
library(help=mice)# what is inside package 'mice'?
library(mice) # load library for MI
data(nhanes) # use data from 'mice'-package
str(nhanes)
nhanes # show data
?mice # produce Multivariate Imputation by Chained Equations
imp <- mice(nhanes)
imp
str(imp)
?lm.mids # Performs repeated linear regression
# on multiply imputed data set
lm.mids # R-source code of 'lm.mids'
fit <- lm.mids(bmi~hyp+chl,data=imp)
fit
summary(fit)
str(fit)
?pool #
pool(fit) # pool results
summary(pool(fit))# better output
pool # R-source code of 'pool'
That’s all. Multiple imputation (ordinary ANOVA) is quite easy to peform in R.