Hello,
For gam, try model1$aic. The returned value is an object of class
"gam"
as described in ?gamObject.
For gamm, try model$gam$aic. The returned value is a list of two
objects, a "gam" and the return value of "lme" or
"|gammPQL".
See ?gam and ?gamm, the Value section.
Hope this helps,
Rui Barradas
|
Em 22-08-2012 13:00, ritapatricio escreveu:> Dear all,
>
> I am analysing growth data - response variable - using GAM and GAMM models,
> and 4 covariates: mean size, mean capture year, growth interval, having
> tumors vs. not
> The models work fine, and fit the data well, however when I try to compare
> models using AIC I cannot get an AIC value.
>
> This is the code for the gam model:
>
>>
model1=gam(growth_rate~s(sampling_year)+s(growth_interval)+s(mean_SCL)+FP_status,family=quasi(link=identity),method="REML")
>> AIC(model1)
> [1] NA
>
> or:
>>
model2=gam(growth_rate~s(sampling_year)+s(mean_SCL),family=quasi(link=identity),method="REML")
>> AIC(model1,model2)
> df AIC
> model1 13.722861 NA
> model2 9.898634 NA
>
> I have tried several models and AIC always comes as 'NA', can
someone help?
>
> many thanks.
>
> rita patrĂcio
>
>
>
>
>
>
> --
> View this message in context:
http://r.789695.n4.nabble.com/AIC-for-GAM-models-tp4640972.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
[[alternative HTML version deleted]]