Learn R Programming

Bvalue (version 1.0)

pB: The B-Value Distribution

Description

This function gives the cumulative distribution function of the B-value.

Usage

pB(b, nu, delta = 0, S = 1, alpha = 0.05, type = c("marginal", "cond_NRej", "cond_Rej"))

Arguments

b

vector of quantiles

nu

an integer, the degrees of freedom in the conventional t-test.

delta

a numeric value. Considering testing for difference of two population means, delta is the null value of the difference. Default is 0.

S

a numeric value. The standard error in the conventional t-test.

alpha

a numeric between 0 and 1. The Type I error rate aiming to control in the conventional t-test.

type

a character to specify the type of EEB to be calculated. type = "marginal" gives the marginal EEB; type = "cond_NRej" gives the EEB under the condition that one cannot reject the first-stage conventional t-test; type = "cond_Rej" gives the EEB under the condition that the first-stage conventional t-test is rejected.

Value

Gives the cumulative distribution function of the B-value.

Details

Consider a two-sample t-test setting with hypotheses $$H_{0}:\delta=0 \quad \leftrightarrow \quad H_{1}:\delta\neq 0,$$ where \(\delta=\mu_{1}-\mu_{2}\) is the difference of two population means. If the testing result is failure to reject the null, one cannot directly conclude equivalence of the two groups. In this case, an equivalence test is suggested by testing the hypotheses $$H_{3}:|\delta|\geq\Delta \quad \leftrightarrow \quad H_{4}:|\delta|<\Delta,$$ where \(\Delta\) is a pre-specified equivalence bound. A \(100(1-2\alpha)\%\) confidence interval is formulated, denoted as \([L,U]\), to test for equivalence, where $$L=\hat{\delta}-t_{\nu,1-\alpha}S, \quad U=\hat{\delta}+t_{\nu,1-\alpha}S,$$ \(\hat{\delta}\) is the estimate of \(\delta\), \(t_{\nu,1-\alpha}\) is the \(100(1-\alpha)\%\) quantile of a t-distribution with degrees of freedom \(\nu\), and \(S\) is the standard error. We define the B-value as $$B=\max\{|L|,|U|\}.$$ The cumulative distribution function of the B-value is defined under three conditions: (1) the marginal distribution (type = "marginal"); (2) the conditional distribution given that one cannot reject \(H_{0}\) in the conventional t-test (type = "cond_NRej"); and (3) the conditional distribution given that \(H_{0}\) is rejected in the conventional t-test (type = "cond_Rej").

References

Zhao et al. (2019) "B-Value and Empirical Equivalence Bound: A New Procedure of Hypothesis Testing" <arXiv:1912.13084>

See Also

EEB

Examples

Run this code
# NOT RUN {
############################################
# An Example: demonstration of marginal/conditional distribution of the B-value
alpha<-0.05

delta<-0
n1=n2=n<-10
S<-0.325
nu<-n1+n2-2

# compare three types of B-value distributions
oldpar<-par(no.readonly=TRUE)
par(mar=c(6,5,2,2))
plot(c(0,2),c(0,1),type="n",xlab=expression(b),ylab=expression(F[B](b*~"|"*~C,H[0])),
     cex.lab=1.25,cex.axis=1.25,cex.main=1.25)
abline(h=1,lty=1,lwd=2,col=8)
abline(h=0,lty=1,lwd=2,col=8)
curve(pB(x,nu=nu,delta=delta,S=S,alpha=alpha,type="marginal"),
      lty=1,lwd=3,col=1,n=1000,from=0,to=20,add=TRUE)
curve(pB(x,nu=nu,delta=delta,S=S,alpha=alpha,type="cond_NRej"),
      lty=2,lwd=3,col=2,n=1000,from=0,to=20,add=TRUE)
curve(pB(x,nu=nu,delta=delta,S=S,alpha=alpha,type="cond_Rej"),
      lty=3,lwd=3,col=4,n=1000,from=0,to=20,add=TRUE)
par(fig=c(0,1,0,1),oma=c(0,0,0,0),mar=c(0,2,0,2),new=TRUE)
plot(0,0,type="n",bty="n",xaxt="n",yaxt="n")
legend("bottom",legend=c("marginal","conditional (not reject)","conditional (reject)"),
       xpd=TRUE,horiz=TRUE,inset=c(0,0),col=c(1,2,4),lty=c(1,2,3),lwd=2,bty="n",cex=1.25)
par(oldpar)
############################################
# }

Run the code above in your browser using DataLab