Package 'nlme' linear mixed effects model error "unexpected symbol"

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Package 'nlme' linear mixed effects model error "unexpected symbol"

msherwood
I am trying the following code with the 'nlme' package:

2007model<lme(Rank~Age*Mass+method='ML',random=~1|ID,na.action=na.exclude)

I've also tried all kinds of variations of the above that I could think of.

It gives me the error "unexpected symbol in '2007model' ". I'm not sure if this 'unexpected symbol' refers to the code I enter or the data table I am using.

I haven't found any useful information in a Google search or in the R help files.

Any suggestions of what the problem may be?



Reply | Threaded
Open this post in threaded view
|

Re: Package 'nlme' linear mixed effects model error "unexpected symbol"

Michael Weylandt
Variable names cannot start with numbers: [well, there's a way, but
it's not a good idea] Instead you want

model2007 <- lme(....)

Also, probably need an arrow "<-" instead of a less than symbol.

Michael

On Wed, Jul 25, 2012 at 4:43 PM, msherwood <[hidden email]> wrote:

> I am trying the following code with the 'nlme' package:
>
> 2007model<lme(Rank~Age*Mass+method='ML',random=~1|ID,na.action=na.exclude)
>
> I've also tried all kinds of variations of the above that I could think of.
>
> It gives me the error "unexpected symbol in '2007model' ". I'm not sure if
> this 'unexpected symbol' refers to the code I enter or the data table I am
> using.
>
> I haven't found any useful information in a Google search or in the R help
> files.
>
> Any suggestions of what the problem may be?
>
>
>
>
>
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Package-nlme-linear-mixed-effects-model-error-unexpected-symbol-tp4637842.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> [hidden email] 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.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Package 'nlme' linear mixed effects model error "unexpected symbol"

Steve Taylor
In reply to this post by msherwood
This will work:
model2007 <-

You can't start an identifier with a digit.

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of msherwood
Sent: Thursday, 26 July 2012 9:44a
To: [hidden email]
Subject: [R] Package 'nlme' linear mixed effects model error "unexpected symbol"

I am trying the following code with the 'nlme' package:

2007model<lme(Rank~Age*Mass+method='ML',random=~1|ID,na.action=na.exclude)

I've also tried all kinds of variations of the above that I could think of.

It gives me the error "unexpected symbol in '2007model' ". I'm not sure if
this 'unexpected symbol' refers to the code I enter or the data table I am
using.

I haven't found any useful information in a Google search or in the R help
files.

Any suggestions of what the problem may be?







--
View this message in context: http://r.789695.n4.nabble.com/Package-nlme-linear-mixed-effects-model-error-unexpected-symbol-tp4637842.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
[hidden email] 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.

______________________________________________
[hidden email] 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.