Learn R Programming

mlmhelpr (version 0.1.1)

robust_se: Robust Standard Errors

Description

Implements cluster-robust standard errors from the clubSandwich package. The clubSandwich package is required to use this function. See mlmhelpr::boot_se for an alternative.

Usage

robust_se(model, type = "CR2", pct = 95)

Value

Data frame and message indicating type of robust standard error requested.

Arguments

model

model produced using the lme4::lmer() function. This is an object of class merMod and subclass lmerMod.

type

character string specifying the estimation type. Options include "CR0", "CR1", "CR1p", "CR1S", "CR2", or "CR3". Defaults to "CR2". See details in clubSandwich::vcovCR.

pct

percentage level for confidence interval. Defaults to 95. Must be specified as a whole number between 1 and 100 (e.g., 99, 95, 80).

References

clubSandwichmlmhelpr

Examples

Run this code

# \donttest{

# run time > 5s
fit <- lme4::lmer(mathach ~ 1 + ses + catholic + (1|id),
data=hsb, REML=TRUE)

robust_se(fit)
# }


Run the code above in your browser using DataLab