set.seed(10)
n <- 100
X <- rnorm(n)
res2sided <- transformCIBP(estimate = mean(X), se = cbind(sd(X)/sqrt(n)), null = 0,
type = "none", ci = TRUE, conf.level = 0.95, alternative = "two.sided",
min.value = NULL, max.value = NULL, band = FALSE,
p.value = TRUE, seed = 10, df = n-1)
resLess <- transformCIBP(estimate = mean(X), se = cbind(sd(X)/sqrt(n)), null = 0,
type = "none", ci = TRUE, conf.level = 0.95, alternative = "less",
min.value = NULL, max.value = NULL, band = FALSE,
p.value = TRUE, seed = 10, df = n-1)
resGreater <- transformCIBP(estimate = mean(X), se = cbind(sd(X)/sqrt(n)), null = 0,
type = "none", ci = TRUE, conf.level = 0.95, alternative = "greater",
min.value = NULL, max.value = NULL, band = FALSE,
p.value = TRUE, seed = 10, df = n-1)
## comparison with t-test
GS <- t.test(X, alternative = "two.sided")
res2sided$p.value - GS$p.value
unlist(res2sided[c("lower","upper")]) - GS$conf.int
GS <- t.test(X, alternative = "less")
resLess$p.value - GS$p.value
unlist(resLess[c("lower","upper")]) - GS$conf.int
GS <- t.test(X, alternative = "greater")
resGreater$p.value - GS$p.value
unlist(resGreater[c("lower","upper")]) - GS$conf.int
Run the code above in your browser using DataLab