Description Usage Arguments Value Note See Also Examples
A function for updating an existing object of class powCalc or power.
1 |
object |
An object of class powCalc or power. |
... |
The following elements (slots) of the object can be updated:
|
An object of class powCalc.
Be careful if you use this function to update objects of class power.
powCalc
for geneating new objcets of class
powCalc.
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 | ## defining the range of n and theta to be evaluated
psi <- powPar(theta = seq(from = 0.5, to = 1.5, by = 0.1),
n = seq(from = 20, to = 60, by = 2),
muA = 0,
muB = 1)
## defining a power-function
powFun <- function(psi){
power.t.test(n = n(psi)/2,
delta = pp(psi, "muA") - pp(psi, "muB"),
sd = theta(psi)
)$power
}
## evaluating the power-function for all combinations of n and theta
calc <- powCalc(psi, powFun)
## updating by using additional elements for "n"
calc2 <- update(calc, n = seq(from = 20, to = 90, by = 2))
## adding example at theta of 1 and power of 0.9
pow <- powEx(calc2, theta = 1, power = 0.9)
## drawing the power plot with 3 contour lines
plot(pow,
xlab = "Standard Deviation",
ylab = "Total Sample Size",
at = c(0.85, 0.9, 0.95))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.