Skip to content

gam

2 messages · Mahnaz Rabbaniha, Bob OHara

#
Dear all

i have done GAM for data ( they are non- normal and i find regression
between Sillaginidae with several hydrological factors),i done :

[1] "depth"        "temperature"  "salinity"     "Sillaginidae"

 > pairs(sc,panel=function(x,y){points(x,y);lines(lowess(x,y))})
but i take this message:

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


please help me what can i do? or what is meaning this sentence?

thanks


Mahnaz
#
On 05/17/2012 06:17 PM, Mahnaz Rabbaniha wrote:
It means that you don't have a lot of different values for one of your 
covariates. You can check which with

length(unique(depth))
length(unique(temperature))
length(unique(salinity))

Unless you have a lot of data, that the sensible thing to is probably to 
fit a straight line rather than a smooth curve. The other thing to do is 
to define the maximum flexibility of the curve, e.g.

model<-gam(Sillaginidae~s(temperature, k=6)+s(salinity)+s(depth))

I hope this helps.

Bob