lme code help

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

lme code help

harkiran
Hi guys,

Got a few days left and I need to model a random effect of species on the body mass (logM) and temperature (K) slopes. This is what i've done so far that works:
model1<-lme(logSSP~logM + K,random=~1|species,data=data1)
model2<-lme(logSSP~logM + K,random=~K|species,data=data1)
model3<-lme(logSSP~logM + K,random=~logM|species,data=data1)

The one I now want is:
model4<-lme(logSSP~logM + K,random=~logM|species,K|species,data=data1)
#I need the random effect of spp on both slopes of logM and K, but this code doesn't work so how do i change the code??????

:( Any help will be greatly appreciated

Reply | Threaded
Open this post in threaded view
|

Re: lme code help

Thierry Onkelinx
You want lme(logSSP~logM + K,random=~logM + K|species,data=data1)

Best regards,

ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium
+ 32 2 525 02 51
+ 32 54 43 61 85
[hidden email]
www.inbo.be

To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of.
~ Sir Ronald Aylmer Fisher

The plural of anecdote is not data.
~ Roger Brinner

The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey


-----Oorspronkelijk bericht-----
Van: [hidden email] [mailto:[hidden email]] Namens harkiran
Verzonden: woensdag 14 maart 2012 21:13
Aan: [hidden email]
Onderwerp: [R] lme code help

Hi guys,

Got a few days left and I need to model a random effect of species on the body mass (logM) and temperature (K) slopes. This is what i've done so far that works:
model1<-lme(logSSP~logM + K,random=~1|species,data=data1) model2<-lme(logSSP~logM + K,random=~K|species,data=data1) model3<-lme(logSSP~logM + K,random=~logM|species,data=data1)

The one I now want is:
model4<-lme(logSSP~logM + K,random=~logM|species,K|species,data=data1)
#I need the random effect of spp on both slopes of logM and K, but this code doesn't work so how do i change the code??????

:( Any help will be greatly appreciated



--
View this message in context: http://r.789695.n4.nabble.com/lme-code-help-tp4473008p4473008.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.