[R] predict.nlme

elena01 elena.hamann at yahoo.fr
Fri Mar 18 11:00:56 CET 2011


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)
attach(MEN)
lme1<-lme(log(MASS_S)~log(MASS_F)*TREAT, random=~1|INDIV)
summary(lme1)
anova.lme(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.



More information about the R-help mailing list