Skip to content
Back to formatted view

Raw Message

Message-ID: <23277778.post@talk.nabble.com>
Date: 2009-04-28T14:04:31Z
From: Ben Bolker
Subject: Why there is no p-value from likelihood ratio test using anova in GAM model fitting?
In-Reply-To: <23277535.post@talk.nabble.com>

willow1980 wrote:
> 
> Hi, Dieter,
> I did add (test="F") in my script, but it does not matter. The following
> is my whole script.
> 
> #################################################################
> modelsurs_fer13<-gam(sum_surv15~s(FLBS)+SES+s(byear)+s(FLBS,byear),family=quasipoisson)
> modelsurs_fer14<-gam(sum_surv15~s(FLBS)+s(byear)+s(FLBS,byear),family=quasipoisson)
> anova.gam(modelsurs_fer14,modelsurs_fer13,test="F")
> #################################################################
> 
> Would you please make further suggestions? Thank you in advance!
> Jianghua
> 
> 

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

-- 
View this message in context: http://www.nabble.com/Why-there-is-no-p-value-from-likelihood-ratio-test-using-anova-in-GAM-model-fitting--tp23275224p23277778.html
Sent from the R help mailing list archive at Nabble.com.