ci.two.dep.props: Confidence interval for the difference of two dependent...

Description Usage Arguments Details Value Author(s) References Examples

View source: R/ci_two_dep_props.R

Description

This function returns the confidence interval for the difference of two dependent proportions. It can be used for statistical inference, i.e. we assume that two proportions are significantly different from each other if the confidence interval does not contain 0. See Newcombe (Method 10; 1998).

Usage

1
ci.two.dep.props(ci, e, f, g, h)

Arguments

ci

The confidence level - pass as a natural number (e.g. 95 for the 95% confidence interval).

e

Number of cases for which both events are 1.

f

Number of cases for which the first event is 1, and the second event is 0.

g

Number of cases for which the first event is 0, and the second event is 1.

h

Number of cases for which both events are 0.

Details

The sum of the frequencies e + f + g + h must be equal to the total n in the sample. The parameter of interest is d=(f-g)/n, which is the difference between the two dependent proportions.

Value

A list containing the confidence interval boudaries

d

The difference between the two dependent proportions (d = (f-g)/n)

l

The lower bound of the confidence interval

u

The upper bound of the confidence interval

Author(s)

Martin Papenberg martin.papenberg@hhu.de

References

Newcombe, R. G. (1998). Improved confidence intervals for the difference between binomial proportions based on paired data. Statistics in medicine, 17(22), 2635-2650.

Newcombe, R. G. (2001). Estimating the difference between differences: measurement of additive scale interaction for proportions. Statistics in medicine, 20(19), 2885-2893.

Examples

1
2
3
4
5
6
7
8
9
# Examples from Newcombe (1998):
ci.two.dep.props(ci=95, e=36, f=12, g=2, h=0)
ci.two.dep.props(ci=95, e=18, f=12, g=2, h=18)
ci.two.dep.props(ci=95, e=53, f=0, g=0, h=1)
ci.two.dep.props(ci=95, e=0, f=30, g=0, h=0)

# Examples from Newcombe (2001):
ci.two.dep.props(ci=95, 4, 1, 2, 25)
ci.two.dep.props(ci=95, 2, 12, 3, 17)

m-Py/propint documentation built on July 26, 2019, 8:47 a.m.