# NOT RUN {
output <- pBailey(nullN=500, n1=100, n2=100, m2=28)
output
plotdiscdensity(rBailey(length=100000, N=500, n1=100, n2=100))
abline(v=output$estN, lwd=2, col=2)
abline(v=500, lwd=2, lty=2)
output <- pBailey(nullN=500, n1=100, n2=100, m2=28, alternative="2-sided")
output
plotdiscdensity(rBailey(length=100000, N=500, n1=100, n2=100))
twosided <- 500 + c(-1,1)*abs(500-output$estN)
abline(v=twosided, lwd=2, col=2)
abline(v=500, lwd=2, lty=2)
# }
Run the code above in your browser using DataLab