Description Usage Arguments Details Value Examples
The user-defined 'power-function' provided as statistic
will be
evaluated for the whole range of n
, theta
, and xi
as specified in the powPar-object.
1 |
object |
An object of class |
statistic |
A function that takes an object of class
|
n.iter |
A number specifying how often the power-function is evaluated. |
cluster |
Still experimental! This argument can be logical, indicating if the library parallel should be used or not, or numeric. In the latter case the number is passed as integer to the function makeCluster from library parallel. The default is FALSE. |
If the statistic does not return the power (a numeric value
between 0 and 1) but returns a logical (TRUE or FALSE) the argument
n.iter
is expected. The statitic will then be evaluated
n.iter-times and the proportion of successes will be interpreted as
the power.
An object of class powCalc.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.