confIntPairedProportion: Confidence interval for the difference of paired binomial...

View source: R/confIntProportion.R

confIntPairedProportionR Documentation

Confidence interval for the difference of paired binomial proportions using Newcombe's method

Description

Compute confidence interval for the difference of paired binomial proportions using Newcombe's method.

Usage

confIntPairedProportion(x, conf.level = 0.95)

Arguments

x

A two-dimensional contingency table in matrix form.

conf.level

Confidence level for confidence interval.

Value

A list with the entries:

p1

Estimated proportion p_{1+}.

p2

Estimated proportion p_{+1}.

newcombeCI

Confidence interval for the difference of paired proportions, computed according to Newcombe (1998).

Author(s)

Kaspar Rufibach
kaspar.rufibach@gmail.com

References

The Newcombe interval is introduced in

Newcombe, R.G. (1998). Improved confidence intervals for the difference between binomial proportions based on paired data. Stat. Med., 17, 2635–2650.

A worked out example can be found in

Altman, D.G., Machin, D., Bryant, T.N., Gardner, M.J. (2000). Statistics with confidence. University Press Belfast.

See Also

confIntIndependentProportion, wilson, mcnemar.exact

Examples


# Calculate confidence interval for the example in Altman et al (2000), Table 6.2
altman62 <- rbind(c(14, 5), c(0, 22))
confIntPairedProportion(x = altman62)

# exact McNemar test
if(require("exact2x2")){
    mcnemar.exact(altman62)
    mcnemar.test(altman62)
}


felix-hof/biostatUZH documentation built on Sept. 27, 2024, 1:48 p.m.