[R] gam error

Jannis
Thu, 03 Jun 2010 12:32:09 -0000

How many datapoints do you have? The spline smoothers assume a default of 10
degrees of freedom (i think), so If you have less datapoints than 10 I would
guess that you get this error. Same would be true if you have >10 datapoints
but many replicates of CoT~incline combinations.

Either reduce the degrees of freedom of the smoother or gather more data ;-).

I would not be too sure about the sense of fitting univariate gams....There
should be not too much of a difference to just plotting CoT~incline and fitting
some spline to it ( i might be wrong here!)

HTH
Jannis

--- natalieh <fbsnch at leeds.ac.uk> schrieb am Do, 3.6.2010:

> Von: natalieh <fbsnch at leeds.ac.uk>
> Betreff: [R] gam error
> An: r-help at r-project.org
> Datum: Donnerstag, 3. Juni, 2010 11:24 Uhr
>
> Hi all,
>
> I'm trying to use a gam (mgcv package) to analyse some data
> with a roughly U
> shaped curve. My model is very simple with just one
> explanatory variable:
>
> m1<-gam(CoT~s(incline))
>
> However I just keep getting the error 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"
>
> Just wondering if anyone had come across this before/ could
> offer any advice
> on where the problem might lie
>
> Many thanks,
>
> Natalie
>
>
>
> --
> View this message in context:
http://r.789695.n4.nabble.com/gam-error-tp2241518p2241518.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at 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.
>