I’m fitting a Beta GAM in mgcv to model the proportion of daytime outdoor-use time in laying hens. The response is the proportion of minutes spent outdoors during an 08:00–22:00 observation window, and the model contains repeated observations from individual hens.
My current model is approximately:
prop_outside ~
coop_id +
s(study_day, bs = "cr", k = 40) +
s(max_temp, bs = "cr", k = 8) +
s(mean_dew_point, bs = "cr", k = 7) +
rain_any +
s(log_total_rain, by = rain_status, bs = "cr", k = 7) +
s(eid, bs = "re")
using:
family = betar(link = "logit")
method = "REML"
The dataset contains roughly 8,800 positive hen-day observations from 124 hens across about 137 study dates. The model explains about 60% of the deviance.
The issue is the study_day smooth. On a same-row model comparison, I get:
s(study_day)
k' = 39
edf = 34.58
k-index = 0.949
p-value < 0.001
I also tried an alternative weather specification using mean temperature, mean humidity and mean wind instead of maximum temperature and dew point:
prop_outside ~
coop_id +
s(study_day, bs = "cr", k = 40) +
s(mean_temp, bs = "cr", k = 8) +
s(mean_humidity, bs = "cr", k = 8) +
s(mean_wind, bs = "cr", k = 8) +
rain_any +
s(log_total_rain, by = rain_status, bs = "cr", k = 7) +
s(eid, bs = "re")
The same issue persists:
s(study_day)
k' = 39
edf = 34.84
k-index = 0.966
p-value = 0.0175
The study-day smooth is visually quite wiggly, particularly early in the study, and the EDF is already fairly close to the available basis dimension. Changing the weather specification does not materially improve overall fit: both models explain about 60% of deviance and have essentially identical AIC.
There is also substantial temporal/weather dependence. For example, in the alternative model, observed concurvity is about 0.90 for mean temperature and 0.48 for study day.
My questions are:
- Is the low
k-index plus EDF ≈ 35/39 sufficient reason to increase k for study_day, for example from 40 to 60?
- If increasing
k gives essentially the same fitted curve/predictions but the k-check remains significant, would you consider the current smooth adequate?
- Could this be indicating residual temporal autocorrelation rather than simply an insufficient basis dimension?
- Would you model study date differently in this setting—for example with an autocorrelation structure, a different smooth basis, or another temporal term?
- Since weather variables themselves follow study date seasonally, how would you distinguish genuine temporal structure from weather-related temporal confounding?
My current plan is to compare k = 40 and k = 60 on the same observations and assess whether fitted values, the study-day effect, held-out-date prediction, and conclusions materially change, rather than selecting the model based only on the k-check p-value.
I’d appreciate advice on how to interpret this persistent study_day diagnostic and what additional diagnostic/model comparison would be most appropriate.