From p-Values to Posterior Probabilities of Null Hypotheses
Abstract
:1. Introduction
2. Valid p-Values and Robust Lower Bound
3. Adaptive with PBIC Strategy
Example: Binomial Models
4. Adjusting Using Adaptive
Balanced One-Way Anova
5. Obtaining Bounds for
5.1. Testing Equality of Two Means
- ;
- .
- ;
- for both and .
5.2. Fisher’s Exact Test
5.3. Linear Regression Models
Findley’s Counterexample
6. Discussion and Final Comments
- 1.
- Lower bounds have been an important development to give practitioners alternatives to classical testing with fixed levels. A deep-seated problem with the useful bound is that it depends on the p-value, which it should, but it is static, not a function of the sample size n. This limitation makes the bound of little use for moderate to large sample sizes, where it is arguably the correction to p-values more needed.
- 2.
- The approximation develops here as a function of p-values, and sample size has a distinct advantage over other approximations, such as BIC, in that it is a valid approximation for any sample size.
- 3.
- The (approximate) Bayes factors (9) and (11) are simple to use and provide results equivalent to the sensitive p-value Bayes factors of hypothesis tests. In this article, we extended the validity of the approximation for “pseudo-p-values,” which are ubiquitous in statistical practice. We hope that this development will give tools to the practice of statistics to make the posterior probability of hypotheses closer to everyday statistical practice, on which p-values (or pseudo-p-values) are calculated routinely. This allows an immediate and useful comparison between raw-p-values and (approximate) posterior odds.
Author Contributions
Funding
Institutional Review Board Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
Appendix A
Appendix B. Codes
- I=seq(1, n1+n2, 1)
- y=I
- for (i in I) {
- y[i]= 1
- }
- return(y)
- }
- Y=function (n1=10,n2=10) {
- I=seq(1, n1+n2, 1)
- y=rep(−1, n1+n2)
- for (i in I) {
- y[i]=1
- }
- return(y)
- }
- ml=function(n1=10, n2=10) {return(lm(X(n1, n2)~Y(n1, n2)))}
- sigma=function(n1=10, n2=10){
- return(as.numeric(summary(ml(n1, n2))$sigma^2))}
- d=function(n1=10, n2=10){return(sigma(n1, n2)*(1/n1+1/n2))}
- ne=function(n1=10, n2=10){return(min(n1*(1+n1/n2)),n2*(1+n2/n1)))}
- beta.=function(n1=10, n2=10){
- return(as.numeric(ml(n1, n2)$coefficients[2]^2))}
- v=function(n1=10, n2=10){
- return(beta.(n1, n2)/(d(n1, n2)*( +ne(n1, n2))))}
- C=function(n1=10, n2=10){
- return(−2*log((1−exp(−v(n1, n2)))/(sqrt(2)*v(n1, n2))))}
- # Adaptive alpha eq.8
- alphabinom=function(n1, n2,alpha){
- sqrt(2/((n1+n2)*pi*(qchisq(alpha, df=1, lower.tail=F)
- +log(n1+n2)
- +C(n1, n2))))*exp(−(qchisq(alpha, df=1, lower.tail=F)
- +C(n1, n2))/2)
- }
- # RLB_xi
- RLB=function(a,b){
- −exp(1)*b*a^b*log(a)}
- pval=seq(0.001,0.36,0.00001)
- plot(pval,RLB(pval,1),col=4,lty=4,
- ylab=expression(paste(B[L](p,xi[0]))),
- xlab=expression(paste(p)),type="l")
- lines(pval,RLB(pval,1.1),col=5,lty=5)
- lines(pval,RLB(pval,1.2),col=6,lty=6)
- lines(pval,RLB(pval,1.3),col=7,lty=7)
- legend(0.01,1,col =c(4,5,6,7),
- c(expression(paste(xi[0]==1)),
- expression(paste(xi[0]==1.1)),
- expression(paste(xi[0]==1.2)),
- expression(paste(xi[0]==1.3))),
- lty=c(4,5,6,7),cex = 0.8)
- plot(pval,RLB(pval,1),
- ylab=expression(paste(B[L](p,1))),
- xlab=expression(paste(p)),type="l")
- abline(h=RLB(.1,1),lty=2,col="blue")
- abline(v=0)
- abline(h=0)
- segments(0.1,0,0.1,RLB(0.1,1),lty=2)
- arrows(0.001,RLB(0.1,1),0.025,0.8,length = 0.1)
- arrows(0.1,0,0.125,0.2,length = 0.1)
- legend(0.01,0.9,expression(paste(alpha)),bty = "n")
- legend(0.11,0.3,expression(paste(rho)),bty = "n")
- alpha=seq(0.000000000001,.05,.00001)
- # posterior probability of H_0
- pP=function(a){
- 1/(1+1/(a))}
- # posteriors probability (RLB_xi)
- plot(alpha,pP(RLB(alpha,1)),col=4,lty=4,xlab="p",
- ylab=expression(paste(minP(H[0]/x))),type = "l")
- lines(alpha,pP(RLB(alpha,1.1)),col=6,lty=6)
- lines(alpha,pP(RLB(alpha,1.2)),col=9,lty=9)
- lines(alpha,pP(RLB(alpha,1.3)),col=10,lty=10)
- legend(0,.28,col =c(4,6,9,10),
- c(expression(paste(P[RLB])),
- expression(paste(P[RLB[1.1]])),
- expression(paste(P[RLB[1.2]])),
- expression(paste(P[RLB[1.3]]))),
- lty=c(4,6,9,10),cex = 0.8)
- Y=function(n1,n2){
- c=cbind2(c(rep(1,n1),rep(1,n2)))
- return(c)}
- Y1=function(n1,n2){
- set.seed(2)
- a=rnorm(n1+n2,0,.05)
- c=cbind2(c(rep(1,n1),rep(3,n2))+a)
- return(c)
- }
- X1=function(n1,n2){
- c=cbind2(c(rep(1,n1),rep(-1,n2)))
- return(c)
- }
- X=function(n1,n2){
- return(cbind2(Y(n1,n2),X1(n1,n2)))
- }
- b=function(n1,n2){
- return(abs(det(t(X(n1,n2))%*%X(n1,n2))/det(t(Y(n1,n2))%*%
- Y(n1,n2))))}
- l.model=function(n1,n2){return(lm(Y1(n1,n2)~X1(n1,n2)))}
- beta=function(n1,n2){as.numeric(l.model(n1,n2)$coefficient[2])}
- d=function(n1,n2){return(2/n1+2/n2)}
- ne=function(n1,n2){return(min(n1^2,n2^2)*(1/n1+1/n2))}
- v=function(n1,n2){return(beta(n1,n2)^2/(d(n1,n2)*(1+ne(n1,n2))))}
- C=function(n1,n2){return(-2*log((1-exp(-v(n1,n2)))/(sqrt(2)*
- v(n1,n2))))}
- # Bayes Factor Linear Version (Eq.8)
- BFL=function(alpha,q,n,b,C,j){
- −alpha*log(alpha)*gamma(q/2)*b^((n-j)/(2*(n-1)))*
- ((2*(n-1))/((qgamma(alpha,shape=q/2,rate=(n-j)/
- (2*(n-1)),lower.tail = FALSE)
- +log(b)+C)*(n-j)))^(q/2)
- }
- # Bayes Factor General (E.q 9)
- BFG=function(alpha,q,n,C){
- −alpha*log(alpha)*gamma(q/2)*n^(q/2)*
- (2/(qchisq(alpha,q,lower.tail=FALSE)+q*log(n)+C))^(q/2)
- # Bayes Factor $BF_{01}$ (means)
- BF=function(t,n1,n2,alpha){
- n=n1+n2
- l=n-1
- return(((n+t)/t)^(1/2)*(((qt(alpha,l,lower.tail=FALSE))^2*
- (t/(n+t))+l)/((qt(alpha,l,lower.tail = FALSE))^2+l))^((l+1)/2))
- }
- # Plot posteriors probability
- par(mfrow=c(1,2))
- plot(alpha,pP(RLB(alpha,1)),col=4,
- xlab=expression(paste(alpha)),
- ylab=expression(paste(P(H[0]/x))),
- main =expression(paste("n=50,","q=1,",
- tau[0]==6)),type="l",ylim = c(0,1))
- lines(alpha,pP(BFL(alpha,1,50,b(25,25),C(25,25),2)),
- col=6)
- lines(alpha,pP(BFG(alpha,1,50,C(25,25))),col=3)
- lines(alpha,pP(BF(6,25,25,alpha)),col=9)
- legend(0.01,1,col =c(4,6,3,9),
- c(expression(paste(P[RLB])),
- expression(paste(P[BFL])),
- expression(paste(P[BFG])),
- expression(paste(P[BF["01"]]))),
- lty=c(1,1,1,1),cex = 0.9)
- abline(.5,0,lty=2)
- plot(alpha,pP(RLB(alpha,1)),col=4,
- xlab=expression(paste(alpha)),
- ylab=expression(paste(P(H[0]/x))),
- main = expression(paste("n=100,","q=1,",tau[0]==6)),
- type="l",ylim = c(0,1))
- lines(alpha,pP(BFL(alpha,1,100,b(50,50),
- C(50,50),2)),col=6)
- lines(alpha,pP(BFG(alpha,1,100,C(50,50))),col=3)
- lines(alpha,pP(BF(6,50,50,alpha)),col=9)
- legend(0.01,1,col =c(4,6,3,9),
- c(expression(paste(P[RLB])),
- expression(paste(P[BFL])),
- expression(paste(P[BFG])),
- expression(paste(P[BF["01"]]))),
- lty=c(1,1,1,1),cex = 0.9)
- abline(.5,0,lty=2)
- # Bayes factor Fisher’s Exact Test
- B_01=function(p,a,b,alpha,n){
- p^(qbinom(alpha,n,p,lower.tail = FALSE))*
- (1-p)^(n-qbinom(alpha,n,p,lower.tail = FALSE))*
- beta(a,b)/beta(qbinom(alpha,n,p,lower.tail = FALSE)+a,
- n-qbinom(alpha,n,p,lower.tail = FALSE)+b)
- }
- z=B_01(.7,7,3,alpha,50)
- x=B_01(.7,7,3,alpha,100)
- # Posteriors probability
- par(mfrow=c(1,2))
- plot(alpha,pP(RLB(alpha,1)),col=4,
- xlab=expression(paste(alpha)),
- ylab=expression(paste(P(H[0]/x))),
- main = expression(paste("n=50,","q=1")),type = "l",ylim = c(0,1))
- lines(alpha,pP(BFG(1,alpha,25,25,1)),col=2)
- lines(alpha,pP(BFG(1,alpha,25,25,1.1)),col=3)
- lines(alpha,pP(BFG(1,alpha,25,25,1.2)),col=5)
- lines(alpha,pP(BFG(1,alpha,25,25,1.3)),col=6)
- lines(alpha,pP(z),col=9)
- legend(0.01,1,col =c(4,2,3,5,6,9),
- c(expression(paste(P[RLB])),
- expression(paste(P[BFG])),
- expression(paste(P[BFG[1.1]])),
- expression(paste(P[BFG[1.2]])),
- expression(paste(P[BFG[1.3]])),
- expression(paste(P[BF[Test]]))),
- lty=c(1,1,1,1,1,1),cex = 0.6)
- abline(.5,0,lty=2)
- plot(alpha,pP(RLB(alpha,1)),col=4,
- xlab=expression(paste(alpha)),
- ylab=expression(paste(P(H[0]/x))),
- main = expression(paste("n=100,","q=1")),
- type = "l",ylim = c(0,1))
- lines(alpha,pP(BFG(1,alpha,80,20,1)),col=2)
- lines(alpha,pP(BFG(1,alpha,80,20,1.1)),col=3)
- lines(alpha,pP(BFG(1,alpha,80,20,1.2)),col=5)
- lines(alpha,pP(BFG(1,alpha,80,20,1.3)),col=6)
- lines(alpha,pP(x),col=9)
- legend(0.01,1,col =c(4,2,3,5,6,9),
- c(expression(paste(P[RLB])),
- expression(paste(P[BFG])),
- expression(paste(P[BFG[1.1]])),
- expression(paste(P[BFG[1.2]])),
- expression(paste(P[BFG[1.3]])),
- expression(paste(P[BF[Test]]))),
- lty=c(1,1,1,1,1,1),cex = 0.6)
- abline(.5,0,lty=2)
- # C and b
- Y=function(n){
- c=cbind2(rep(1,n))
- return(c)}
- X1=function(n){
- I=seq(1,n,1)
- x=I
- for (i in I) {
- x[i]=1/i
- }
- return(as.matrix(x))
- }
- Y1=function(n){
- set.seed(4)
- a=rnorm(n,0,1)
- return(a+X1(n)*0.5)
- }
- X=function(n){
- return(cbind2(Y(n),X1(n)))
- }
- b=function(n){
- return(abs(det(t(X(n))%*%X(n))/det(t(Y(n))%*%Y(n))))}
- l.model=function(n){return(lm(Y1(n)~X1(n)))}
- theta=function(n){as.numeric(l.model(n)$coefficient[2])}
- d=function(n){return(1/apply(X1(n),2,sum))}
- ne=function(n){return(apply(X1(n),2, sum))}
- v=function(n){return(theta(n)^2/(d(n)*(1+ne(n))))}
- C=function(n){return(-2*log((1-exp(-v(n)))/(sqrt(2)*v(n))))}
- # plot posteriors probability in function of alpha.
- par(mfrow=c(1,3))
- plot(alpha,pP(BFL(alpha,1,100,b(100),C(50),2)),
- col=4,xlab=expression(paste(alpha)),
- ylab=expression(paste(P(H[0]/x))),
- main =expression(paste("n=100,","q=1")),
- type="l",ylim = c(0,1))
- lines(alpha,pP(BFG(alpha,1,100,C(100))),col=3)
- legend(0.01,1,col =c(4,3),
- c(expression(paste(P[BFL])),
- expression(paste(P[BFG]))),
- lty=c(1,1),cex = 0.9)
- abline(.5,0,lty=2)
- plot(alpha,pP(BFL(alpha,1,1000,b(1000),C(1000),2)),
- col=4,xlab=expression(paste(alpha)),
- ylab=expression(paste(P(H[0]/x))),
- main =expression(paste("n=1000,","q=1")),
- type="l",ylim = c(0,1))
- lines(alpha,pP(BFG(alpha,1,1000,
- C(1000))),col=3)
- legend(0.01,1,col =c(4,3),
- c(expression(paste(P[BFL])),
- expression(paste(P[BFG]))),
- lty=c(1,1),cex = 0.9)
- abline(.5,0,lty=2)
- plot(alpha,pP(BFL(alpha,1,10000,b(10000),C(10000),2)),
- col=4,xlab=expression(paste(alpha)),
- ylab=expression(paste(P(H[0]/x))),
- main =expression(paste("n=10000,","q=1")),
- type="l",ylim = c(0,1))
- lines(alpha,pP(BFG(alpha,1,10000,
- C(10000))),col=3)
- legend(0.01,1,col =c(4,3),
- c(expression(paste(P[BFL])),
- expression(paste(P[BFG]))),
- lty=c(1,1),cex = 0.9)
- abline(.5,0,lty=2)
- # plot posteriors probability in function of n.
- I=seq(1,1000,1)
- BL=I
- BL1=I
- BG=I
- BG1=I
- for (n in I) {
- i=9+n
- BL[n]=BFL(0.05,1,i,b(i),C(i),2)
- BL1[n]=BFL(0.01,1,i,b(i),C(i),2)
- BG[n]=BFG(0.05,1,i,C(i))
- BG1[n]=BFG(0.01,1,i,C(i))
- }
- m=seq(10,1009,1)
- par(mfrow=c(1,2))
- plot(m,pP(BL),col=4,
- xlab=expression(paste("n")),
- ylab=expression(paste(P(H[0]/x))),
- main =expression(paste(alpha==0.05,",","q=1")),
- type="l",ylim = c(0,1))
- lines(m,pP(BG),col=3)
- legend(0.01,1,col =c(4,3),
- c(expression(paste(P[BFL])),
- expression(paste(P[BFG]))),
- lty=c(1,1),cex = 0.8)
- abline(.5,0,lty=2)
- plot(m,pP(BL1),col=4,
- xlab=expression(paste("n")),
- ylab=expression(paste(P(H[0]/x))),
- main =expression(paste(alpha==0.01,",","q=1")),
- type="l",ylim = c(0,1))
- lines(m,pP(BG1),col=3)
- legend(0.01,1,col =c(4,3),
- c(expression(paste(P[BFL])),
- expression(paste(P[BFG]))),
- lty=c(1,1),cex = 0.8)
- abline(.5,0,lty=2)
References
- Sellke, T.; Bayarri, M.J.; Berger, J.O. Calibration of p values for testing precise null hypotheses. Am. Stat. 2001, 55, 62–71. [Google Scholar] [CrossRef]
- Benjamin, D.; Berger, J.; Johannesson, M.; Nosek, B.; Wagenmakers, E.-J.; Berk, R.; Bollen, K.; Brembs, B.; Brown, L.; Camerer, C.; et al. Redefine statistical significance. Nat. Hum. Behav. 2018, 2, 6–10. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Held, L.; Ott, M. How the Maximal Evidence of p-Values Against Point Null Hypotheses Depends on Sample Size. Am. Stat. 2016, 70, 335–341. [Google Scholar] [CrossRef] [Green Version]
- Casella, G.; Berger, R. Statistical Inference, 2nd ed.; Duxbury Resource Center: Belmont, CA, USA, 2017. [Google Scholar]
- Pérez, M.E.; Pericchi, L.R. Changing statistical significance with the amount of information: The adaptive alfa significance level. Stat. Probab. Lett. 2014, 85, 20–24. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Vélez, D.; Pérez, M.E.; Pericchi, L.R. Increasing the replicability for linear models via adaptive significance levels. Test 2022, 31, 771–789. [Google Scholar] [CrossRef]
- Bayarri, M.J.; Berger, J.O.; Jang, W.; Ray, S.; Pericchi, L.R.; Visser, I. Prior-based bayesian information criterion. Stat. Theory Relat. Fields 2019, 3, 2–13. [Google Scholar] [CrossRef]
- Vovk, V. A logic of probability, with application to the foundations of statistic. J. R. Stat. Soc. Ser. B 1993, 55, 31–351. [Google Scholar] [CrossRef]
- Held, L.; Ott, M. On p-values and bayes factors. Annu. Rev. Stat. Appl. 2018, 5, 393–419. [Google Scholar] [CrossRef] [Green Version]
- Cabras, S.; Castellanos, M. p-value calibration in multiple hypotheses testing. Stat. Med. 2021, 36, 2875–2886. [Google Scholar] [CrossRef] [PubMed]
- Patiño Hoyos, A.E.; Fossaluza, V.; Esteves, L.G.; Bragança Pereira, C.A.d. Adaptive Significance Levels in Tests for Linear Regression Models: The e-Value and p-Value Cases. Entropy 2023, 25, 19. [Google Scholar] [CrossRef] [PubMed]
- Luis, P.; Pereira, C. Adaptative Significance Levels Using Optimal Decision Rules: Balancing by Weighting the Error Probabilities. Braz. J. Probab. Stat. 2015, 29, 70–90. [Google Scholar]
- Roger, S.Z.; Sarkar, A.; Carroll, R.J.; Mallick, B.K. A powerful bayesian test for equality of means in high dimensions. J. Am. Stat. Assoc. 2018, 113, 1733–1741. [Google Scholar]
- Acuna, E. Regresion Aplicada Usando R; Universidad de Puerto Rico en Mayagüez, Departamento de Ciencias Matemáticas: Mayagüez, Puerto Rico, 2015. [Google Scholar]
- Findley, D.F. Counterexamples to parsimony and BIC. Ann. Inst. Stat. Math. 1991, 43, 505–514. [Google Scholar] [CrossRef]
Adaptive via PBIC () | ||
---|---|---|
10 | 10 | 0.0068 |
25 | 25 | 0.0040 |
50 | 50 | 0.0027 |
100 | 50 | 0.0021 |
50 | 100 | 0.0021 |
100 | 100 | 0.0018 |
% Of Samples with | |||||
---|---|---|---|---|---|
r | % Of Samples with | ||||
10 | |||||
50 | |||||
100 | |||||
500 | |||||
1000 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Vélez Ramos, D.; Pericchi Guerra, L.R.; Pérez Hernández, M.E. From p-Values to Posterior Probabilities of Null Hypotheses. Entropy 2023, 25, 618. https://doi.org/10.3390/e25040618
Vélez Ramos D, Pericchi Guerra LR, Pérez Hernández ME. From p-Values to Posterior Probabilities of Null Hypotheses. Entropy. 2023; 25(4):618. https://doi.org/10.3390/e25040618
Chicago/Turabian StyleVélez Ramos, Daiver, Luis R. Pericchi Guerra, and María Eglée Pérez Hernández. 2023. "From p-Values to Posterior Probabilities of Null Hypotheses" Entropy 25, no. 4: 618. https://doi.org/10.3390/e25040618
APA StyleVélez Ramos, D., Pericchi Guerra, L. R., & Pérez Hernández, M. E. (2023). From p-Values to Posterior Probabilities of Null Hypotheses. Entropy, 25(4), 618. https://doi.org/10.3390/e25040618