p_calibrate: Calculate calibrated p-values.

View source: R/p_calibrate.R

p_calibrateR Documentation

Calculate calibrated p-values.

Description

Compute calibrated p-values that can be interpreted probabilistically, i.e. as posterior probability of H0 (given that H0 and H1 have equal prior probabilities).

Usage

p_calibrate(x, ...)

## Default S3 method:
p_calibrate(x, type = "frequentist", verbose = TRUE, ...)

Arguments

x

A numeric vector of p-values, or a regression model object.

...

Currently not used.

type

Type of calibration. Can be "frequentist" or "bayesian". See 'Details'.

verbose

Toggle warnings.

Details

The Bayesian calibration, i.e. when type = "bayesian", can be interpreted as the lower bound of the Bayes factor for H0 to H1, based on the data. The full Bayes factor would then require multiplying by the prior odds of H0 to H1. The frequentist calibration also has a Bayesian interpretation; it is the posterior probability of H0, assuming that H0 and H1 have equal prior probabilities of 0.5 each (Sellke et al. 2001).

The calibration only works for p-values lower than or equal to 1/e.

Value

A data frame with p-values and calibrated p-values.

References

Thomas Sellke, M. J Bayarri and James O Berger (2001) Calibration of p Values for Testing Precise Null Hypotheses, The American Statistician, 55:1, 62-71, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1198/000313001300339950")}

Examples

model <- lm(mpg ~ wt + as.factor(gear) + am, data = mtcars)
p_calibrate(model, verbose = FALSE)

parameters documentation built on Oct. 18, 2024, 5:13 p.m.