EP16: Missing Values in Clinical Research

Multiple Imputation


This website contains materials for the NIHES course Missing Values in Clinical Research (EP16):

  • lecture slides
  • practicals

Download a .zip file with all materials:

The practicals require R, and JAGS (necessary for the parts of the practical that use the JointAI package) needs to be installed.

To download and install R, go to https://cran.r-project.org/.

To download JAGS, go to https://sourceforge.net/projects/mcmc-jags/files/.

Software

The practicals require R, and JAGS (necessary for the parts of the practical that use the JointAI package) needs to be installed.

R

You can download R here:

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

JAGS

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.

R packages

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")




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.