[R] Error message in GAM

=?utf-8?B?RnJhbmNlc2MgTW9udGFu6Q==?= francesc.montane at ctfc.es
Wed Oct 17 19:03:42 CEST 2007


Hello useRs!

I have % cover data for different plant species in 300 plots, and I use
the ARCSINE transformation (to deal with % cover data).
When I use a GLM I do not have any problem.
But when I am trying to use a GAM model using mgcv package, to account for
non-linearity I get an “error message”.

I use the following model:

sp1.gam<-gam(asin(sqrt(0.01*SP1COVER))~ s(asin(sqrt(0.01*SP2COVER)))+
s(asin(sqrt(0.01*SP3COVER)))+ s(asin(sqrt(0.01*SP4COVER)))+
s(asin(sqrt(0.01*SP5COVER))), family=gaussian, data=plantcover,
na.action=na.pass)

The error message is the following:

"Error in smooth.construct.tp.smooth.spec(object, data, knots) :
A term has fewer unique covariate combinations than specified maximum
degrees of freedom"

It seems that some variables in the model give problems,…What is the
reason of this error message?
What I do is trying to erase randomly some of the variables (those that I
expect to have more zeros) in the model (for instance run the same model
without the SP5COVER term) and try if I get the error message again or
not,… but this is time consuming.
What can I do?

Thanks!

Francesc



More information about the R-help mailing list