ci.prat.ak {asbio}R Documentation

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 six 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 \hat{\sigma}_{\hat{\pi}} after multiplication by a constant. Similarly, the second method(Agresti-Coull-adjusted) adjusts the variance of the estimator \hat{\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. The fourth method is Bayesian and based on the beta posterior distribution derived from a binomial likelhood function and a beta prior distribution. The fifth procedure is an older method based on Noether (1959). Sixth, bootstrapping methods can also be implemented.

Usage

ci.prat.ak(y1, n1, pi2 = NULL, method = "ac", conf = 0.95, bonf = FALSE, 
bootCI.method = "perc", R = 1000, sigma.t = NULL, r = length(y1), gamma.hyper = 1, 
beta.hyper = 1)

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", "noether-fixed", "boot", "fixed-log" or "bayes" for the Agresti-Coull-adjusted, adjusted Wald, noether-fixed, bootstrapping, fixed-log and Bayes-beta, 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.

bootCI.method

If method = "boot" the type of bootstrap confidence interval to calculate. One of "norm", "basic", "perc", "BCa", or "student". See ci.boot for more information.

R

If method = "boot" the number of bootstrap samples to take. See ci.boot for more information.

sigma.t

If method = "boot" and bootCI.methd = "student" a vector of standard errors in association with studentized intervals. See ci.boot for more information.

r

The number of ratios to which family-wise inferences are being made. Assumed to be length(y1).

gamma.hyper

If method = "bayes". A scalar or vector. Value(s) for the first hyperparameter for the beta prior distribution.

beta.hyper

If method = "bayes". A scalar or vector. Value(s) for the second hyperparameter for the beta prior distribution.

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 2015).

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. 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}}.

The function ci.prat.ak assumes that selection ratios are being specified (although other applications are certainly possible). Therefore it assume that y_{1i} must be greater than 0 if \pi_{2i} = 1, and assumes that y_{1i} must = 0 if \pi_{2i} = 0. Violation of these conditions will produce a warning message.

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}}+z^2/2}{{{n}_{1}}+z^2}, and {{\hat{\theta }}_{ACi}}=\frac{{{\hat{\pi}}_{AC1i}}}{{{\pi }_{2i}}},
where z is the standard normal inverse cdf at probability 1 - \alpha/2 (\approx 2 when \alpha= 0.05).
Bayes-beta (\frac{X_{\alpha/2}}{\pi_{2i}} , \frac{X_{1-(\alpha/2)}}{\pi_{2i}}),
where X \sim BETA(y_{1i} + \gamma_{i}, n_1 + \beta - y_{1i}).
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}}.
Noether-fixed \frac{{{{\hat{\pi }}}_{1i}}/{{\pi }_{2}}}{1+z_{1-(\alpha /2)}^{2}}1+\frac{z_{1-(\alpha /2)}^{2}}{2{{y}_{1i}}}\pm z_{1-(\alpha /2)}^{2}\sqrt{\hat{\sigma}_{NF}^{2}+\frac{z_{1-(\alpha /2)}^{2}}{4y_{1i}^{2}}},
where \hat{\sigma }_{NF}^{2}=\frac{1-{{{\hat{\pi }}}_{1i}}}{{{n}_{1}}{{{\hat{\pi }}}_{1i}}}.
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}}.

Value

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

Author(s)

Ken Aho

References

Aho, K., and Bowyer, T. 2015. Confidence intervals for ratios of proportions: implications for selection ratios. Methods in Ecology and Evolution 6: 121-132.

See Also

ci.prat, ci.p

Examples

ci.prat.ak(3,4,.5)

[Package asbio version 1.9-7 Index]