I'm a medical researcher exploring the association between disease mortality and air pollution using time-series analysis. I'm considering using STL decomposition terms (trend, seasonal, and residual components) in my Generalized Additive Model (GAM) instead of standard calendar time and day-of-week terms. The proposed R code structure is:
gam_model <- gam(target_variable ~ s(trend_component, bs="cr") +
s(seasonal_component, bs="cr") +
s(residual_component, bs="cr") +
other_predictors,
data = data)
As I'm not a statistician, I'm unsure about the validity of this approach. Any insights or opinions would be greatly appreciated.
gam_model <- gam(target_variable ~ s(trend_component, bs="cr") +
s(seasonal_component, bs="cr") +
s(residual_component, bs="cr") +
other_predictors,
data = data)