??? 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)
>
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.
2 matches
Mail list logo