Statistical code from: Passive acoustic monitoring with AI-based detection and identification reveal sooty grouse hooting patterns in western Oregon
Data files
Nov 11, 2025 version files 28.73 MB
-
Daily_GAMM_models.R
4.79 KB
-
df_daily.csv
28.01 MB
-
df_seasonal.csv
705.11 KB
-
README.md
2.36 KB
-
Seasonal_GAMM_models.R
5.06 KB
Abstract
We estimated sooty grouse hooting patterns, both daily and seasonal, using generalized additive mixed models (GAMMs) using hooting data. The influence of weather, topographic, and study region were examined using these models, as were time since sunrise (daily) and day of year (seasonal). For both daily and seasonal frameworks, we compare models that incorporate both smooth and fixed terms using the mgcv package in Program R using the percent of deviance explained.
Dataset DOI: 10.5061/dryad.j3tx95xsj
Description of the data and file structure
Files and variables
File: Daily_GAMM_models.R
Description: Daily GAMM models run in R with mgcv package.
File: df_daily.csv
Description: Daily data used as input for GAMM models
Column definitions:
- Year_Station_ARU: Unique ID for each ARU by location and year
- Route_ID: Route ID of the sooty grouse hooting survey route the ARU was deployed on
- Ecoregion: Physiographic province. These provinces represent different forest zones and environmental factors across western Oregon.
- Date: Date
- Time: Time (Start time of the 10 minute block)
- hootsPer10Minutes: Number of sooty grouse hoots detected by PNW-Cnet for that 10 minute block of time
- Year: Year
- Elevation: Elevation, in meters
- dayOfYear: Julian day of year
- timeSinceSunrise_min: Time since sunrise, in minutes
- dailyPrecip_mm: Daily precipitation, in millimeters
- minTemp_c: Minimum daily temperature, in Celsius
File: Seasonal_GAMM_models.R
Description: Seasonal GAMM models run in R with mgcv package
File: df_seasonal.csv
Description: Seasonal data used as input for GAMM models
Column definitions:
- Year_Station_ARU: Unique ID for each ARU by location and year
- Route_ID: Route ID of the sooty grouse hooting survey route the ARU was deployed on
- Ecoregion: Physiographic province. These provinces represent different forest zones and environmental factors across western Oregon.
- Date: Date
- dailyHoots: Number of sooty grouse hoots detected by PNW-Cnet for that day
- Year: Year
- Latitude: Latitude, in decimal degrees
- Elevation: Elevation, in meters
- dayOfYear: Julian day of year
- dailyPrecip_mm: Daily precipitation, in millimeters
- minTemp_c: Minimum daily temperature, in Celsius
- recordingTime_hours: Number of hours the ARU recorded that day
Code/software
We ran the generalized additive models in program R (R Core Team 2023) using package mgcv (Wood 2006). We used gam() for the seasonal models and bam() for the daily models, since the daily model was a very large dataset and bam() uses less memory.
