confIntIndependentProportion {biostatUZH} | R Documentation |
Compute confidence interval for the risk difference of two independent samples based on individual Wilson intervals using Newcombe's method.
confIntIndependentProportion(x, n, conf.level = 0.95)
x |
Vector with two entries, the successes in the two groups. |
n |
Vector with two entries, the number of trials. |
conf.level |
Confidence level for confidence interval. |
A list with the entries:
p1 |
Estimated proportion in first sample. |
p2 |
Estimated proportion in second sample. |
d |
Estimated difference p_1 - p_2 of proportions. |
newcombeCI |
Confidence interval for the difference of independent proportions, computed according to Newcombe's method. |
waldCI |
Wald confidence interval for the difference of independent proportions. |
Leonhard Held
The Newcombe interval is introduced in
Newcombe, R.G. (1998). Interval estimation for the difference between independent proportions: Comparison of eleven methods. Stat. Med., 17, 873–890.
A worked out example can be found in
Altman, D.G., Machin, D., Bryant, T.N., Gardner, M.J. (2000). Statistics with confidence (p. 49). University Press Belfast.
# Example from Significance (2010), 7(4), p. 146, "Untimely ripped ?" n <- c(1515, 108000) x <- c(0, 100) confIntIndependentProportion(x, n) # Fisher p-values t <- matrix(c(x, n - x), nrow = 2, ncol = 2) f.t <- fisher.test(t) f.t$p.value ## Not run: # exact test library("exact2x2") exact2x2(t, tsmethod = "minlike")$p.value exact2x2(t, tsmethod = "central")$p.value exact2x2(t, tsmethod = "blaker")$p.value ## End(Not run)