ci.impt {asbio} | R Documentation |
Provides one and two-tailed confidence intervals for the true product of two proportions.
ci.impt(y1, n1, y2 = NULL, n2 = NULL, avail.known = FALSE, pi.2 = NULL, conf = .95, x100 = TRUE, alternative = "two.sided", bonf = TRUE, wald = FALSE)
y1 |
The number of successes associated with the first proportion. |
n1 |
The number of trials associated with the first proportion. |
y2 |
The number of successes associated with the second proportion. Not used if |
n2 |
The number of trials associated with the first proportion. Not used if |
avail.known |
Logical. Are the proportions π_{2i} known? If |
pi.2 |
Proportions for π_{2i}. Required if |
conf |
Confidence level, i.e., 1 - α. |
x100 |
Logical. If true, estimate is multiplied by 100. |
alternative |
One of |
bonf |
Logical. If |
wald |
Logical. If |
Let Y_1 and Y_2 be multinomial random variables with parameters n_1, π_{1i} and n_2, π_{2i}, respectively; where i = 1,2,…, r. Under delta derivation, the log of the products of π_{1i} and π_{2i} (or the log of a product of π_{1i} and π_{2i} and a constant) is asymptotically normal with mean log(π_{1i} \times π_{2i}) and variance (1 - π_{1i})/π_{1i}n_1 + (1 - π_{2i})/ π_{2i}n_2. Thus, an asymptotic (1 - α)100 percent confidence interval for π_{1i} \times π_{2i} is given by:
\hat{π}_{1i} \times \hat{π}_{2i} \times \exp(\pm z_{1-(α/2)}\hat{σ}_i)
where: \hat{σ}^2_i = \frac{(1 - \hat{π}_{1i})}{\hat{π}_{1i}n_1} + \frac{(1 - \hat{π}_{2i})}{\hat{π}_{2i}n_2} and z_{1-(α/2)} is the standard normal inverse CDF at probability 1 - α.
Returns a list of class = "ci"
. Printed results are the parameter estimate and confidence bounds.
Method will perform poorly given unbalanced sample sizes.
Ken Aho
Aho, K., and Bowyer, T. 2015. Confidence intervals for a product of proportions: Implications for importance values. Ecosphere 6(11): 1-7.
ci.impt(30,40, 25,40)