Description Usage Arguments Value Author(s) References Examples
View source: R/ci_indep_interaction.R
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).
1 2 3 4 |
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. |
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 |
Martin Papenberg martin.papenberg@hhu.de
Newcombe, R. G. (2001). Estimating the difference between differences: measurement of additive scale interaction for proportions. Statistics in medicine, 20(19), 2885-2893.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.