View source: R/generic.z.test.R
| power.z.test | R Documentation |
Determines the power or the non-centrality parameter (mean) for the generic z-Test with (optional) Type 1 and Type 2 error plots.
power.z.test(
power = NULL,
mean = NULL,
sd = 1,
null.mean = 0,
null.sd = 1,
req.sign = "+",
alpha = 0.05,
alternative = c("two.sided", "one.sided", "two.one.sided"),
plot = TRUE,
verbose = 1,
utf = FALSE
)
power |
statistical power |
mean |
mean of the alternative; either |
sd |
standard deviation of the alternative. Do not change this value except when some sort of variance correction is applied (e.g. as in logistic and Poisson regressions). |
null.mean |
mean of the null. When alternative = "two.one.sided", the
function expects two values in the form |
null.sd |
standard deviation of the null. Do not change this value except when some sort of correction is applied. |
req.sign |
whether |
alpha |
type 1 error rate, defined as the probability of
incorrectly rejecting a true null hypothesis, denoted as
|
alternative |
character; the direction or type of the hypothesis test: "two.sided", "one.sided", or "two.one.sided". "two.one.sided" is used for equivalence and minimal effect testing. |
plot |
logical; |
verbose |
|
utf |
logical; whether the output should show Unicode
characters (if encoding allows for it). |
power |
statistical power |
mean |
mean of the alternative distribution. |
sd |
standard deviation of the alternative distribution. |
null.mean |
mean of the null distribution. |
null.sd |
standard deviation of the null distribution. |
alpha |
type 1 error rate (user-specified). |
z.alpha |
critical value(s). |
beta |
type 2 error rate. |
type.s |
type S error rate (only for two-tailed test). |
type.m |
type M error rate (only for two-tailed test). |
# two-sided
# power defined as the probability of observing test statistics greater than
# the positive critical value OR less than the negative critical value
power.z.test(mean = 1.96, alpha = 0.05, alternative = "two.sided")
power.z.test(power = 0.80, alpha = 0.05, alternative = "two.sided")
# one-sided
# power is defined as the probability of observing a test statistic greater
# than the critical value
power.z.test(mean = 1.96, alpha = 0.05, alternative = "one.sided")
power.z.test(power = 0.80, alpha = 0.05, alternative = "one.sided")
# equivalence
# power is defined as the probability of observing a test statistic greater
# than the upper critical value (for the lower bound) AND less than the
# lower critical value (for the upper bound)
power.z.test(mean = 0, null.mean = c(-2, 2), alpha = 0.05,
alternative = "two.one.sided")
power.z.test(power = 0.80, req.sign = "0", null.mean = c(-2, 2),
alpha = 0.05, alternative = "two.one.sided")
# minimal effect testing
# power is defined as the probability of observing a test statistic greater
# than the upper critical value (for the upper bound) OR less than the lower
# critical value (for the lower bound).
power.z.test(mean = 2, null.mean = c(-1, 1), alpha = 0.05,
alternative = "two.one.sided")
power.z.test(power = 0.80, req.sign = "+", null.mean = c(-1, 1),
alpha = 0.05, alternative = "two.one.sided")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.