[R] predict.nlme

From: elena01 <elena.hamann_at_yahoo.fr>
Date: Fri, 18 Mar 2011 03:00:56 -0700 (PDT)

Hi folks,

I am having trouble to plot a mixed model analysis of covariance (ANCOVA). To do so I use the function predict in nlme but the line that is being drawn is totally out of control!!!
here is my script (where MASS_S is dry mass and MASS_F is fresh mass):

MEN<-read.table("Mentha_lme2.txt", h=T)
lme1<-lme(log(MASS_S)~log(MASS_F)*TREAT, random=~1|INDIV) summary(lme1)
plot(log(MASS_F), log(MASS_S), type="n")

points((log(MASS_F)[TREAT=="A"]), (log(MASS_S)[TREAT=="A"]), pch=16, col=1)
points((log(MASS_F)[TREAT=="B"]), (log(MASS_S)[TREAT=="B"]))
lines(log(MASS_F)[TREAT=="A"], predict(lme1)[TREAT=="A"])
lines(log(MASS_F)[TREAT=="B"], predict(lme1)[TREAT=="B"], lty=3)

Instead of drawing a nice line through my points, a big mess comes out on my plot... Is it because the function predict works differently with nlme or can it come from an other problem???

Please help!!! thanks in advance.

View this message in context: http://r.789695.n4.nabble.com/predict-nlme-tp3386760p3386760.html
Sent from the R help mailing list archive at Nabble.com.

R-help_at_r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Fri 18 Mar 2011 - 10:43:01 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 Fri 18 Mar 2011 - 10:50:22 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