transformCIBP | R Documentation |
Compute confidence intervals/bands and p-values after a transformation
transformCIBP(
estimate,
se,
iid,
null,
conf.level,
alternative,
ci,
type,
min.value,
max.value,
band,
method.band,
n.sim,
seed,
p.value,
df = NULL
)
estimate |
[numeric matrix] the estimate value before transformation. |
se |
[numeric matrix] the standard error before transformation. |
iid |
[numeric array] the iid decomposition before transformation. |
null |
[numeric] the value of the estimate (before transformation) under the null hypothesis. |
conf.level |
[numeric, 0-1] Level of confidence. |
alternative |
[character] a character string specifying the alternative hypothesis,
must be one of |
ci |
[logical] should confidence intervals be computed. |
type |
[character] the transforamtion.
Can be |
min.value |
[numeric] if not |
max.value |
[numeric] if not |
band |
[integer 0,1,2] When non-0, the confidence bands are computed for each contrasts ( |
method.band |
[character] method used to adjust for multiple comparisons.
Can be any element of |
n.sim |
[integer, >0] the number of simulations used to compute the quantiles for the confidence bands. |
seed |
[integer, >0] seed number set before performing simulations for the confidence bands. |
p.value |
[logical] should p-values and adjusted p-values be computed. Only active if |
df |
[integer, >0] optional. Degrees of freedom used for the student distribution of the test statistic. If not specified, use a normal distribution instead. |
The iid decomposition must have dimensions [n.obs,time,n.prediction] while estimate and se must have dimensions [n.prediction,time].
Single step max adjustment for multiple comparisons, i.e. accounting for the correlation between the test statistics but not for the ordering of the tests, can be performed setting the arguemnt method.band
to "maxT-integration"
or "maxT-simulation"
. The former uses numerical integration (pmvnorm
and qmvnorm
to perform the adjustment while the latter using simulation. Both assume that the test statistics are jointly normally distributed.
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.