JointAI (version 1.0.2)

JointAI: JointAI: Joint Analysis and Imputation of Incomplete Data

Description

The JointAI package performs simultaneous imputation and inference for incomplete or complete data under the Bayesian framework. Models for incomplete covariates, conditional on other covariates, are specified automatically and modelled jointly with the analysis model. MCMC sampling is performed in 'JAGS' via the R package rjags.

Arguments

Main functions

JointAI provides the following main functions that facilitate analysis with different models:

As far as possible, the specification of these functions is analogous to the specification of widely used functions for the analysis of complete data, such as lm, glm, lme (from the package nlme), survreg (from the package survival) and coxph (from the package survival).

Computations can be performed in parallel to reduce computational time, using the packages future (and doFuture), the argument shrinkage allows the user to impose a penalty on the regression coefficients of some or all models involved, and hyper-parameters can be changed via the argument hyperpars.

To obtain summaries of the results, the functions summary(), coef() and confint() are available, and results can be visualized with the help of traceplot() or densplot().

The function predict() allows prediction (including credible intervals) from JointAI models.

Evaluation and export

Two criteria for evaluation of convergence and precision of the posterior estimate are available:

  • GR_crit implements the Gelman-Rubin criterion ('potential scale reduction factor') for convergence

  • MC_error calculates the Monte Carlo error to evaluate the precision of the MCMC sample

Imputed data can be extracted (and exported to SPSS) using get_MIdat(). The function plot_imp_distr() allows visual comparison of the distribution of observed and imputed values.

Other useful functions

Vignettes

The following vignettes are available

References

Nicole S. Erler, Dimitris Rizopoulos and Emmanuel M.E.H. Lesaffre (2019). JointAI: Joint Analysis and Imputation of Incomplete Data in R. arXiv e-prints, arXiv:1907.10867. URL https://arxiv.org/abs/1907.10867.

Erler, N.S., Rizopoulos, D., Rosmalen, J., Jaddoe, V.W.V., Franco, O. H., & Lesaffre, E.M.E.H. (2016). Dealing with missing covariates in epidemiologic studies: A comparison between multiple imputation and a full Bayesian approach. Statistics in Medicine, 35(17), 2955-2974. 10.1002/sim.6944

Erler, N.S., Rizopoulos D., Jaddoe, V.W.V., Franco, O.H. & Lesaffre, E.M.E.H. (2019). Bayesian imputation of time-varying covariates in linear mixed models. Statistical Methods in Medical Research, 28(2), 555<U+2013>568. 10.1177/0962280217730851