This tutorial was rendered using Rdistance version 4.5.0.
Abundance via line-transect distance-sampling when detection does not depend on covariates.
Construct the Rdistance data frame
library(Rdistance)
Loading required package: units
udunits database from C:/Users/trent/AppData/Local/R/win-library/4.6/units/share/udunits/udunits2.xml
Rdistance (v4.5.0)
# Example data (see ?sparrowDetectionData)data("sparrowDetectionData") # access example datadata("sparrowSiteData")head(sparrowDetectionData) # inspect data
# First, set study area size or desired density baseoneHectare <-set_units(1, "ha")# To save computation time, set `ci = NULL`# to compute point estimates only, i.e., abunFit <- dfuncFit |>abundEstim(area = oneHectare , ci =NULL)summary(abunFit)
Call: dfuncEstim(data = sparrowDf, dist ~ groupsize(groupsize),
likelihood = "hazrate", w.hi = whi)
Coefficients:
Estimate SE z p(>|z|)
(Intercept) 3.880325 0.1024181 37.887084 4.199822e-314
k 2.966558 0.3724571 7.964833 1.654475e-15
Message: Success; Asymptotic SE's
Function: HAZRATE
Strip: 0 [m] to 200 [m]
Effective strip width (ESW): 64.40994 [m]
Probability of detection: 0.3220497
Scaling: g(0 [m]) = 1
Log likelihood: -1647.79
AICc: 3299.614
Surveyed Units: 36000 [m]
Individuals seen: 372 in 354 groups
Average group size: 1.050847
Group size range: 1 to 3
Density in sampled area: 8.021536e-05 [1/m^2]
Abundance in 10000 [m^2] study area: 0.8021536
# Estimates are stored inside the output objectdata.frame(abunFit$estimates)
id X.Intercept. k density abundance avgEffDistance
1 Original 3.880325 2.966558 8.021536e-05 [1/m^2] 0.8021536 64.40994 [m]
nGroups nSeen avgGroupSize area surveyedUnits propUnitSurveyed w
1 354 372 1.050847 10000 [m^2] 36000 [m] 1 200 [m]
Density and abundance: With confidence intervals
# Set `ci =` to desired confidence level# Set `R =` to number of bootstrap iterationsabunFit <- dfuncFit |>abundEstim(area = oneHectare , ci =0.95 , R =100)
Creating CPU cluster with 15 cores...done.
Copying data to cores...done.
100 bootstrap iterations estimated run time ~0.03 [min]. Standby...Actual run time: 3.564 [s]
summary(abunFit)
Call: dfuncEstim(data = sparrowDf, dist ~ groupsize(groupsize),
likelihood = "hazrate", w.hi = whi)
Coefficients:
Estimate SE z p(>|z|)
(Intercept) 3.880325 0.1472417 26.353439 4.687165e-153
k 2.966558 0.4825384 6.147818 7.855619e-10
Message: Success; Bootstrap SE's
Function: HAZRATE
Strip: 0 [m] to 200 [m]
Effective strip width (ESW): 64.40994 [m]
Probability of detection: 0.3220497
Scaling: g(0 [m]) = 1
Log likelihood: -1647.79
AICc: 3299.614
Surveyed Units: 36000 [m]
Individuals seen: 372 in 354 groups
Average group size: 1.050847
Group size range: 1 to 3
Density in sampled area: 8.021536e-05 [1/m^2]
95% CI: 6.018921e-05 [1/m^2] to 0.0001122096 [1/m^2]
Abundance in 10000 [m^2] study area: 0.8021536
95% CI: 0.6018921 to 1.122096
Final density estimate (at the bottom of the output) is 0.8022 sparrows per hectare (95% CI: 0.6019 to 1.1221).
# Note: all bootstrap results are stored inside the output objecthead(data.frame(abunFit$B))