rMIDAS is an R package for accurate and efficient multiple imputation using deep learning methods. The package provides a simplified workflow for imputing and then analyzing data:
convert()carries out all necessary preprocessing steps
train()constructs and trains a MIDAS imputation model
complete()generates multiple completed datasets from the trained model
combine()runs regression analysis across the complete data, following Rubin’s combination rules
rMIDAS is based on the Python class MIDASpy.
rMIDAS also incorporates several features to streamline and improve the the efficiency of multiple imputation analysis:
glm(applying Rubin’s combination rules)
For more information on the underlying multiple imputation method, MIDAS, see:
Lall, Ranjit, and Thomas Robinson. 2020. “Applying the MIDAS Touch: How to Handle Missing Values in Large and Complex Data.” APSA Preprints. https://doi.org/10.33774/apsa-2020-3tk40-v3
rMIDAS is now available on CRAN. To install the package in R, you can use the following code:
To install the latest development version, please use the following code:
# install.packages("devtools") devtools::install_github("MIDASverse/rMIDAS")
Note that rMIDAS uses the
reticulate package to interface
with Python. Users must have Python 3.5 - 3.8 installed in order to run
MIDAS (Python 3.9 is not yet supported). rMIDAS will automatically try
to set up a Python configuration unless users specify their own version
set_python_env() (examples below). Setting a custom Python
install must be performed before training or imputing data occurs:
library(rMIDAS) # Point to a Python binary set_python_env(python = "path/to/python/binary") # Or point to a virtualenv binary set_python_env(python = "virtual_env", type = "virtualenv") # Or point to a condaenv, where conda can be supplied to choose a specific executable set_python_env(python = "conda_env", type = "condaenv", conda = "auto") # Now run rMIDAS::train() and rMIDAS::complete()...
rMIDAS is packaged with two vignettes:
vignette("imputation_demo", "rMIDAS")demonstrates the basic workflow and capacities of rMIDAS
vignette("custom_python_versions", "rMIDAS")provides detailed guidance on configuring Python binaries and environments, including some troubleshooting tips
rMIDAS is still in development, and we may not have caught all bugs. If you come across any difficulties, or have any suggestions for improvements, please raise an issue here.
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.