Calculate the power for the exact McNemar's test (i.e., exact2x2
with paired=TRUE
) given the number of pairs
and the probability of a positive response only in the test individual in the pair (pb), and the probability of a positive response only in the control individual in the pair (pc).
powerPaired2x2(pb, pc, npairs, sig.level = 0.05,
alternative = c("two.sided", "one.sided"),
strict = FALSE, nullOddsRatio = 1, errbound = 10^-6, ...)
probability of a (0,1) response for a pair, meaning negative response in the control individual and a positive response in the test individual
probability of a (1,0) response for a pair, meaning positive response in the control individual and a negative response in the test individual
the number of pairs
significance level (also called alpha-level)
either 'one.sided' or 'two.sided' (see tsmethod
for two-sided method)
use strict interpretation in two-sided case (i.e., TRUE allows rejections in the 'wrong' direction)
null odds ratio, internally passed to or
argument of exact2x2
with paired=TRUE
error bound, errbound=0
does exact calculation, when errbound>0
then speed up calculations by not calculating outcomes at either extreme with tail probabilities less than errbound/2 which may underestimate power by at most errbound.
arguments passed to exact2x2
(except these arguments cannot be passed this way:
or
, alternative
, conf.int
, paired
, plot
)
An object of class 'power.htest' with elements:
power
number of pairs
probability of a (control,test)=(0,1) response for a pair
probability of a (control,test)=(1,0) response for a pair
significance level or alpha-level
either one-sided or two-sided
null odds ratio (or boundary between null and alternative for one-sided tests)
notes about calculation (e.g., errbound value)
description of method
When alternative='one.sided'
then the test automatically picks the side that is most powerful.
# NOT RUN {
powerPaired2x2(.5,.3,npairs=20)
# }
Run the code above in your browser using DataLab