Skip to content
Prev 178697 / 398506 Next

Why there is no p-value from likelihood ratio test using anova in GAM model fitting?

The issue isn't really about which order you supply the models to `anova'. The 
problem is that there is no meaningful test to perform with these two models, 
because the  `larger' model has actually been estimated as having a *larger* 
deviance than  the `smaller' model, so there is never going to be any basis 
for preferring the larger model. 

The problem arises in part because these tests are only ever approximate:  
estimation is by penalized likelihood, but the estimates are treated as being  
approximately MLEs. In addition the test is conditional on the smoothing 
parameters, which have actually been estimated (although this is no worse 
than doing any other sort of model selection prior to testing). 

The cleanest solution is perhaps to compare models by (generalized) AIC or 
similar, but if testing is important in this problem then there are a couple 
of alternatives:

1. You  can force your model 2 (the one with SES) to use the same smoothing 
parameters as model 1. (Extract the `sp' vector from the model 1 object and 
feed it into the `sp' argument of `gam' when fitting model 2). This restores 
proper nesting of null and alternative, and improves the test approximations. 

2. You could use the single argument version of `anova' to test whether the 
`SES' term is significantly different from zero. 

However, the message from the fits you have already done is that `SES' is 
doing nothing that can't better be done by the other covariates. 

best,
Simon
On Tuesday 28 April 2009 15:46, willow1980 wrote: