Re: [R] Help with random effects and smoothing splines in GAMM

From: Spencer Graves <spencer.graves_at_pdf.com>
Date: Sun 29 Oct 2006 - 22:07:02 GMT

      Your "random" specification 'list(x=~1, s(z,bs="cr")=~1)' generates for me a "syntax" error. To understand it, please see the documentation for 'list'. The help file for 'list' says, "The arguments to |list| or |pairlist| are of the form |value| or |tag=value|", and I believe that 'tag' must be a legal R name. In your 'random' specification, R wants to interpret 's(z, bs="cr")' as a 'tag'. This generates a 'syntax error', because it is not a legal R name. To see how to get around this, I suggest you work through all the examples in the 'gamm' help file. If that is not adequate, I suggest you also review the 'gamm' article in the June 2001 issue of R News (vol. 1/2, available from www.r-project.org -> Documentation: Newsletter).

      If you want more help from this listserve, please provide commented, minimal, self-contained, reproducible code, as suggested in the posting guide "www.R-project.org/posting-guide.html". Your example was not self contained.

      Hope this helps. 
      Spencer Graves

Liang, Hua wrote:
> Try to fit a longitudinal dataset using generalized mixed effects models
> via the R function gamm() as follows:
>
>
>
> library(mgcv)
>
> gamm0.fit<- gamm(y ~ x+s(z,bs="cr"),
>
> random=list(
>
> x=~1,
>
> s(z,bs="cr")=~1
>
> ),
>
> family = binomial, data =raw)
>
> the data is given by raw=(id, y,x,z). It doesn't work. If you can tell
> me how to fix this problem, it will be appreciated.
>
>
>
>
>
>
>
>
>
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@stat.math.ethz.ch 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@stat.math.ethz.ch 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 Mon Oct 30 09:14:29 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sun 29 Oct 2006 - 22:30:15 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.