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
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)
The ratio numerator number of successes. A scalar or vector.
The ratio numerator number of trials. A scalar or vector of length(y1)
The denominator proportion. A scalar or vector of length(y1)
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.
The level of confidence, i.e. 1 - P(type I error).
Logical, indicating whether or not Bonferroni corrections should be applied for simultaneous inference if y1, y2, n1
and n2
are vectors.
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.
If method = "boot"
the number of bootstrap samples to take. See ci.boot
for more information.
If method = "boot"
and bootCI.methd = "student"
a vector of standard errors in association with studentized intervals. See ci.boot
for more information.
The number of ratios to which family-wise inferences are being made. Assumed to be length(y1)
.
If method = "bayes"
. A scalar or vector. Value(s) for the first hyperparameter for the beta prior distribution.
If method = "bayes"
. A scalar or vector. Value(s) for the second hyperparameter for the beta prior distribution.
Returns a list of class = "ci"
. Default output is a matrix with the point and interval estimate.
Koopman et al. (1984) suggested methods for handling extreme cases of
Let
where
where
The function ci.prat.ak
assumes that selection ratios are being specified (although other applications are certainly possible). Therefore it assume that
Method | Algorithm |
Agresti Coull-Adjusted
Aho, K., and Bowyer, T. 2015. Confidence intervals for ratios of proportions: implications for selection ratios. Methods in Ecology and Evolution 6: 121-132.
# NOT RUN {
ci.prat.ak(3,4,.5)
# }
Run the code above in your browser using DataLab