power.z.test | R Documentation |
Power calculations for two sample z tests
power.z.test(
n = NULL,
delta = NULL,
sd = 1,
sig.level = 0.05,
power = NULL,
type = c("two.sample", "one.sample"),
alternative = c("two.sided", "one.sided")
)
n |
Number of observations (per group) |
delta |
True difference in means |
sd |
Standard deviation |
sig.level |
Significance level (Type I error probability) |
power |
Power of test (1 minus Type II error probability) |
type |
String specifying the type of t test. Can be abbreviated. |
alternative |
One- or two-sided test. Can be abbreviated. |
Exactly one of the parameters n
, delta
,
power
, sd
, and sig.level
must be passed as NULL
,
and that parameter is determined from the others. Notice that the last two
have non-NULL
defaults, so NULL
must be explicitly passed if
you want to compute them.
Object of class "power.htest", a list of the arguments (including the computed one) augmented with method and note elements.
Felix Hofmann
# Calculate sample size
delta = 0.25
sd = 0.4
sig.level = 0.01
power = 0.95
power.z.test(delta = delta, sd = sd, sig.level = sig.level, power = power)
# Calculate the effect size
n = 92
power.z.test(power = power, sd = sd, sig.level = sig.level, n = n)
# Calculate the standard deviation
power.z.test(power = power, delta = delta, sig.level = sig.level, n = n,
sd = NULL)
# Calculate the type I error
power.z.test(power = power, delta = delta, sig.level = NULL, n = n,
sd = sd)
# Calculate power
power.z.test(delta = delta, sd = sd, sig.level = sig.level, n = n)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.