View source: R/proportion_difference.R
proportion_difference | R Documentation |
Calculate a confidence interval for a difference in proportions, such as PPA
or NPA. Uses the recommended method as described in Altman chapter 6 (loc
1249 in the Kindle edition) Here, the z-score is calculated using the
stats::qnorm()
function.
proportion_difference(
true_calls_1,
false_calls_1,
true_calls_2,
false_calls_2,
interval = 0.95,
digits = 0.1
)
true_calls_1 |
The number of correct calls (true positives or true negatives) in the first proportion of interest. |
false_calls_1 |
The number of incorrect calls (false positives or false negatives) in the first proportion of interest. |
true_calls_2 |
The number of correct calls (true positives or true negatives) in the second proportion of interest. |
false_calls_2 |
The number of incorrect calls (false positives or false negatives in the second proportion of interest). |
interval |
The confidence interval to calculate. Defaults to
|
digits |
The number of digits to round to. Defaults to |
Also known as "Newcombe's method".
A list containing the estimated difference, the confidence interval,
a boolean attribute indicating whether or not a difference was detected at
the specified confidence (difference_detected
), and various strings
and formatted percents that can be used to convey the information.
proportion_difference(
true_calls_1 = 99,
false_calls_1 = 1,
true_calls_2 = 80,
false_calls_2 = 1,
interval = 0.95
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.