This function attempts to return, or compute, p-values of a model's parameters. See the documentation for your object's class:

p_value(model, ...)

# S3 method for default
p_value(model, method = NULL, verbose = TRUE, ...)

# S3 method for emmGrid
p_value(model, ci = 0.95, adjust = "none", ...)

Arguments

model

A statistical model.

...

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.

method

If "robust", and if model is supported by the sandwich or clubSandwich packages, computes p-values based on robust covariance matrix estimation.

verbose

Toggle warnings and messages.

ci

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

adjust

Character value naming the method used to adjust p-values or confidence intervals. See ?emmeans::summary.emmGrid for details.

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

data(iris)
model <- lm(Petal.Length ~ Sepal.Length + Species, data = iris)
p_value(model)
#>           Parameter            p
#> 1       (Intercept) 1.005180e-11
#> 2      Sepal.Length 1.121002e-28
#> 3 Speciesversicolor 9.645641e-67
#> 4  Speciesvirginica 4.917626e-71