ci_prop_diff_haldane | R Documentation |
Haldane Confidence Interval for Difference in Proportions
ci_prop_diff_haldane(x, by, conf.level = 0.95, data = NULL)
x |
( |
by |
( |
conf.level |
( |
data |
( |
The confidence interval is calculated by \theta^* \pm w
where:
\theta^* = \frac{(\hat{p}_1 - \hat{p}_2) + z^2v(1-2\hat{\psi})}{1+z^2u}
where
w = \frac{z}{1+z^2u}\sqrt{u\{4\hat{\psi}(1-\hat{\psi})-(\hat{p}_1 - \hat{p}_2)^2\}+2v(1-2\hat{\psi})(\hat{p}_1-\hat{p}_2)
+4z^2v^2(1-2\hat{\psi})^2
}
\hat{\psi} = \frac{\hat{p}_1 + \hat{p}_2}{2}
u = \frac{1/n_1 + 1/n_2}{4}
v = \frac{1/n_1 - 1/n_2}{4}
An object containing the following components:
n |
The number of responses for each group |
N |
The total number in each group |
estimate |
The point estimate of the difference in proportions (theta*) |
conf.low |
Lower bound of the confidence interval |
conf.high |
Upper bound of the confidence interval |
conf.level |
The confidence level used |
method |
Haldane Confidence Interval |
Constructing Confidence Intervals for the Differences of Binomial Proportions in SAS
responses <- expand(c(9, 3), c(10, 10))
arm <- rep(c("treat", "control"), times = c(10, 10))
# Calculate 95% confidence interval for difference in proportions
ci_prop_diff_haldane(x = responses, by = arm)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.