Learn R Programming

asbio (version 1.0-5)

ci.prat.ak: Confidence intervals for ratios of proportions when the denominator is known

Description

It is increasingly possible that resource availabilities on a landscape will be known. For instance, in remotely sensed imagery with sub-meter resolution, the areal coverage of resources can be quantified to a high degree of precision, at even large spatial scales. Included in this function are three methods for computation of confidence intervals for a true ratio of proportions when the denominator proportion is known. The first (adjusted-Wald) results from the variance of the estimator $\sigma_{\hat{\pi}}$ after multiplication by a constant. Similarly, the second method(adjusted-Agresti-Coull) adjusts the variance of the estimator $\sigma_{\hat{\pi}_{AC}}$, where $\hat{\pi}_{AC}=(y+2)/(n+4)$. The third method (fixed-log) is based on delta derivations of the logged ratio.

Usage

ci.prat.ak(y1, n1, pi2 = NULL, method = "fixed", conf = 0.95, bonf = TRUE)

Arguments

y1
The ratio numerator number of successes. A scalar or vector.
n1
The ratio numerator number of trials. A scalar or vector of length(y1)
pi2
The denominator proportion. A scalar or vector of length(y1)
method
One of "ac", "wald" or "fixed" for the adjusted Agresti-Coull, adjusted Wald, and log methods respectively. Partial distinct names can be used.
conf
The level of confidence, i.e. 1 - P(type I error).
bonf
Logical, indicating whether or not Bonferroni corrections should be applied for simultaneous inference if y1, y2, n1 and n2 are vectors.

Value

  • Returns a list of class = "ci". Default output is a matrix with the point and interval estimate.

Details

Koopman et al. (1984) suggested methods for handling extreme cases of $y_1$, $n_1$, $y_2$, and $n_2$ (see below). These are applied through exception handling here (see Aho and Bowyer in review). Let $Y_1$ and $Y_2$ be multinomial random variables with parameters $n_1, \pi_{1i}$, and $n_2, \pi_{2i}$, respectively; where $i = {1, 2, 3, \dots, r}$. This encompasses the binomial case in which $r = 1$. We define the true selection ratio for the ith resource of r total resources to be: $$\theta_{i}=\frac{\pi _{1i}}{\pi _{2i}}$$ where $\pi_{1i}$ and $\pi_{2i}$ represent the proportional use and availability of the ith resource, respectively. Note that if $r = 1$ the selection ratio becomes relative risk. The maximum likelihood estimators for $\pi_{1i}$ and $\pi_{2i}$ are the sample proportions: $${{\hat{\pi }}_{1i}}=\frac{{{y}_{1i}}}{{{n}_{1}}},$$ and $${{\hat{\pi }}_{2i}}=\frac{{{y}_{2i}}}{{{n}_{2}}}$$ where $y_{1i}$ and $y_{2i}$ are the observed counts for use and availability for the ith resource. If $\pi_{2i}$s are known, the estimator for $\theta_i$ is: $$\hat{\theta}_{i}=\frac{\hat{\pi}_{1i}}{\pi}_{2i}.$$ ll{ Method Algorithm Agresti Coull-Adjusted ${{\hat{\theta}}_{ACi}}\pm {{z}_{1-(\alpha /2)}}\sqrt{{{{\hat{\pi }}}_{AC1i}}(1-{{{\hat{\pi }}}_{AC1i}})/({{n}_{1}}+4){{{\hat{\pi }}}_{AC1i}}\pi _{2i}^{2}}$, where ${{\hat{\pi}}_{AC1i}}=\frac{{{y}_{1}}+2}{{{n}_{1}}+4}$, and ${{\hat{\theta }}_{ACi}}=\frac{{{\hat{\pi}}_{AC1i}}}{{{\pi }_{2i}}}$. Fixed-log ${{\hat{\theta }}_{i}}\times \exp \left( \pm {{z}_{1-\alpha /2}}{{{\hat{\sigma }}}_{F}} \right)$, where $\hat{\sigma }_{^{F}}^{2}=(1-{{\hat{\pi}}_{1i}})/{{\hat{\pi}}_{1i}}{{n}_{1}}.$ Wald-adjusted ${{\hat{\theta }}_{i}}\pm {{z}_{1-(\alpha /2)}}\sqrt{{{{\hat{\pi }}}_{1i}}(1-{{{\hat{\pi }}}_{1i}})/{{n}_{1}}{{{\hat{\pi }}}_{1i}}\pi _{2i}^{2}}.$ }

References

Aho, K., and Bowyer, T. (In review) Confidence intervals for ratios of multinomial random variables (selection ratios). Environental and Ecological Statistics.

See Also

ci.prat, ci.p

Examples

Run this code
ci.prat.ak(3,4,.5)

Run the code above in your browser using DataLab