Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ci.merMod

Confidence Intervals (CI)


Description

Compute confidence intervals (CI) for frequentist models.

Usage

## Default S3 method:
ci(x, ci = 0.95, dof = Inf, method = NULL, ...)

## S3 method for class 'glm'
ci(x, ci = 0.95, method = c("profile", "wald", "robust"), ...)

## S3 method for class 'DirichletRegModel'
ci(x, ci = 0.95, component = c("all", "conditional", "precision"), ...)

## S3 method for class 'betareg'
ci(x, ci = 0.95, component = c("all", "conditional", "precision"), ...)

## S3 method for class 'glmmTMB'
ci(
  x,
  ci = 0.95,
  component = c("all", "conditional", "zi", "zero_inflated", "dispersion"),
  method = c("wald", "ml1", "betwithin", "robust", "profile", "uniroot"),
  verbose = TRUE,
  ...
)

## S3 method for class 'merMod'
ci(
  x,
  ci = 0.95,
  method = c("wald", "ml1", "betwithin", "satterthwaite", "kenward", "boot", "profile"),
  ...
)

## S3 method for class 'polr'
ci(x, ci = 0.95, method = c("profile", "wald", "robust"), ...)

## S3 method for class 'poissonmfx'
ci(
  x,
  ci = 0.95,
  component = c("all", "conditional", "marginal"),
  method = NULL,
  ...
)

## S3 method for class 'betamfx'
ci(
  x,
  ci = 0.95,
  component = c("all", "conditional", "precision", "marginal"),
  method = NULL,
  ...
)

## S3 method for class 'MixMod'
ci(
  x,
  ci = 0.95,
  component = c("all", "conditional", "zi", "zero_inflated"),
  verbose = TRUE,
  ...
)

## S3 method for class 'mixor'
ci(x, ci = 0.95, effects = "all", ...)

## S3 method for class 'lme'
ci(x, ci = 0.95, method = c("wald", "betwithin", "ml1", "satterthwaite"), ...)

## S3 method for class 'clm2'
ci(x, ci = 0.95, component = c("all", "conditional", "scale"), ...)

## S3 method for class 'zeroinfl'
ci(
  x,
  ci = 0.95,
  component = c("all", "conditional", "zi", "zero_inflated", "dispersion"),
  method = c("wald", "ml1", "betwithin", "robust", "profile", "uniroot"),
  verbose = TRUE,
  ...
)

## S3 method for class 'hurdle'
ci(
  x,
  ci = 0.95,
  component = c("all", "conditional", "zi", "zero_inflated", "dispersion"),
  method = c("wald", "ml1", "betwithin", "robust", "profile", "uniroot"),
  verbose = TRUE,
  ...
)

## S3 method for class 'HLfit'
ci(
  x,
  ci = 0.95,
  method = c("wald", "ml1", "betwithin", "profile", "boot"),
  iterations = 100,
  ...
)

Arguments

x

A statistical model.

ci

Confidence Interval (CI) level. Default to 0.95 (95%).

dof

Degrees of Freedom. If not specified, for ci_wald(), defaults to model's residual degrees of freedom (i.e. n-k, where n is the number of observations and k is the number of parameters). For p_value_wald(), defaults to Inf.

method

For mixed models, can be "wald" (default), "ml1" or "betwithin". For linear mixed model, can also be "satterthwaite", "kenward" or "boot" (see lme4::confint.merMod). For (generalized) linear models, can be "robust" to compute confidence intervals based on robust covariance matrix estimation, and for generalized linear models and models from packages lme4 or glmmTMB, may also be "profile", "uniroot" or "wald" (default).

...

Arguments passed down to standard_error_robust() when confidence intervals or p-values based on robust standard errors should be computed.

component

Should all parameters, parameters for the conditional model, or for the zero-inflated part of the model be returned? Applies to models with zero-inflated component. component may be one of "conditional", "zi", "zero-inflated", "dispersion" or "all" (default). May be abbreviated.

verbose

Toggle warnings and messages.

effects

Should standard errors for fixed effects or random effects be returned? Only applies to mixed models. May be abbreviated. When standard errors for random effects are requested, for each grouping factor a list of standard errors (per group level) for random intercepts and slopes is returned.

iterations

The number of draws to simulate/bootstrap.

Value

A data frame containing the CI bounds.

Note

ci_robust() resp. ci(method = "robust") rely on the sandwich or clubSandwich package (the latter if vcov_estimation = "CR" for cluster-robust standard errors) and will thus only work for those models supported by those packages.

Examples

library(parameters)
if (require("glmmTMB")) {
  model <- glmmTMB(
    count ~ spp + mined + (1 | site),
    ziformula = ~mined,
    family = poisson(),
    data = Salamanders
  )

  ci(model)
  ci(model, component = "zi")
}

parameters

Processing of Model Parameters

v0.13.0
GPL-3
Authors
Daniel Lüdecke [aut, cre] (<https://orcid.org/0000-0002-8895-3206>, @strengejacke), Dominique Makowski [aut] (<https://orcid.org/0000-0001-5375-9967>), Mattan S. Ben-Shachar [aut] (<https://orcid.org/0000-0002-4287-4801>), Indrajeet Patil [aut] (<https://orcid.org/0000-0003-1995-6531>, @patilindrajeets), Søren Højsgaard [aut], Zen J. Lau [ctb], Vincent Arel-Bundock [ctb] (<https://orcid.org/0000-0003-1995-6531>, @vincentab), Jeffrey Girard [ctb] (<https://orcid.org/0000-0002-7359-3746>, @jeffreymgirard)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.