When I fit a linear mixed-effect model, I would apply the splines function to control for the potential nonlinear association. For example, the model goes like lmer(hypertension~PM2.5+ns(temperature, df= i )+(1|ID), data=mydata). I would like to use the AIC value to select the df of temperature. However, as the df rises, the AIC value of the model drops. It seems like the larger the df is, the better the model is, which really distrubes me.

More Zhaoyuan Li's questions See All
Similar questions and discussions