LRCalibrate: Calibration of two-sided p-values obtained from the...

Description Usage Arguments Details Value References Examples

View source: R/LRCalibrate.R

Description

Transforms two-sided p-values from likelihood ratio (deviance) tests to lower bounds on the Bayes factor for the point null hypothesis against the alternative.

Usage

1
LRCalibrate(p, df, alternative="gamma", transform="id")

Arguments

p

a vector of two-sided p-values

df

a vector of degrees of freedom of the asymptotic chi-squared distribution(s) of likelihood ratio test statistic(s)

alternative

either "simple" or "gamma". Defaults to "gamma". Specifies the alternative hypotheses on the non-centrality parameter of the chi-squared distribution to consider. "simple" only considers simple point alternative hypotheses. "gamma" assumes a specific gamma distribution.

transform

either "id", "log", "log2" or "log10". Defaults to "id". Specifies how to transform the lower bound on the Bayes factor. "id" corresponds to no transformation. "log" refers to the natural logarithm, "log2" to the logarithm to the base 2 and "log10" to the logarithm to the base 10.

Details

Under the assumption that the parameter vector of interest (which has dimension df) is equal to the vector of zeros, the distribution of the deviance converges to a chi-squared distribution with df degrees of freedom. Under a simple point alternative for the parameter vector of interest and some regularity conditions, the distribution of the deviance converges to a non-central chi-squared distribution with df degrees of freedom.

For alternative = "simple", the lower bound on the Bayes factor is obtained by mazimizing the (asymptotic) chi-squared distribution under the alternative with respect to the non-centrality parameter. That calibration is described in Held and Ott (2018), Section 4.2.1.

The calibration for alternative = "normal" uses the test-based Bayes factors introduced in Johnson (2008). That approach is also outlined in Held and Ott (2018), Section 4.2.2.

Using alternative = "gamma" yields a larger bound than alternative = "simple".
Typical applications of these calibrations include generalized linear models.

Value

A matrix containing the lower bounds on the Bayes factors as entries, for all combinations of p-value and degrees of freedom. The values for the k-th degrees of freedom (k-th entry in the vector df) and the different p-values are given in the k-th row.

References

Held, L. and Ott, M. (2018). On p-values and Bayes factors. Annual Review of Statistics and Its Application, 5, 393–419.

Johnson, V. E. (2008). Properties of Bayes factors based on test statistics. Scandinavian Journal of Statistics, 35, 354–368.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
LRCalibrate(p=c(0.05, 0.01, 0.005), df=2, alternative="simple")
# gamma alternatives
LRCalibrate(p=c(0.05, 0.01, 0.005), df=c(2, 5, 10))

# plot the minimum Bayes factor as a function of the p-value
# for different degrees of freedom df of the LR test statistic
par(mfrow=c(1,2), las=1)

p <- exp(seq(log(0.005), log(0.3), by=0.01))
df <- c(1, 5, 20)
par(las=1)

# for a simple alternative
minBF.sim <- LRCalibrate(p, df=df, alternative="simple")
matplot(p, t(minBF.sim), type="l", ylab="Minimum Bayes factor", log="xy", 
        xlab="Two-sided LR-test p-value", lty=1, lwd=2, axes=FALSE,
        main="Simple alternative")
axis(1, at=c(0.01, 0.03, 0.1, 0.3), c(0.01, 0.03, 0.1, 0.3))
my.values <- c(30, 20, 10, 5, 3, 1)
my.at <- 1/my.values
my.ylegend <- c(paste("1/", my.values[-length(my.values)], sep=""), "1")
axis(2, at=my.at, my.ylegend)
box()
legend("bottomright", legend=c("df=1", "df=5", "df=20"), 
        lty=1, lwd=2, , col=1:3)

# for gamma alternatives
minBF.loc <- LRCalibrate(p, df=df, alternative="gamma")
matplot(p, t(minBF.loc), type="l", ylab="  Minimum Bayes factor", 
        log="xy", xlab="Two-sided LR-test p-value", lty=1, lwd=2, 
        axes=FALSE, main="Local alternatives")
axis(1, at=c(0.01, 0.03, 0.1, 0.3), c(0.01, 0.03, 0.1, 0.3))
axis(2, at=my.at, my.ylegend)
box()
legend("bottomright", legend=c("df=1", "df=5", "df=20"), 
        lty=1, lwd=2, col=1:3)

pCalibrate documentation built on March 23, 2020, 3:01 a.m.