rhat_max: Quick Max R-hat Calculation

View source: R/rhat_max.R

rhat_maxR Documentation

Quick Max R-hat Calculation

Description

Calculates the largest R-hat statistic across all variables and chain statistics for the it most recent iterations

Usage

rhat_max(mids, n = 1L)

Arguments

mids

A mids object as created by mice::mice()

n

The number of recent iterations for which R-hat should be calculated. If this is larger than the total number of iterations, it is truncated.

Value

A scalar double containing the maximum R-hat statistic

Examples

# Create `mids` object
mids <- mice::mice(mice::nhanes)

# Get max R-hat for most recent 2 iterations
rhat <- rhat_max(mids, n = 2L)
rhat


jesse-smith/futuremice documentation built on Nov. 24, 2023, 7:19 a.m.