View source: R/sampleSizeMcNemar.R
sampleSizeMcNemar | R Documentation |
Compute the sample size to test the null hypothesis of the McNemar test.
sampleSizeMcNemar(p1, p2, sig.level = 0.05, power = 0.9)
p1 |
Assumed marginal probability of the first row. |
p2 |
Assumed marginal probability of the first column. Has to be larger than p1 and 0.5. |
sig.level |
Significance level. |
power |
Power, i.e., 1 - probability of type II error. |
Given two samples of paired binary observations, e.g., results of some positive/negative test on the same experimental units, we want to assess the null hypothesis whether the probability of positives by the first method is equal that of positives by the second method.
Vector of min, max, and mid sample size as explained in Lachenbruch (1982).
Kaspar Rufibach
kaspar.rufibach@gmail.com
Lachenbruch (1992). Sample Size for Studies based on McNemar's test Statistics in Medicine, 11, 1521–1525.
# example from Lachenbruch (1982), Table II, first row
sampleSizeMcNemar(p1 = 0.8, p2 = 0.9, sig.level = 0.05, power = 0.9)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.