abundEstim: Estimate abundance from distance-sampling data

Description Usage Arguments Details Value Author(s) References See Also Examples


Estimate abundance (or density) given an estimated detection function and supplemental information on observed group sizes, transect lengths, area surveyed, etc. Also computes confidence intervals of abundance (or density) using the bias corrected bootstrap method.


abundEstim(dfunc, detectionData, siteData, area = 1, ci = 0.95,
  R = 500, plot.bs = FALSE, bySite = FALSE, showProgress = TRUE)



An estimated 'dfunc' object produced by dfuncEstim.


A data.frame with each row representing one detection (see example dataset, sparrowDetectionData) and with at least the following three columns:

  • siteID = ID of the transect or point.

  • groupsize = the number of individuals in the detected group.

  • dist = the perpendicular, off-transect distance or radial off-point distance to the detected group.


A data.frame with each row representing one site (transect or point) (see example dataset, sparrowSiteData). If the data in detectionData is from line transects, siteData must have at least the following two columns:

  • siteID = ID of the transect or point. This vector is used during bootstrapping to resample sites.

  • length = the length of the transect.

If the data in detectionData is from point transects, siteData must have a siteID column only. For both data types, siteID is used during bootstrapping to resample sites.


Total study area size. If area = 1, density is estimated. Density has units (number of animals) per (squared units of the distance measurements). For example, if distance values fitted in dfunc are meters, density is number of individuals per square meter. If distances are miles, density is number of individuals per square mile. If area > 1, total abundance on the study area is estimated and units are (number of animals). This can also be used to convert units for density. For example, if distance values fitted in dfunc are meters, and area is set to 10,000, density is number of individuals per hectare (ha; 1 ha = 10,000 square meters). square meter.


A scalar indicating the confidence level of confidence intervals. Confidence intervals are computed using the bias corrected bootstrap method. If ci = NULL, confidence intervals are not computed.


The number of bootstrap iterations to conduct when ci is not NULL.


A logical scalar indicating whether to plot individual bootstrap iterations.


A logical scalar indicating whether to compute site-level estimates of abundance. The default (bySite=FALSE) returns only one overall abundance estimate. This routine does not calculate confidence intervals for these site-level abundance estimates, so ci is set to NULL if bySite = TRUE. See estimateN.


A logical indicating whether to show a text-based progress bar during bootstrapping. Default is TRUE. It is handy to shut off the progress bar if running this within another function. Otherwise, it is handy to see progress of the bootstrap iterations.


The abundance estimate for line transect surveys (if no covariates are included in the detection function) is

N = n.indiv*area / (2*ESW*tot.trans.len)

where n.indiv is either avg.group.size * n or sum(group.sizes), and ESW is the effective strip width computed from the estimated distance function (i.e., ESW(dfunc)).

The confidence interval for abundance assumes that the fundamental units of replication (lines or points, hereafter "sites") are independent. The bias corrected bootstrap method used here resamples the units of replication (sites) and recalculates the model's parameter estimates. If a double-observer data frame is included in dfunc, rows of the double-observer data frame are re-sampled each bootstrap iteration. No model selection is performed. By default, R = 500 iterations are performed, after which the bias corrected confidence intervals are computed using the method given in Manly (1997, section 3.4).

Setting plot.bs=FALSE and showProgress=FALSE suppresses all intermediate output. This is good when calling abundEstim from within other functions or during simulations.


If bySite is FALSE, an 'abundance estimate' object, a list of class c("abund", "dfunc"), containing all the components of a "dfunc" object (see dfuncEstim), plus the following:


Estimated abundance in the study area (if area > 1) or estimated density in the study area (if area = 1).


The number of detections (not individuals, unless all group sizes = 1) used in the estimate of abundance.


Total area of inference. Study area size


Effective strip width for line-transects, effective radius for point-transects. Both derived from dfunc. See ESW

or EDR for formulas.


Total number of transects for line-transects, total number of points for point-transects.


Total transect length. NULL for point-transects.


Average group size


The bias corrected bootstrap confidence interval for n.hat. The names of this component give the quantiles of the bootstrap distribution used to compute the bias corrected interval.


A vector or length R containing all bootstrap estimated population sizes. If a particular iteration did not converge, the corresponding entry in B will be NA. The bootstrap distribution of n.hat can be plotted with hist(x$B), where x is an 'abundance estimate' object. The confidence interval in ci can be reproduced with quantile(x$B[!is.na(x$B)], p=names(x$ci) ).


The (scalar) confidence level of the confidence interval for n.hat.

If bySite is TRUE, a data frame containing site-level estimated abundance. The data frame is an exact copy of siteData with the following columns tacked onto the end:


The effective sampling distance at the site. For line- transects, this is ESW at the site. For points, this is EDR.


Average probability of detection at the site. If only site-level covariates appear in the distance function, pDetection is constant within a site. When detection-level covariates are present, pDetection is the average at the site.


The total number of individuals detected at a site.


Estimated abundance at the site. This is the sum of inflated group sizes at the site. i.e., each group size at the site is divided by its pDetection, and then summed.


Estimated density at the site. This is abundance at the site divided by the sampled area at the site. E.g., for line transects, this is abundance divided by 2*w*length. For points, this is abundance divided by pi*w^2.


The effective area sampled at the site. This could be used as an offset in a subsequent linear model. For line transects, this is 2*ESW*length. For points, this is pi*EDR^2.


Trent McDonald, WEST Inc., tmcdonald@west-inc.com
Aidan McDonald, WEST Inc., aidan@mcdcentral.org
Jason Carlisle, University of Wyoming and WEST Inc., jcarlisle@west-inc.com


Manly, B.F.J. (1997) Randomization, bootstrap, and monte-carlo methods in biology, London: Chapman and Hall.

Buckland, S.T., D.R. Anderson, K.P. Burnham, J.L. Laake, D.L. Borchers, and L. Thomas. (2001) Introduction to distance sampling: estimating abundance of biological populations. Oxford University Press, Oxford, UK.

See Also

dfuncEstim, autoDistSamp.


# Load example sparrow data (line transect survey type)

# Fit half-normal detection function
dfunc <- dfuncEstim(formula=dist~1,
                    likelihood="halfnorm", w.hi=100, pointSurvey=FALSE)

# Estimate abundance given a detection function
# Note, area=10000 converts to density per hectare (for distances measured in meters)
# Note, a person should do more than R=20 iterations
fit <- abundEstim(dfunc, detectionData=sparrowDetectionData,
                  siteData=sparrowSiteData, area=10000, R=20, ci=0.95,
                  plot.bs=TRUE, bySite=FALSE)

# Print results

Example output

Rdistance (version 2.1.3)
Computing bootstrap confidence interval on N...

  |                                                                      |   0%
  |====                                                                  |   5%
  |=======                                                               |  11%
  |===========                                                           |  16%
  |===============                                                       |  21%
  |==================                                                    |  26%
  |======================                                                |  32%
  |==========================                                            |  37%
  |=============================                                         |  42%
  |=================================                                     |  47%
  |=====================================                                 |  53%
  |=========================================                             |  58%
  |============================================                          |  63%
  |================================================                      |  68%
  |====================================================                  |  74%
  |=======================================================               |  79%
  |===========================================================           |  84%
  |===============================================================       |  89%
  |==================================================================    |  95%
  |======================================================================| 100%
Call: dfuncEstim(formula = dist ~ 1, detectionData =
   sparrowDetectionData, likelihood = "halfnorm", pointSurvey = FALSE,
   w.hi = 100)
       Estimate  SE        z        p(>|z|)     
Sigma  46.3587   2.549913  18.1805  7.365789e-74

Convergence: Success
Function: HALFNORM  
Strip: 0 to 100 
Effective strip width (ESW): 56.30084 
Probability of detection: 0.5630084 
Scaling: g(0) = 1
Log likelihood: 1484.297 
AICc: 2970.605

Abundance estimate:  0.8634171 ;  95% CI=( 0.6679225 to 0.9652753 )

Rdistance documentation built on May 2, 2019, 3:49 a.m.