update {sse} | R Documentation |
Updating a powCalc or a power object.
Description
A function for updating an existing object of class powCalc or power.
Usage
update(object, ...)
Arguments
object |
|
... |
The following elements (slots) of the object can be updated:
|
Value
An object of class powCalc.
Note
Be careful if you use this function to update objects of class power.
See Also
powCalc
for geneating new objcets of class
powCalc.
Examples
## 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))