ci.indep.interaction: Confidence interval for the interaction of independent...

Description Usage Arguments Value Author(s) References Examples

View source: R/ci_indep_interaction.R

Description

This function tests for an interaction effect in independent proportions: it tests the whether the difference between two proportions is larger than the difference between two different proportions using a confidence interval (i.e., the parameter of interest is d = (p1 - p2) - (p3 - p4)). This corresponds closely to a 2x2 ANOVA when outcomes are dichotomous rather than continuous. See Newcombe (2001).

Usage

1
2
3
4
ci.indep.interaction(ci = NULL, a1 = NULL, m1 = NULL, b1 = NULL,
  n1 = NULL, a2 = NULL, m2 = NULL, b2 = NULL, n2 = NULL, p1 = NULL,
  l1 = NULL, u1 = NULL, p2 = NULL, l2 = NULL, u2 = NULL, p3 = NULL,
  l3 = NULL, u3 = NULL, p4 = NULL, l4 = NULL, u4 = NULL)

Arguments

ci

The confidence level - pass as a natural number (e.g. 95 for the 95% confidence interval). Only pass this argument when passing absolute frequencies (a, m , b, n); do not combine with proportions and confidence interval boundaries (in this case the confidence interval is implied in the boundaries from the passed intervals).

a1

Frequency of events in proportion A1

m1

Total frequency in proportion A1

b1

Frequency of events in proportion B1

n1

Total frequency in proportion B1

a2

Frequency of events in proportion A2

m2

Total frequency in proportion A2

b2

Frequency of events in proportion B2

n2

Total frequency in proportion B2

p1

Proportion 1 - a value between 0 and 1. Pass only if absolute frequencies (a, m , b, n) are not given.

l1

The lower bound of the confidence interval of p1.

u1

The upper bound of the confidence interval of p1.

p2

Proportion 2 - a value between 0 and 1. Pass only if absolute frequencies (a, m , b, n) are not given.

l2

The lower bound of the confidence interval of p2.

u2

The upper bound of the confidence interval of p2.

p3

Proportion 3 - a value between 0 and 1. Pass only if absolute frequencies (a, m , b, n) are not given.

l3

The lower bound of the confidence interval of p3.

u3

The upper bound of the confidence interval of p3.

p4

Proportion 4 - a value between 0 and 1. Pass only if absolute frequencies (a, m , b, n) are not given.

l4

The lower bound of the confidence interval of p4.

u4

The upper bound of the confidence interval of p4.

Value

A list containing the confidence interval boudaries.

d

The difference between differences (d = (a1/m1 - b1/n1) - (a2/m2 - b2/n2) = (p1 - p2) - (p3 - p4)

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. (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
10
11
12
# Example from From Newcombe (2001):

ci.indep.interaction(ci=95, a1=17, m1=65, b1=17, n1=75, a2=18, m2=72,
b2=16, n2=65)

# Alternative usage:
p1 <- ci.one.prop(95, 17, 65)
p2 <- ci.one.prop(95, 17, 75)
p3 <- ci.one.prop(95, 18, 72)
p4 <- ci.one.prop(95, 16, 65) # it is possible to use other CI boundaries
ci.indep.interaction(p1=p1$p, p2=p2$p, p3=p3$p, p4=p4$p, l1=p1$l, l2=p2$l, l3=p3$l, l4=p4$l,
                     u1=p1$u, u2=p2$u, u3=p3$u, u4=p4$u)

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