I want to calculate sample size by using the mcnemar test to compare 2 values of sensitivity. I am looking for the formula to implement under r for this calculation. In this case i need to calculate the sample size with Sensitivity_1 = 0.78, Sensitivity_2 = 0.558, with discordant pairs = 0.4664 (Sensitivity_2 * (1 - Sensitivity_1 ) + Sensitivity_1 * (1 - Sensitivity_2 )) to have 0.232 (Sensitivity_1 -Sensitivity_2) of difference.
Does thebiostatUZH
package help?
For Windows:
install.packages("biostatUZH", repos = "http://R-Forge.R-project.org")
For Mac:
install.packages("biostatUZH", repos = "http://R-Forge.R-project.org", type = "source")
See sampleSizeMcNemar()
to compute sample size for McNemar test.
#example from Lachenbruch (1982), Table II, first row
sampleSizeMcNemar(p1 = 0.8, p2 = 0.9, alpha = 0.05, power = 0.9)