Description Usage Arguments Note References Examples
Compute the power of the one-sample equivalence test for population means of normal summary values
1 2 |
rho |
vector of quantile |
df |
Degrees of freedom |
s.of.T |
Standard deviation of the test statistic |
c.u |
Upper boundary point of the critical region |
tau.u |
Upper boundary point of the equivalence region |
alpha |
Level of the equivalence test |
norm |
Normalization constant for the truncated power function. |
support |
Support of the truncated power function (vector of dimension 2). |
log |
If |
To compute the power, either c.u
or tau.u
and alpha
are required. If tau.u
and alpha
are given, then the value of c.u
is ignored.
The power function can be truncated to support
and then standardized with norm
.
If one of these is set, the other must be provided too.
http://arxiv.org/abs/1305.4283
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | n.of.y <- 30
s.of.T <- 0.2 #this is s.of.y / squrt(n.of.y)
# useful equivalence region for given stochasticity in T:
# power is not zero, does not plateau around 1, and still high around rho=0
rho <- seq(-2,2,0.01)
tmp <- data.table(rho=rho, power=mutost.pow(rho, df=n.of.y-1, s.of.T, tau.u=0.8, alpha=0.01))
p <- ggplot(tmp,aes(x=rho,y=power)) + geom_line() + labs(y='Power\n(ABC acceptance probability)')
print(p)
# power increases with tau.u and becomes flat
tmp <- lapply(seq(0.5,1.6,0.2),function(tau.u)
{
data.table(tau.u=as.factor(tau.u),rho=rho,power=mutost.pow(rho, df=n.of.y-1, s.of.T, tau.u=tau.u, alpha=0.01))
})
tmp <- do.call('rbind', tmp)
p <- ggplot(tmp,aes(x=rho,y=power,colour=tau.u,group=tau.u)) + geom_line() + labs(y='Power\n(ABC acceptance probability)')
print(p)
# power increases with n.of.y and becomes flat
tau.u <- 0.8
s.of.y <- 0.8
tmp <- lapply(c(10,15,20,25,50,100),function(n.of.y)
{
data.table(n.of.y=as.factor(n.of.y),rho=rho,power=mutost.pow(rho, df=n.of.y-1, s.of.y/sqrt(n.of.y), tau.u=tau.u, alpha=0.01))
})
tmp <- do.call('rbind', tmp)
p <- ggplot(tmp,aes(x=rho,y=power,colour=n.of.y,group=n.of.y)) + geom_line() + labs(y='Power\n(ABC acceptance probability)')
print(p)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.