Nothing
knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
The mice
function is one of the most used functions to apply
multiple imputation. This page shows how functions in the psfmi
package can be easily used in combination with mice
. In this way
multivariable models can easily be developed in combination with mice.
You can install the released version of psfmi with:
install.packages("psfmi")
And the development version from GitHub with:
# install.packages("devtools") devtools::install_github("mwheymans/psfmi")
You can install the released version of mice with:
install.packages("mice")
library(psfmi) library(mice) imp <- mice(lbp_orig, m=5, maxit=5) data_comp <- complete(imp, action = "long", include = FALSE) library(psfmi) pool_lr <- psfmi_lr(data=data_comp, nimp=5, impvar=".imp", formula=Chronic ~ Gender + Smoking + Function + JobControl + JobDemands + SocialSupport, method="D1") pool_lr$RR_model
Back to [Examples]
library(psfmi) library(mice) imp <- mice(lbp_orig, m=5, maxit=5) data_comp <- complete(imp, action = "long", include = FALSE) library(psfmi) pool_lr <- psfmi_lr(data=data_comp, nimp=5, impvar=".imp", formula=Chronic ~ Gender + Smoking + Function + JobControl + JobDemands + SocialSupport, p.crit = 0.157, method="D1", direction = "FW") pool_lr$RR_model_final
Back to [Examples]
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.