Re: [R] How to pass a model formula as argument to with.mids

2010-09-23 Thread Bert Gunter
??? Use lm's data argument to do this, not the with() construction: > x <- 1:10 > y <- 2*x+5 +rnorm(10) > form <- formula(y~x) > class(form) [1] "formula" > lm(form) Call: lm(formula = form) Coefficients: (Intercept)x 5.7471.921 > dat <- data.frame(x=x,y=y) > rm(x,y) >

[R] How to pass a model formula as argument to with.mids

2010-09-23 Thread Erich Studerus
Hello I would 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.