JointAI (version 0.5.1)

JointAI: JointAI: Joint Analysis and Imputation of Incomplete Data

Description

The JointAI package performs simultaneous imputation and inference for incomplete data using the Bayesian framework. Distributions of incomplete variables, conditional on other covariates, are specified automatically and modeled jointly with the analysis model. MCMC sampling is performed in 'JAGS' via the R package rjags.

Arguments

Main functions

The package has the following main functions that allow analysis in different settings:

  • lm_imp for linear regression

  • glm_imp for generalized linear regression

  • clm_imp for cumulative logit models

  • lme_imp for linear mixed models

  • glme_imp for generalized linear mixed models

  • clmm_imp for cumulative logit mixed models

  • survreg_imp for parametric (Weibull) survival models

  • coxph_imp for Cox proportional hazard models

As far as possible, the specification of these functions is analogue to the specification of their complete data versions lm, glm, clm (from the package ordinal), lme (from the package nlme), clmm2 (from the package ordinal), survreg (from the package survival) and coxph (from the package survival).

Results can be summarized and printed with summary.JointAI, coef.JointAI and confint.JointAI, and visualized using traceplot or densplot. The function predict.JointAI 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

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. doi: 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. doi: 10.1177/0962280217730851