mice
ImputationRhat.mice.Rd
Computes the Rhat statistic for a mids
object.
Rhat.mice(mice.object)
Object of class mids
Data frame containing the Rhat statistic for mean and variances for all variables of the Markov chains used for imputation
Gelman, A., & Hill, J. (2007). Data analysis using regression and multilevel/hierarchical models. Cambridge University Press.
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
}