confint.merMod: Compute Confidence Intervals for Parameters of a [ng]lmer Fit

Description Usage Arguments Details Value Note Examples

View source: R/profile.R

Description

Compute confidence intervals on the parameters of a *lmer() model fit (of class"merMod").

Usage

1
2
3
4
5
6
7
## S3 method for class 'merMod'
confint(object, parm, level = 0.95,
	method = c("profile", "Wald", "boot"), zeta,
	nsim = 500,
        boot.type = c("perc","basic","norm"),
        FUN = NULL, quiet = FALSE,
	oldNames = TRUE, ...)

Arguments

object

a fitted [ng]lmer model

parm

parameters for which intervals are sought. Specified by an integer vector of positions, character vector of parameter names, or (unless doing parametric bootstrapping with a user-specified bootstrap function) "theta_" or "beta_" to specify variance-covariance or fixed effects parameters only: see the which parameter of profile.

level

confidence level < 1, typically above 0.90.

method

a character string determining the method for computing the confidence intervals.

zeta

(for method = "profile" only:) likelihood cutoff (if not specified, as by default, computed from level).

nsim

number of simulations for parametric bootstrap intervals.

FUN

bootstrap function; if NULL, an internal function that returns the fixed-effect parameters as well as the random-effect parameters on the standard deviation/correlation scale will be used. See bootMer for details.

boot.type

bootstrap confidence interval type, as described in boot.ci. (Methods ‘stud’ and ‘bca’ are unavailable because they require additional components to be calculated.)

quiet

(logical) suppress messages about computationally intensive profiling?

oldNames

(logical) use old-style names for variance-covariance parameters, e.g. ".sig01", rather than newer (more informative) names such as "sd_(Intercept)|Subject"? (See signames argument to profile).

...

additional parameters to be passed to profile.merMod or bootMer, respectively.

Details

Depending on the method specified, confint() computes confidence intervals by

"profile":

computing a likelihood profile and finding the appropriate cutoffs based on the likelihood ratio test;

"Wald":

approximating the confidence intervals (of fixed-effect parameters only; all variance-covariance parameters CIs will be returned as NA) based on the estimated local curvature of the likelihood surface;

"boot":

performing parametric bootstrapping with confidence intervals computed from the bootstrap distribution according to boot.type (see bootMer, boot.ci).

Value

a numeric table (matrix with column and row names) of confidence intervals; the confidence intervals are computed on the standard deviation scale.

Note

The default method "profile" amounts to

1
2
    confint(profile(object, which=parm), signames=oldNames, ...),
            level, zeta)

where the profile method profile.merMod does almost all the computations. Therefore it is typically advisable to store the profile(.) result, say in pp, and then use confint(pp, level=*) e.g., for different levels.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy)
fm1W <- confint(fm1, method="Wald")# very fast, but ....
fm1W
testLevel <- if (nzchar(s <- Sys.getenv("LME4_TEST_LEVEL"))) as.numeric(s) else 1
if(interactive() || testLevel >= 3) {
 ## ~20 seconds, MacBook Pro laptop
 system.time(fm1P <- confint(fm1, method="profile", ## default
                             oldNames = FALSE))
 ## ~ 40 seconds
 system.time(fm1B <- confint(fm1,method="boot",
                             .progress="txt", PBargs=list(style=3)))
} else
  load(system.file("testdata","confint_ex.rda",package="lme4"))
fm1P
fm1B

Example output

Loading required package: Matrix
                 2.5 %    97.5 %
.sig01              NA        NA
.sig02              NA        NA
.sig03              NA        NA
.sigma              NA        NA
(Intercept) 238.029221 264.78099
Days          7.437595  13.49698
                                   2.5 %     97.5 %
sd_(Intercept)|Subject        14.3814417  37.715996
cor_Days.(Intercept)|Subject  -0.4815007   0.684986
sd_Days|Subject                3.8011641   8.753383
sigma                         22.8982669  28.857997
(Intercept)                  237.6806955 265.129515
Days                           7.3586533  13.575919
                                   2.5 %      97.5 %
sd_(Intercept)|Subject        11.7832300  35.6262540
cor_Days.(Intercept)|Subject  -0.5182688   0.8735497
sd_Days|Subject                3.3934920   8.1041000
sigma                         22.7334658  28.3893343
(Intercept)                  237.8983104 265.5389344
Days                           7.2444729  13.3640789

lme4 documentation built on May 29, 2017, 8:40 p.m.