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

p_value.lmerMod

p-values for Mixed Models


Description

This function attempts to return, or compute, p-values of mixed models.

Usage

## S3 method for class 'cpglmm'
p_value(model, method = "wald", ...)

## S3 method for class 'glmmTMB'
p_value(
  model,
  component = c("all", "conditional", "zi", "zero_inflated", "dispersion"),
  verbose = TRUE,
  ...
)

## S3 method for class 'lmerMod'
p_value(model, method = "wald", ...)

## S3 method for class 'merMod'
p_value(model, method = "wald", ...)

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

## S3 method for class 'mixor'
p_value(model, effects = "all", ...)

Arguments

model

A statistical model.

method

For mixed models, can be "wald" (default), "ml1", "betwithin", "satterthwaite" or "kenward". For models that are supported by the sandwich or clubSandwich packages, may also be method = "robust" to compute p-values based ob robust standard errors.

...

Arguments passed down to standard_error_robust() when confidence intervals or p-values based on robust standard errors should be computed. Only available for models where method = "robust" is supported.

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.

Details

By default, p-values are based on Wald-test approximations (see p_value_wald). For certain situations, the "m-l-1" rule might be a better approximation. That is, for method = "ml1", p_value_ml1 is called. For lmerMod objects, if method = "kenward", p-values are based on Kenward-Roger approximations, i.e. p_value_kenward is called, and method = "satterthwaite" calls p_value_satterthwaite.

Value

A data frame with at least two columns: the parameter names and the p-values. Depending on the model, may also include columns for model components etc.

Note

p_value_robust() resp. p_value(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

if (require("lme4")) {
  data(iris)
  model <- lmer(Petal.Length ~ Sepal.Length + (1 | Species), data = iris)
  p_value(model)
}

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.