DescTools (version 0.99.14)

BinomDiffCI: Confidence Interval for a Difference of Binomials

Description

Calculate confidence interval for a risk difference.

Usage

BinomDiffCI(x1, n1, x2, n2, conf.level = 0.95, 
            method = c("wald", "waldcor", "ac", "exact", "newcombe", 
                       "newcombecor", "fm", "ha"))

Arguments

x1
number of successes for the first group.
n1
number of trials for the first group.
x2
number of successes for the second group.
n2
number of trials for the second group.
conf.level
confidence level, defaults to 0.95.
method
one out of "wald", "waldcor", "ac", "exact", "newcombe", "newcombecor", "fm", "ha".

Value

  • A vector with 3 elements for estimate, lower confidence intervall and upper for the upper one.

Details

Still to follow. Methods "newcombecor", "fm", "ha" are not implemented yet.

References

Fagerland M W, Lydersen S and Laake P (2011) Recommended confidence intervals for two independent binomial proportions, Statistical Methods in Medical Research 0(0) 1-31 http://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_freq_a0000000642.htm#statug.freq.freqbincp

See Also

BinomCI, MultinomCI, binom.test, prop.test

Examples

Run this code
BinomDiffCI(14, 70, 32, 80, method="wald")
BinomDiffCI(14, 70, 32, 80, method="waldcor")
BinomDiffCI(14, 70, 32, 80, method="ac")
BinomDiffCI(14, 70, 32, 80, method="newcombe")

Run the code above in your browser using DataCamp Workspace