Learn R Programming

robustlmm (version 3.5.0-2)

resolveCluster: Resolve a cluster specification for a fitted rlmerMod object.

Description

Used by vcov_sandwich. For a single grouping factor (nested design) the cluster-robust sandwich is exact; for crossed factors no single clustering nests every random-effect block, so a warning is issued and the sandwich is approximate.

Usage

resolveCluster(fit, cluster, n)

Value

A length-n factor of cluster memberships.

Arguments

fit

rlmerMod object.

cluster

NULL (auto-detect: use the sole grouping factor, or error if the design is crossed), a character string naming a grouping factor of the model, or a length-n vector of cluster memberships.

n

Number of observations.