This website contains materials for the NIHES course Missing Values in Clinical Research (EP16):
- lecture slides
To download and install R, go to https://cran.r-project.org/.
To download JAGS, go to https://sourceforge.net/projects/mcmc-jags/files/.
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):
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
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:
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.