ciCalibrate {ciCalibrate}R Documentation

Calibrate confidence intervals to support intervals

Description

This function computes a support interval for an unknown parameter based on either a confidence interval for the parameter or a parameter estimate with standard error.

Usage

ciCalibrate(
  ci = NULL,
  ciLevel = 0.95,
  estimate = mean(ci),
  se = diff(ci) * 0.5/stats::qnorm(p = 0.5 * (1 + ciLevel)),
  siLevel = 1,
  method = c("SI-normal", "SI-normal-local", "SI-normal-nonlocal", "mSI-all",
    "mSI-normal-local", "mSI-eplogp"),
  priorMean,
  priorSD
)

Arguments

ci

Confidence interval given as a numeric vector of length two.

ciLevel

Confidence level. Defaults to 0.95.

estimate

Parameter estimate. Only required if no confidence interval and confidence level are specified.

se

Standard error of the parameter estimate. Only required if no confidence interval and confidence level are specified.

siLevel

Support level. Defaults to 1.

method

Calibration method. Can either be "SI-normal", "SI-normal-local", "SI-normal-nonlocal", "mSI-all", "mSI-normal-local", or "mSI-eplogp". Defaults to "SI-normal". See details for more information.

priorMean

Prior mean, only required for "SI-normal".

priorSD

Prior standard deviation / spread, only required for "SI-normal", "SI-normal-local", "SI-normal-nonlocal".

Details

A support interval with support level k is defined by the parameter values \theta_0 for which the Bayes factor contrasting H_0\colon \theta = \theta_0 to H_1\colon \theta \neq \theta_0 is larger or equal than k, i.e., the parameter values for which the data are at least k times more likely than under the alternative. Different prior distributions for the parameter \theta under the alternative H_1 are available:

The function also allows to compute minimum support intervals which require to only specify a class of priors for the parameter under the alternative and then compute the minimum Bayes factor over the class of alternatives. The following classes of prior distribution are available:

Value

Returns an object of class "supInt" which is a list containing:

si The computed support interval.
bfFun The computed Bayes factor function.
estimate The specified parameter estimate.
se The specified standard error.
siLevel The specified support level.
ciLevel The specified confidence level.
priorParams The specified prior parameters.

Author(s)

Samuel Pawel

References

Pawel, S., Ly, A., and Wagenmakers, E.-J. (2022). Evidential calibration of confidence intervals. arXiv preprint. doi:10.48550/arXiv.2206.12290

Wagenmakers, E.-J., Gronau, Q. F., Dablander, F., and Etz, A. (2020). The support interval. Erkenntnis. doi:10.1007/s10670-019-00209-z

Examples

## confidence interval of hazard ratio needs to be transformed to log-scale
ciHR <- c(0.75, 0.93)
ci <- log(ciHR)

## normal prior under the alternative hypothesis H1
m <- log(0.8) # prior mean
s <- 2 # prior sd

## compute 10 support interval
si <- ciCalibrate(ci = ci, method = "SI-normal", priorMean = m,
                  priorSD = s, siLevel = 10)
si # on logHR scale
exp(si$si) # on HR scale

## plot Bayes factor function and support interval
plot(si)

## minimum support interval based on local normal priors
msi <- ciCalibrate(ci = ci, method = "mSI-normal-local")
plot(msi)


[Package ciCalibrate version 0.42.2 Index]