View source: R/power.mcnemar.test.R
power_mcnemar_test | R Documentation |
Compute power of test, or determine parameters to obtain target power for matched case-control studies.
power_mcnemar_test(
n = NULL,
paid = NULL,
psi = NULL,
sig.level = 0.05,
power = NULL,
alternative = c("two.sided", "one.sided"),
method = c("normal", "exact", "cond.exact")
)
n |
Number of observations (number of pairs) |
paid |
The probability that a case patient is not exposed and that the corresponding control patient was exposed (specifying p_12 in the 2 x 2 table). It is assumed that this is the _smaller_ of the two discordant probabilities. |
psi |
The relative probability that a control patient is not exposed and that the corresponding case patient was exposed compared to the probability that a case patient is not exposed and that the corresponding control patient was exposed (i.e., p_21 / p_12 in the 2x2 table). Also called the discordant proportion ratio. psi must be larger than or equal to 1 since paid was the smaller of the two discordant probabilities. |
sig.level |
Significance level (Type I error probability) |
power |
Power of test (1 minus Type II error probability) |
alternative |
One- or two-sided test |
method |
Power calculations based on exact or asymptotic test. The default (normal) corresponds to an approximative test, "exact" is the unconditional exact test, while "cond.exact" is a conditional exact test (given fixed n). The "exact" method is very slow for large values of n so it is most useful for fixed (and moderately-sized) n. |
Object of class power.htest
, a list of the arguments
(including the computed one) augmented with method and note elements.
uniroot
is used to solve power equation for unknowns, so you
may see errors from it, notably about inability to bracket the root when
invalid arguments are given.
Claus Ekstrom claus@rprimer.dk
Duffy, S (1984). Asymptotic and Exact Power for the McNemar Test and its Analogue with R Controls per Case
Fagerland MW, Lydersen S, Laake P. (2013) The McNemar test for binary matched-pairs data: mid-p and asymptotic are better than exact conditional. BMC Medical Research Methodology.
mcnemar.test
# Assume that pi_12 is 0.125 and we wish to detect an OR of 2.
# This implies that pi_12=0.25, and with alpha=0.05, and a power of 90% you get
power_mcnemar_test(n=NULL, paid=.125, psi=2, power=.9)
power_mcnemar_test(n=NULL, paid=.1, psi=2, power=.8, method="normal")
power_mcnemar_test(n=NULL, paid=.1, psi=2, power=.8)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.