Displaying 1 result from an estimated 1 matches for "nahn".
Did you mean:
nan
2010 Sep 23
1
How to pass a model formula as argument to with.mids
...like to pass a model formula as an argument to the with.mids
function from the mice package. The with.mids functon fits models to
multiply imputed data sets.
Here's a simple example
library(mice)
#Create multiple imputations on the nhanes data contained in the mice
package.
imp <- mice(nahnes)
#Fitting a linear model with each imputed data set the regular way works
fine
with(imp, lm(bmi~hyp+chl))
#Creating a formula object and than passing it as argument does not work:
form.obj <- formula(bmi~hyp+chl)
with(imp, lm(form.obj))
#The following doesn't work either
expr <-&quo...