Skip to content
Prev 178673 / 398506 Next

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

willow1980 wrote:
We can't make further suggestions until you (1) provide the output of
sessionInfo() ;
(2) provide a reproducible example.

The following example works for me:

library(mgcv)
example(anova.gam)
b1 <- gam(y~x0+s(x1)+s(x2),family=quasipoisson,data=dat)
b2 <- gam(y~x0+s(x1),family=quasipoisson,data=dat)
anova.gam(b1,b2,test="F")


Analysis of Deviance Table

Model 1: y ~ x0 + s(x1) + s(x2)
Model 2: y ~ x0 + s(x1)
  Resid. Df Resid. Dev       Df Deviance      F    Pr(>F)    
1  187.9672     83.684                                       
2  194.2014    226.042  -6.2342 -142.358 51.291 < 2.2e-16 ***

  Unless you can provide us with an example that _will not work_
when we run it, it will be hard for us to help you.

  Ben Bolker