This repository contains slides and materials for the Multiple Imputation part of NIHES course EP16: Missing Values in Clinical Research.
This repo has a website where you can find slides and practicals.
The practicals require R, and JAGS (necessary for the parts of the practical that use the JointAI package) needs to be installed.
You can download R here:
- Windows: https://cran.r-project.org/bin/windows/base/
- Mac OS: https://cran.r-project.org/bin/macosx/
- Linux: https://cran.r-project.org/bin/linux/
It is strongly recommended to use a recent version of R, i.e., version 4.0.0 or later.
To check the version number of R, you can use the following syntax (in R):
R.version.string
To download the latest version of JAGS, go to https://sourceforge.net/projects/mcmc-jags/files/.
The JAGS version should be 4.2.0 or later.
You will also need the following R packages:
install.packages("mice")
install.packages("JointAI")
install.packages("ggplot2")
install.packages("corrplot")
For the packages mice and JointAI it is important that you have recent versions installed.
- mice version 3.8.0 or later
- JointAI version 0.6.1
To check which version of a package you have installed, you can use the function
packageVersion()
, for example
packageVersion("JointAI")
packageVersion("mice")
Once you have the package JointAI installed1, you can use the following syntax to check if R can find JAGS, and which version of JAGS is installed:
rjags::jags.version()
There are a number of additional packages that may be useful:
install.packages("VIM")
install.packages("naniar")
install.packages("visdat")
install.packages("mitools")
install.packages("miceadds")
1: This function is not actually part of JointAI, but of the package rjags. Since JointAI depends on rjags, rjags will be installed automatically with JointAI.