rlmerMod-class: rlmerMod Class

rlmerMod-classR Documentation

rlmerMod Class

Description

Class "rlmerMod" of Robustly Fitted Mixed-Effect Models

Details

A robust mixed-effects model as returned by rlmer.

Objects from the Class

Objects are created by calls to rlmer.

Methods

Almost all methods available from objects returned from lmer are also available for objects returned by rlmer. They usage is the same.

It follows a list of some the methods that are exported by this package:

  • coef

  • deviance (disabled, see below)

  • extractAIC (disabled, see below)

  • family

  • fitted

  • fixef

  • formula

  • getInfo

  • isGLMM

  • isLMM

  • isNLMM

  • isREML

  • logLik (disabled, see below)

  • model.frame

  • model.matrix

  • nobs

  • plot

  • predict

  • ranef (only partially implemented)

  • residuals

  • sigma

  • summary

  • terms

  • update

  • VarCorr

  • vcov

  • weights

Disabled methods

A log likelihood or even a pseudo log likelihood is not defined for the robust estimates returned by rlmer. Methods that depend on the log likelihood are therefore not available. For this reason the methods deviance, extractAIC and logLik stop with an error if they are called.

Coefficient-table degrees of freedom

By default (df = "auto") summary(object) reports a Satterthwaite-type df and a Pr(>|t|) column for the fixed effects whenever computing it is cheap – either the underlying influence function is already cached on the fit (from an earlier cooks.distance, vcov sandwich, confint or summary call), or its deterministic size workload is within the cutoff getOption("robustlmm.summary.df.max", 5000). On larger fits "auto" falls back to the historic Estimate / Std. Error / t value table (no p-values, as for lmer) and prints a one-line note on how to request the df anyway. Use df = "satterthwaite" to always compute it (which may be slow on large data) or df = "none" to never compute it. The cutoff is a dimensionless function of the problem size (number of observations, parameters and the df method), so the same fit behaves identically on every machine; raise or lower robustlmm.summary.df.max to show the df on larger or only on smaller fits. See robustlmm-options for this option. Unlike lmerTest, the degrees of freedom are derived from the robust, influence-function-based covariance of the variance parameters, so they stay honest under contamination. The Satterthwaite construction follows Giesbrecht and Burns (1985) and Fai and Cornelius (1996); inserting a robust sandwich covariance into the moment-matching ratio parallels the cluster-robust approach of Bell and McCaffrey (2002) and Pustejovsky and Tipton (2018). The approximation is reliable only for a moderate number of grouping levels; summary prints a note recommending confint(object, method = "boot") when the smallest grouping factor has fewer than 20 levels. The feature supports single-factor, nested (e.g. (1 | school/class)) and crossed (e.g. (1 | subject) + (1 | item)) designs with diagonal random effects, including Mallows-weighted fits, with the default vcov. Nested designs use a one-way cluster sandwich over the coarsest grouping factor; crossed designs use a Cameron-Gelbach-Miller multiway cluster-robust covariance, projected to the nearest positive-semidefinite matrix. Designs not covered (e.g. crossed random slopes) fall back to t-values with an explanatory note. The same Satterthwaite df is used by emmeans results (emmeans, emtrends, contrast) for this class when the default vcov is in effect; a user-supplied vcov. keeps the asymptotic (Inf, z-based) degrees of freedom. When a variance component is estimated at 0 (a boundary fit), the df is computed conditional on that component being held at the boundary – it equals the df of the model with that component dropped – and summary notes this; only a genuinely non-identifiable (singular) fit suppresses the df.

See Also

rlmer; corresponding class in package lme4: merMod

Examples


showClass("rlmerMod")

## convert an object of type 'lmerMod' to 'rlmerMod'
## to use the methods provided by robustlmm
fm <- lmer(Yield ~ (1|Batch), Dyestuff)
rfm <- as(fm, "rlmerMod")
compare(fm, rfm)


robustlmm documentation built on July 30, 2026, 5:11 p.m.