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 after multiplication by a constant.
Similarly, the second method(Agresti-Coull-adjusted) adjusts the variance of the estimator
,
where
. 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 |
pi2 |
The denominator proportion. A scalar or vector of |
method |
One of |
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 |
bootCI.method |
If |
R |
If |
sigma.t |
If |
r |
The number of ratios to which family-wise inferences are being made. Assumed to be |
gamma.hyper |
If |
beta.hyper |
If |
Details
Koopman et al. (1984) suggested methods for handling extreme cases of ,
,
, and
(see below). These are applied through exception handling here (see Aho and Bowyer 2015).
Let and
be multinomial random variables with parameters
, and
, respectively; where
. This encompasses the binomial case in which
. We define the true selection ratio for the ith resource of r total resources to be:
where and
represent the proportional use and availability of the ith resource, respectively. If
the selection ratio becomes relative risk. The maximum likelihood estimators for
and
are the sample proportions:
and
where and
are the observed counts for use and availability for the ith resource. If
s are known, the estimator for
is:
The function ci.prat.ak
assumes that selection ratios are being specified (although other applications are certainly possible). Therefore it assume that must be greater than 0 if
, and assumes that
must = 0 if
. Violation of these conditions will produce a warning message.
Method | Algorithm |
Agresti Coull-Adjusted | , |
where , and , |
|
where is the standard normal inverse cdf at probability ( when ). |
|
Bayes-beta | , , |
where . |
|
Fixed-log | , |
where |
|
Noether-fixed | , |
where . |
|
Wald-adjusted |
|
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
Examples
ci.prat.ak(3,4,.5)