Hi,
I need further help with my GAMs. Most models I test are very
obviously non-linear. Yet, to be on the safe side, I report the
significance of the smooth (default output of mgcv's summary.gam) and
confirm it deviates significantly from linearity.
I do the latter by fitting a second model where the same predictor is
entered without the s(), and then use anova.gam to compare the two. I
thought this was the equivalent of the default output of anova.gam
using package gam instead of mgcv.
I wonder if this procedure is correct because one of my models
appears to be linear. In fact mgcv estimates df to be exactly 1.0 so
I could have stopped there. However I inadvertently repeated the
procedure outlined above. I would have thought in this case the
anova.gam comparing the smooth and the linear fit would for sure have
been not significant. To my surprise, P was 6.18e-09!
Am I doing something wrong when I attempt to confirm the non-
parametric part a smoother is significant? Here is my example case
where the relationship does appear to be linear:
library(mgcv)