Re: [R] gam error

From: Jannis <bt_jannis_at_yahoo.de>
Date: Thu, 03 Jun 2010 05:32:09 -0700 (PDT)


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

> 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.
>



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. Received on Thu 03 Jun 2010 - 15:01:37 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 03 Jun 2010 - 15:10:26 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive