It's been a while I fitted GAMs, but I always find interpreting smooth terms to be somewhat confusing because there is no positive or negative sign for co-efficients. The plot does not always show a clear upward or downward trend. I always double check GAM output by fitting the same model using GLM or another non-linear model. For instance, I fit the following model in R
mod1 <- gam(severity ~ s(mean_rh, k = 8) + s(mean_temp, k = 10) + s(mean_ws, k =7) + s(avg_daily_rain, k = 7), family = betar(), data = dat_seasonal)
summary(mod1)
Here is the output:
Formula:
disease_severity ~ s(mean_rh, k = 8) + s(mean_temp, k = 10) +
s(mean_ws, k = 7) + s(avg_daily_rain, k = 7)
Parametric coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -0.1687 0.1374 -1.228 0.219
Approximate significance of smooth terms:
edf Ref.df Chi.sq p-value
s(mean_rh) 1.000 1.000 2.76 0.096633 .
s(mean_temp) 4.231 4.598 74.22 < 2e-16 ***
s(mean_ws) 2.461 2.673 17.53 0.000669 ***
s(avg_daily_rain) 1.000 1.000 49.89 < 2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
R-sq.(adj) = 0.847 Deviance explained = 91.8%
-REML = -29.205 Scale est. = 1 n = 37
The model output suggests that mean_temp
, mean_ws
and avg_daily_rain
are significant, but there is no information on whether the effect is negative or positive.
Here is the plot:
plot(mod1, pages = 1, all.terms = TRUE, rug = TRUE, residuals = TRUE, pch = 1, cex = 1, shade = TRUE, seWithMean = TRUE, shift = coef(mod1)[1])
From the plot it's clear that mean_temp
and avg_daily_rain
have a significant positive effect. But what about mean_ws
? The curve is going up from wind speed up to a wind value of 1.3, and then the curve is almost flat from 1.3 to 1.6. I can only guess that the effect is negative. DHARMa residuals are fine and the gam.check()
output is also okay. Thank you!