miceadds (version 3.17-44)

Rhat.mice: Rhat Convergence Statistic of a mice Imputation

Description

Computes the Rhat statistic for a mids object.

Usage

Rhat.mice(mice.object)

Value

Data frame containing the Rhat statistic for mean and variances for all variables of the Markov chains used for imputation

Arguments

mice.object

Object of class mids

References

Gelman, A., & Hill, J. (2007). Data analysis using regression and multilevel/hierarchical models. Cambridge University Press.

Examples

Run this code
if (FALSE) {
#############################################################################
# EXAMPLE 1: Rhat statistic for nhanes data
#############################################################################

library(mice)
data(nhanes, package="mice")
set.seed(9090)

# nhanes 3 parallel chains
imp1 <- mice::mice( nhanes, m=3, maxit=10, method=rep("norm", 4 ))
miceadds::Rhat.mice( imp1 )
  ##     variable MissProp Rhat.M.imp Rhat.Var.imp
  ##   1      bmi       36  1.0181998     1.155807
  ##   2      hyp       32  1.0717677     1.061174
  ##   3      chl       40  0.9717109     1.318721
}

Run the code above in your browser using DataLab