I am interested in regressing monthly temperature data on an individual's self-evaluated wellbeing in a panel survey, of the form:
lm(wellbeing ~ temperature + factor(month) + factor(individualID), df)
I know that the relationship is likely to be non-linear, so need to include a quadratic term:
lm(wellbeing ~ temperature + I(temperature factor^2) + (month) + factor(individualID), df)
However, I also know that an individual's wellbeing at any given moment is likely to reflect temperature during the observed month as well as months prior. Therefore I'd like to run a distributed lag model (say with one month's lag) to measure this cumulative effect. In theory, I would simply add last month's value into the regression, though I am unsure if it's feasible to do so if the independent variable is quadratic in nature? Would it simply be:
lm(wellbeing ~ temperature + I(temperature factor^2) + dplyr::lag(temperature) + (month) + factor(individualID), df)
I could also use dLagM to make life easier, though am mainly curious as to whether this type of setup is reasonable? Every reference guide that I've come across deals only with independent variables as non-quadratic terms.
Any help is much appreciated.