ci.impt {asbio}R Documentation

Confidence interval for the product of two proportions

Description

Provides one and two-tailed confidence intervals for the true product of two proportions.

Usage


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)

Arguments

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 avail.known = TRUE.

n2

The number of trials associated with the first proportion. Not used if avail.known = TRUE.

avail.known

Logical. Are the proportions π2i\pi_{2i} known? If avail.known = TRUE these proportions should specified in the pi.2 argument.

pi.2

Proportions for π2i\pi_{2i}. Required if avail.known = TRUE.

conf

Confidence level, i.e., 1 - α\alpha.

x100

Logical. If true, estimate is multiplied by 100.

alternative

One of "two.sided", "less", "greater". Allows lower, upper, and two-tailed confidence intervals. If alternative = "two.sided" (the default), then a conventional two-sided confidence interval is given. The specifications alternative = "less" and alternative = "greater" provide lower and upper tailed CIs, respectively.

bonf

Logical. If bonf = TRUE, and the number of requested intervals is greater than one, then Bonferroni-adjusted intervals are returned.

wald

Logical. If avail.known = TRUE one can apply one of two standard error estimators. The default is a delta-derived estimator. If wald = TRUE is specified a modified Wald standard error estimator is used.

Details

Let Y1Y_1 and Y2Y_2 be multinomial random variables with parameters n1n_1, π1i\pi_{1i} and n2n_2, π2i\pi_{2i}, respectively; where i=1,2,,ri = 1,2,\dots, r. Under delta derivation, the log of the products of π1i\pi_{1i} and π2i\pi_{2i} (or the log of a product of π1i\pi_{1i} and π2i\pi_{2i} and a constant) is asymptotically normal with mean log(π1i×π2i)log(\pi_{1i} \times \pi_{2i}) and variance (1π1i)/π1in1+(1π2i)/π2in2(1 - \pi_{1i})/\pi_{1i}n_1 + (1 - \pi_{2i})/ \pi_{2i}n_2. Thus, an asymptotic (1α)100(1 - \alpha)100 percent confidence interval for π1i×π2i\pi_{1i} \times \pi_{2i} is given by:

π^1i×π^2i×exp(±z1(α/2)σ^i) \hat{\pi}_{1i} \times \hat{\pi}_{2i} \times \exp(\pm z_{1-(\alpha/2)}\hat{\sigma}_i)

where: σ^i2=(1π^1i)π^1in1+(1π^2i)π^2in2\hat{\sigma}^2_i = \frac{(1 - \hat{\pi}_{1i})}{\hat{\pi}_{1i}n_1} + \frac{(1 - \hat{\pi}_{2i})}{\hat{\pi}_{2i}n_2} and z1(α/2)z_{1-(\alpha/2)} is the standard normal inverse CDF at probability 1α1 - \alpha.

Value

Returns a list of class = "ci". Printed results are the parameter estimate and confidence bounds.

Note

Method will perform poorly given unbalanced sample sizes.

Author(s)

Ken Aho

References

Aho, K., and Bowyer, T. 2015. Confidence intervals for a product of proportions: Implications for importance values. Ecosphere 6(11): 1-7.

See Also

ci.prat, ci.p

Examples

ci.impt(30,40, 25,40)

[Package asbio version 1.9-7 Index]