This site contains materials for the Biostatistics Workshop Handling
missing data in R
with mice
the 45th Annual Meeting of the
Statistical Society of Canada, dated Sunday, June 11, 2017, located in
Winnipeg E3 - 270 (EITC).
Nearly all data analytic procedures in R are designed for complete data, and many will fail if the data contain missing values. Typically, procedures simply ignore any incomplete rows in the data, or use ad-hoc procedures like replacing missing values with some sort of “best value”. However, such fixes may introduce biases in the ensuing statistical analysis.
Multiple imputation is a principled solution for this problem. The aim
of this workshop is to enable participants to perform and evaluate
multiple imputation using the R package mice
.
The workshop will consist of 5 sessions, each of which comprises a
lecture followed by a computer practical using R
:
- Session I: Introduction, issues raised by missing data, and towards a systematic approach
- Session II: Introduction to multiple imputation
- Session III: Multivariate missing data (joint model approach, chained equations)
- Session IV: Imputation in practice (large data sets, hierarchical data, non-linearities, interactions)
- Session V: After imputation, guidelines for analysis and reporting
Please remember to bring your own laptop computer and make sure that you have write-access to that machine (some corporate computers do not allow write access) or that you have the following software and packages pre-installed.
- Download and install the latest version of
R
from the R-Project website - Download and install the most recent version of
RStudio Desktop (Free License)
from RStudio’s website. This is not necessary, per se, but it is highly recommended asRStudio
delivers a tremendous improvement to the user experience of baseR
. - Install the following packages:
mice
, andlattice
- You can simply install packages from within
RStudio
by navigating toTools > Install Packages
in the upper menu and enteringmice, lattice
into thePackages
field. Make sure that the buttonInstall dependencies
is selected. Once done, clickInstall
and you’re all set. - Or, from within
R
orRStudio
, copy, paste and enter the following code in the console window (by default the top-right window inRStudio
/ the only window inR
):
install.packages("mice")
install.packages("lattice")