knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(AKaerial)

The Ratio Estimator

The classical ratio estimator (Cochran 1977) is a straightforward approach that can be used to estimate the density of birds on a landscape, given an adequate sampling design. The Alaska Region employs a stratified strip transect design for the majority of its surveys of breeding waterfowl. Study areas are separated into spatial strata based on underlying habitat types and assumed suitability as waterfowl breeding habitat. Strata are then sampled by low-level flights along a series of strip transects, with one or two observers searching 200 meters out from the transect. Observations and sampled areas are then summed across transects within each stratum to produce strata-specific density estimates. These densities are then multiplied by associated strata areas to produce stratum-specific population indices that are summed to produce the overall breeding population index.

$$E[\hat Y] = \displaystyle\sum_{i}^{S} \frac{\bar y_i}{\bar a_i} A_i = \displaystyle\sum_{i}^{S} \hat D_i A_i$$ where $y_i$ are observations and $a_i$ are sampled areas in strata $i$ and $$A_i = \displaystyle\sum_{j}^{M_i} a_{ij}.$$ with estimated variance from Williams et al. (2002) $$Var(\hat Y) = \displaystyle\sum_{i}^{S} M_i^2 \frac{(1-m_i / M_i)}{m_i} ( s^2_{iy} + \hat {D^2}i s^2{ia} - 2 \hat {D_i} s_{iay} ),$$ where $m_i$ and $M_i$ are the number of sampled and total plots in strata $i$, respectively, and there are $S$ total strata; $$s^2_{ix} = \displaystyle\sum_{j}^{m_i} (x_{ij} - \bar x )/(m_i -1), $$ and $$s^2_{ixy} = \displaystyle\sum_{j}^{m_i} (x_{ij} - \bar x )(y_{ij} - \bar y )/(m_i -1).$$

The resulting population index generally remains an index to an unknown, larger population. For some species, visibility correction factors (VCFs) are applied to calculate a population estimate. In these cases, concurrent studies have estimated the proportion of birds that are available to be seen along a transect, but are missed by an observer. For example, a VCF of 2.0 would indicate that for every bird seen along a transect, another bird is available to be seen, but goes unseen.

Single-year vs. multiple-year estimates

AKaerial is designed to streamline the generation of estimates and provide both a single-year approach to generating a table of estimates (detailed below), as well as a multiple-year wrapper, EstimatesTable.

Individual year: Preparing the data

The 4 requirements for an AKaerial estimate are:

  1. area - the MBM code for the area designation (the same value the data were GreenLighted under). One important note here is that DataSelect is not the appropriate function to prepare Waterfowl Breeding Population and Habitat Survey (WBPHS, BPOP, "North American") data for analysis. Instead, use ReadWBPHS.
  2. data.path - the directory path to the clean (GreenLight) data file.
  3. strata.path - the directory path to the ESRI .shp file representing the study area and stratification polygons.
  4. transect.path - the directory path to the ESRI .shp file representing the design transects.

In order for AKaerial to attempt to generate an estimate, these 3 files must be passed to the function DataSelect, with threshold as an optional argument defining the maximum distance (in kilometers) an observation can be from a transect before being thrown out as an intentional deviation from the design. The programmatic standard (and default) is 0.5 km.

my.data = DataSelect(data.path = "C:/data/data2020.csv",
                     strata.path = "C:/strata/strata2020.shp",
                     transect.path = "C:/transects/transects2020.shp",
                     area = "YKD")

The following sequence of events will occur:

The returned object will be a list of 5 elements appropriate for use in Densities:

  1. obs - The original data file with corrected spatial information and indices.
  2. flight - Summarized flight information (omitting design transects not flown).
  3. design - SplitDesign output.
  4. strata - Polygon areas in km^2^ and maximum possible transects (M).
  5. transect - Observations summarized at the transect level.

Individual year: generating estimates

Once the list object has been created using DataSelect, a table of estimates is created by calling Densities with the list object and area as the only arguments.

``` {r eval=FALSE} my.estimates = Densities(my.dataselect, area = "YKD")

[Densities](../help/Densities) will sum the indices at the stratum level and divide by the sum of the sampled transect areas in each stratum to estimate the density of each species in each stratum by the observer.  These densities are then multiplied by the corresponding strata areas and summed to estimate the number of birds in the study area across all strata.  

The resulting return object is a list with 2 elements:

  1. `estimates` - Data frame of estimates by species, along with their corresponding variances and standard errors.
  1. `counts.final` - More detailed data frame that includes variance components and densities broken down by stratum and species.

``` {r echo=FALSE}
print(YKDHistoric$output.table[YKDHistoric$output.table$Year==2019,])

Multiple year: Preparing the data

The multiple-year approach requires either a connection to the current USFWS-R7-MBM repository (as of 2022, AKaerial uses the internal airdata/Waterfowl/ directory, but will soon use the R7 Regional Data Repository), or access to a mirrored copy of it on a local drive. If you choose the mirrored drive option, it will be much easier if the folder structure within matches that of the Waterfowl repository.

Checking repository connection

If you have access to the current repository, you only need to check that the drive letter of your network connection matches the drive letter in the object MasterFileList. It is highly recommended that you work from either the current repository or a mirrored duplicate. If you choose a mirrored duplicate, or your drive letter does not match the default value ("K:"), it can be changed to your drive easily:

``` {r eval=FALSE} MasterFileList$DRIVE = "C:" MasterFileList$DRIVE = "C:/MyMirror"

If you are working from a mirror with a different folder structure, you will have to overwrite the year-specific values in MasterFileList$STRATA, $TRANS, and $OBS for strata .shp file, transect .shp file, and observation .csv files.  Keep in mind that the functions are designed to combine or exclude observation files automatically in area-, year-, and even seat-specific situations.  If any of this logic needs to be broken for your particular estimates table, then you will have to run individual years (above).  

## Generating the table of estimates

Once you have a connection to your repository established (or have an appropriately overwritten MasterFileList object), you can generate a table using:

``` {r eval=FALSE}
my.table = EstimatesTable(area = "YKG", year = c(2005, 2021))

You can then save your estimates table to a local or network location:

``` {r eval=FALSE} my.table = EstimatesTable(area = "YKG", year = c(2005, 2021))

write.csv(my.table$output.table, file="C:/Results/YKG_2005to2021_output.csv", quote=FALSE, row.names = FALSE)

write.csv(my.table$expanded.table, file="C:/Results/YKG_2005to2021_expanded.csv", quote=FALSE, row.names = FALSE)

write.csv(my.table$combined, file="C:/Results/YKG_2005to2021_combined.csv", quote=FALSE, row.names = FALSE)

```

See EstimatesTable for more information on the resulting object.

References

Cochran, W.G. 1977. Sampling techniques. New York: John Wiley & Sons.

Williams, B.K., J.D. Nichols, and M.J. Conroy. 2002. Analysis and management of animal populations. Academic Press, New York, 817 pp.



USFWS/AKaerial documentation built on April 3, 2025, 4:06 p.m.