Learn R Programming

parameters (version 0.4.0)

ci.merMod: Confidence Interval (CI)

Description

Compute confidence intervals (CI) for frequentist models.

Usage

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

# S3 method for default ci(x, ci = 0.95, method = NULL, ...)

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

# S3 method for mixor ci(x, ci = 0.95, effects = c("all", "fixed", "random"), ...)

# S3 method for glmmTMB ci( x, ci = 0.95, component = c("all", "conditional", "zi", "zero_inflated"), ... )

# S3 method for zeroinfl ci( x, ci = 0.95, component = c("all", "conditional", "zi", "zero_inflated"), ... )

# S3 method for hurdle ci( x, ci = 0.95, component = c("all", "conditional", "zi", "zero_inflated"), ... )

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

ci_robust( model, ci = 0.95, vcov_estimation = "HC", vcov_type = c("HC3", "const", "HC", "HC0", "HC1", "HC2", "HC4", "HC4m", "HC5", "CR0", "CR1", "CR1p", "CR1S", "CR2", "CR3"), vcov_args = NULL, ... )

Arguments

x

A statistical model.

ci

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

method

For mixed models of class merMod, can be "wald" (default), "ml1", "satterthwaite", "kenward" or "boot" (see also p_value_kenward and lme4::confint.merMod). For (generalized) linear models, can be "robust" to compute confidence intervals based on robust standard errors, and for generalized linear models, may also be "profile" (default) or "wald".

...

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

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.

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" or "all" (default). May be abbreviated.

model

Statistical model (no Bayesian models).

vcov_estimation

String, indicating the suffix of the vcov*()-function from the sandwich-package, e.g. vcov_estimation = "CL" (which calls vcovCL to compute clustered covariance matrix estimators), or vcov_estimation = "HC" (which calls vcovHC to compute heteroskedasticity-consistent covariance matrix estimators).

vcov_type

Character vector, specifying the estimation type for the robust covariance matrix estimation (see vcovHC for details).

vcov_args

List of named vectors, used as additional arguments that are passed down to the sandwich-function specified in vcov_estimation.

Value

A data frame containing the CI bounds.

Examples

Run this code
# NOT RUN {
library(parameters)
library(glmmTMB)

model <- glmmTMB(
  count ~ spp + mined + (1 | site),
  ziformula = ~mined,
  family = poisson(),
  data = Salamanders
)

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

Run the code above in your browser using DataLab