-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use dot to include all the predictors in Logistic regression model after imputation #265
Comments
Thanks for bringing this to my attention. No quick fix. I wrote
I would need to rethink the design and see what is possible with modern tools and recent texts, especially Hadley's Advanced book. If there is somebody out there with a good understanding of the R evaluation model, please feel free to drop by. It might well be that the solution is a lot simpler than the current |
Another quick option for the case of require(mice, warn.conflicts = FALSE)
#> Loading required package: mice
set.seed(123)
nhanes$hyp <- as.factor(nhanes$hyp)
imputed_data <- mice::mice(nhanes, m = 5, method = "pmm",
maxit = 10, seed = 12345, print = FALSE)
imputed_model <- with(imputed_data,
glm(hyp ~ ., family = binomial(link = 'logit'), data = mget(names(nhanes))))
imputed_model$analyses[[1]]
#>
#> Call: glm(formula = hyp ~ ., family = binomial(link = "logit"), data = mget(names(nhanes)))
#>
#> Coefficients:
#> (Intercept) age bmi chl
#> -31.45358 5.24968 0.89800 -0.02669
#>
#> Degrees of Freedom: 24 Total (i.e. Null); 21 Residual
#> Null Deviance: 21.98
#> Residual Deviance: 13.06 AIC: 21.06 |
Commit 4634094 simplifies |
Because of downstream issues, |
Hi there,
I have use MICE to do the imputation. As the dataset we use has many variables, I try to use a dot in the glm function to include all the predictors instead of typing all the names of the predictors. However, an error message occurs.
Here I use the nhanes dataset as an example
Is there another quick way to include all the predictors in the dataset without typing out the names in the analysis model? Many thanks for any assistance.
The text was updated successfully, but these errors were encountered: