[R] help: trouble using lines()

Simon Pickett S.Pickett at exeter.ac.uk
Thu Aug 24 14:43:18 CEST 2006


Hi R experts,
I have been using ReML as follows...
model<-lmer(late.growth~mtf+year+treat+hatch.day+hatch.day:year+hatch.day:treat+
mtf:treat+ treat:year+ year:treat:mtf+(1|fybrood), data = A)
then I wanted to plot the results of the three way interaction using
lines() as follows...

tmp<-as.vector(fixef(model))
graph1<-plot(mtf,fitted(f2), xlab=list("Brood Size"), ylab=list("Early
growth rate"), pch=16, col="darkgrey", bg="yellow")
lines(y,exp(tmp[1]+tmp[2]))

but no matter what I try I always get the error message
"Error in xy.coords(x, y) : 'x' and 'y' lengths differ"

Can anyone shed some light please?
I am basically copying the methods of the pdf entitled "Linear mixed
models in R" by Søren Feodor Nielsen 20003.
http://cran.r-project.org/doc/contrib/Fox-Companion/appendix-mixed-models.pdf#search=%22Linear%20mixed%20models%20in%20R%22





Simon Pickett
PhD student
Centre For Ecology and Conservation
Tremough Campus
University of Exeter in Cornwall
TR109EZ
Tel 01326371852



More information about the R-help mailing list