This function attempts to return, or compute, p-values of a model's parameters. The nature of the p-values is different depending on the model:
Mixed models (lme4): 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
.
Bayesian models (rstanarm, brms): For Bayesian models, the p-values corresponds to the probability of direction (p_direction
), which is converted to a p-value using bayestestR::convert_pd_to_p()
.
p_value(model, ...)# S3 method for default
p_value(model, method = NULL, ...)
# S3 method for lmerMod
p_value(model, method = "wald", ...)
# S3 method for merMod
p_value(model, method = "wald", ...)
# S3 method for rlmerMod
p_value(model, method = "wald", ...)
# S3 method for glmmTMB
p_value(
model,
component = c("all", "conditional", "zi", "zero_inflated", "dispersion"),
...
)
# S3 method for MixMod
p_value(model, component = c("all", "conditional", "zi", "zero_inflated"), ...)
# S3 method for mixor
p_value(model, effects = c("all", "fixed", "random"), ...)
# S3 method for emmGrid
p_value(model, ci = 0.95, adjust = "none", ...)
# S3 method for poissonmfx
p_value(model, component = c("all", "conditional", "marginal"), ...)
# S3 method for betamfx
p_value(
model,
component = c("all", "conditional", "precision", "marginal"),
...
)
# S3 method for averaging
p_value(model, component = c("conditional", "full"), ...)
# S3 method for DirichletRegModel
p_value(model, component = c("all", "conditional", "precision"), ...)
# S3 method for clm2
p_value(model, component = c("all", "conditional", "scale"), ...)
# S3 method for gee
p_value(model, method = NULL, ...)
A statistical model.
Arguments passed down to standard_error_robust()
when confidence intervals or p-values based on robust standard errors should be computed.
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.
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.
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.
Confidence Interval (CI) level. Default to 0.95 (95%).
Character value naming the method used to adjust p-values or confidence intervals. See ?emmeans::summary.emmGrid
for details.
The p-values.
# NOT RUN {
if (require("lme4")) {
data(iris)
model <- lmer(Petal.Length ~ Sepal.Length + (1 | Species), data = iris)
p_value(model)
}
# }
Run the code above in your browser using DataLab