Supplement, covariate coefficient interpretation

Author

Centre for Research into Ecological and Environmental Modelling
University of St Andrews

Modified

November 2024

Covariate analysis of point transects: Savannah sparrow
  • Further investigation of a single covariate (pasture) upon detectability of the Savannah Sparrow data set. The analysis is done in R, but the understanding of the covariates is relevant whatever software is used.

Recall, these are data from Colorado, described by Knopf et al. (1988). The question here was whether to include pasture as a covariate in the detection function. The biological question being, “does detectability of Savannah sparrows differ between the pastures in which the survey was conducted.”

library(Distance)
data(Savannah_sparrow_1980)
head(Savannah_sparrow_1980, n=3)
  Region.Label Area Sample.Label Effort object distance Study.Area
1    PASTURE 1    1    POINT   1      1     NA       NA  SASP 1980
2    PASTURE 1    1    POINT   2      1     NA       NA  SASP 1980
3    PASTURE 1    1    POINT   3      1     NA       NA  SASP 1980
hist(Savannah_sparrow_1980$distance, 
     nclass=20, xlab="Distance (m)",
     main="Savannah sparrow radial distances '80")

conversion.factor <- convert_units("meter", NULL, "hectare")

A truncation distance of 55m was chosen. The half normal and hazard rate functions were tried in turn, allowing AIC selection of cosine adjustment terms, then pasture was included as a covariate in the detection function.

Savannah_sparrow_1980.hn <- ds(data=Savannah_sparrow_1980, key="hn",
                               adjustment="cos", truncation=55,
                               transect="point", 
                               convert_units=conversion.factor)
Savannah_sparrow_1980.hr <- ds(data=Savannah_sparrow_1980, key="hr",
                               adjustment="cos", truncation=55,
                               transect="point", 
                               convert_units=conversion.factor)
Savannah_sparrow_1980.hn.region <- ds(data=Savannah_sparrow_1980, key="hn",
                                      truncation=55,
                                      transect="point",
                                      convert_units=conversion.factor,
                                      formula=~Region.Label)
Savannah_sparrow_1980.hr.region <- ds(data=Savannah_sparrow_1980, key="hr", truncation=55,
                                      transect="point", convert_units=conversion.factor,
                                      formula=~Region.Label)
AIC(Savannah_sparrow_1980.hn, Savannah_sparrow_1980.hr, 
    Savannah_sparrow_1980.hn.region, Savannah_sparrow_1980.hr.region)
                                df      AIC
Savannah_sparrow_1980.hn         2 2126.228
Savannah_sparrow_1980.hr         2 2129.961
Savannah_sparrow_1980.hn.region  3 2125.033
Savannah_sparrow_1980.hr.region  4 2130.447

The half normal model with pasture as a covariate had a marginally smaller AIC than the half normal model without pasture. The plots and estimates are shown below.

plot(Savannah_sparrow_1980.hn.region, pch=".", pdf=TRUE)

Note different PDF shapes caused by the pasture covariate.
summary(Savannah_sparrow_1980.hn.region)

Summary for distance analysis 
Number of observations :  271 
Distance range         :  0  -  55 

Model       : Half-normal key function 
AIC         :  2125.033 
Optimisation:  mrds (nlminb) 

Detection function parameters
Scale coefficient(s):  
                         estimate         se
(Intercept)            3.17237666 0.09850468
Region.LabelPASTURE 2 -0.20459862 0.11098924
Region.LabelPASTURE 3 -0.03286901 0.12333031

                       Estimate          SE         CV
Average p             0.2896553  0.01973518 0.06813332
N in covered region 935.5946771 79.89055349 0.08539013

Summary statistics:
     Region Area CoveredArea Effort   n   k        ER      se.ER      cv.ER
1 PASTURE 1    1    117.8411    124  59 124 0.4758065 0.07009015 0.14730811
2 PASTURE 2    1    119.7418    126 121 126 0.9603175 0.09521957 0.09915427
3 PASTURE 3    1    116.8908    123  91 123 0.7398374 0.07467322 0.10093193
4     Total    3    354.4738    373 271 373 0.7253204 0.04661364 0.06426628

Abundance:
      Label Estimate        se         cv       lcl      ucl       df
1 PASTURE 1 1.430170 0.3084008 0.21563923 0.9403572 2.175117 353.1228
2 PASTURE 2 4.116182 0.5642114 0.13707154 3.1472623 5.383394 329.1061
3 PASTURE 3 2.345631 0.3717609 0.15849077 1.7208931 3.197169 374.9983
4     Total 7.891983 0.7427326 0.09411229 6.5625680 9.490706 537.6070

Density:
      Label Estimate        se         cv       lcl      ucl       df
1 PASTURE 1 1.430170 0.3084008 0.21563923 0.9403572 2.175117 353.1228
2 PASTURE 2 4.116182 0.5642114 0.13707154 3.1472623 5.383394 329.1061
3 PASTURE 3 2.345631 0.3717609 0.15849077 1.7208931 3.197169 374.9983
4     Total 2.630661 0.2475775 0.09411229 2.1875227 3.163569 537.6070

A similar process was conducted for the 1981 data: a truncation distance of 55m was again used.

data(Savannah_sparrow_1981)
conversion.factor <- convert_units("meter", NULL, "hectare")
Savannah_sparrow_1981.hn <- ds(data=Savannah_sparrow_1981, key="hn", 
                               adjustment="cos", truncation=55,
                               transect="point", convert_units=conversion.factor)
Savannah_sparrow_1981.hr <- ds(data=Savannah_sparrow_1981, key="hr", 
                               adjustment="cos", truncation=55,
                               transect="point", convert_units=conversion.factor)
Savannah_sparrow_1981.hn.region <- ds(data=Savannah_sparrow_1981, 
                                      key="hn", truncation=55, transect="point",
                                      convert_units=conversion.factor,
                                      formula=~Region.Label)
Savannah_sparrow_1981.hr.region <- ds(data=Savannah_sparrow_1981, key="hr", 
                                      truncation=55, transect="point",
                                      convert_units=conversion.factor,
                                      formula=~Region.Label)
AIC(Savannah_sparrow_1981.hn, Savannah_sparrow_1981.hr, 
    Savannah_sparrow_1981.hn.region, Savannah_sparrow_1981.hr.region)
                                df      AIC
Savannah_sparrow_1981.hn         1 1266.358
Savannah_sparrow_1981.hr         2 1267.335
Savannah_sparrow_1981.hn.region  4 1261.684
Savannah_sparrow_1981.hr.region  5 1260.638

For 1981, there was a clear preference for including pasture as a covariate in the detection function but little to choose from between the half normal and hazard rate key function. For comparability with 1980, the plots and results below are for the half normal model although AIC showed a slight preference for the hazard rate model. The differences in detection between pastures can easily be seen and this is reflected in the estimated densities (birds per hectare).

pastures <- unique(Savannah_sparrow_1981$Region.Label)
plot(Savannah_sparrow_1981.hn.region, showpoints=FALSE, 
     main="Savannah sparrows with pasture covariate", pdf=TRUE)
k <- 1
for (i in pastures) {
  k <- k+1
  add_df_covar_line(Savannah_sparrow_1981.hn.region, 
                    data=data.frame(Region.Label=as.character(i)),
                    lty=1, col=k, lwd=3, pdf=TRUE)
}
legend("topright", legend=tolower(as.character(pastures)), 
       col=2:k, lwd=2, title = "Pastures")
text(-2,0.038, cex=0.9, pos=4,
     expression(widehat(sigma[p])==plain(exp)(widehat(beta[0]) + widehat(beta[1]) * p[1] + widehat(beta[2]) * p[2] + widehat(beta[3]) * p[3])))
library(plotrix)
parms <- data.frame(est=c(2.944, 0.736, 0.166, 0.271),
                    se=c(0.111, 0.373, 0.153, 0.179))
rownames(parms) <- c("b0", "b1", "b2", "b3")
addtable2plot(2, 0.027, parms, bty="o",
              display.rownames=TRUE,hlines=TRUE, cex=0.8,
              xpad=0.4, vlines=FALSE,title="Parameter estimates")

Stronger influence of pasture covariate seen here.
summary(Savannah_sparrow_1981.hn.region)

Summary for distance analysis 
Number of observations :  162 
Distance range         :  0  -  55 

Model       : Half-normal key function 
AIC         :  1261.684 
Optimisation:  mrds (nlminb) 

Detection function parameters
Scale coefficient(s):  
                       estimate        se
(Intercept)           2.9440471 0.1110272
Region.LabelPASTURE 1 0.7362681 0.3726357
Region.LabelPASTURE 2 0.1660949 0.1524426
Region.LabelPASTURE 3 0.2703034 0.1790810

                       Estimate          SE        CV
Average p             0.3435487  0.03715842 0.1081606
N in covered region 471.5489313 59.62606186 0.1264472

Summary statistics:
     Region Area CoveredArea Effort   n   k    ER      se.ER      cv.ER
1 PASTURE 0    1    95.03318    100  31 100 0.310 0.05448566 0.17576019
2 PASTURE 1    1    95.03318    100  32 100 0.320 0.06175874 0.19299605
3 PASTURE 2    1    95.03318    100  51 100 0.510 0.08225975 0.16129363
4 PASTURE 3    1    95.03318    100  48 100 0.480 0.07174590 0.14947063
5     Total    4   380.13271    400 162 400 0.405 0.03418422 0.08440547

Abundance:
      Label  Estimate        se        cv       lcl      ucl       df
1 PASTURE 0 1.3887466 0.3779428 0.2721467 0.8203808 2.350880 255.9017
2 PASTURE 1 0.5241867 0.1817587 0.3467442 0.2699503 1.017861 250.9726
3 PASTURE 2 1.6980708 0.4057104 0.2389243 1.0676527 2.700732 251.7139
4 PASTURE 3 1.3509360 0.3544528 0.2623757 0.8127396 2.245526 253.0658
5     Total 4.9619401 0.6827259 0.1375925 3.7903971 6.495586 357.0057

Density:
      Label  Estimate        se        cv       lcl      ucl       df
1 PASTURE 0 1.3887466 0.3779428 0.2721467 0.8203808 2.350880 255.9017
2 PASTURE 1 0.5241867 0.1817587 0.3467442 0.2699503 1.017861 250.9726
3 PASTURE 2 1.6980708 0.4057104 0.2389243 1.0676527 2.700732 251.7139
4 PASTURE 3 1.3509360 0.3544528 0.2623757 0.8127396 2.245526 253.0658
5     Total 1.2404850 0.1706815 0.1375925 0.9475993 1.623896 357.0057

In these models, the detection functions have been fitted to all the detections within the study region (for each year). An alternative would be to fit separate detection functions within each pasture (specified in Region.Label), provided there are enough detections. This would allow different shape detection functions to be fitted in each pasture (providing this is a reasonable thing to do).

References

Knopf, F. L., Sedgwick, J. A., & Cannon, R. W. (1988). Guild structure of a riparian avifauna relative to seasonal cattle grazing. The Journal of Wildlife Management, 52(2), 280–290. https://doi.org/10.2307/3801235