Compute Confidence Intervals for Fixed Effects in a Linear Mixed Model
confint.rlmerMod.Rd
This function calculates confidence intervals for the fixed effects of a
fitted linear mixed-effects model (of class rlmerMod
). The intervals are
computed based on the estimated coefficients and their standard errors using
a normal distribution.
Usage
# S3 method for class 'rlmerMod'
confint(mod, parm, level = 0.95)
Arguments
- mod
A fitted linear mixed-effects model object of class
rlmerMod
. This is typically created using therlmer
function from therobustlmm
package.- parm
A character vector specifying which parameters (fixed effects) to compute confidence intervals for. If missing, confidence intervals for all fixed effects are computed.
- level
A numeric value between 0 and 1 indicating the confidence level for the intervals. The default is 0.95 for 95% confidence intervals.
Value
A matrix of confidence intervals for the specified fixed effects. Each row corresponds to a fixed effect, with columns representing the lower and upper bounds of the confidence intervals.
Examples
library(robustlmm)
#> Loading required package: lme4
#> Loading required package: Matrix
# Fit a linear mixed-effects model
mod <- rlmer(Reaction ~ Days + (Days | Subject), data = sleepstudy)
# Compute 95% confidence intervals for all fixed effects
confint(mod)
#> 2.5% 97.5%
#> (Intercept) 236.976956 265.48981
#> Days 7.455326 13.84218
# Compute 99% confidence intervals for specific parameters
confint(mod, parm = "Days", level = 0.99)
#> 0.5% 99.5%
#> 6.451878 14.845632