Paired proportion test (McNemar's)
paired_proportion_inference.Rd
Perform McNemar's test for paired proportions, by computing the proportion of those that switch from failure to success out of all those that switch in either direction and performing a one-sample proportion test with a null of 0.5.
Arguments
- formula
a formula of the form
y2 - y1 ~ 1
or~ y2 -y1
, wherey1
andy2
are numeric variables. To perform test within subgroups, usey2 - y1 ~ x
ory2 - y1 ~ 1 | g
, or eveny2- y1 ~ x | g
, wherex
andg
are factor variables.- data
a data frame containing the values in the formula.
- success
the level of the response variable to consider a success
- method
character string specifying which method to use. One of "
default
", "wilson
", or "exact
".- alternative
character string specifying the alternative hypothesis, must be one of "
two.sided
" (default), "greater
" or "less
".- correct
a logical indicating whether Yates' continuity correction should be applied; used for Wilson test only.
- conf.level
if desired, confidence level of the returned confidence interval. Must be a single number between 0 and 1.