[R] help: trouble using lines()

Simon Pickett S.Pickett at exeter.ac.uk
Thu Aug 24 15:52:09 CEST 2006


Hi, thanks for replying.
No, there arent any NA's in the original data set....
I think I must be mis-interpreting the use of lines()?
in the example what exactly is "y"?
lines(y,exp(tmp[1]+tmp[2]))
In my case tmp[1] and tmp[2] are coeficients from the model so just one
number (not a vector) and I havent specified y....
Thanks everyone,
Simon


> Hi
>
> not sure but are there some NA values in your data?
>
> what
>
> length(mtf)
> and
> length(fitted(f2))
>
> tells you?
>
> And you need not to use assignment
>
> graph1 <- plot(....)
>
> to output a plot on screen.
>
>
> HTH
> Petr
>
>
> On 24 Aug 2006 at 13:43, Simon Pickett wrote:
>
> Date sent:      	Thu, 24 Aug 2006 13:43:18 +0100 (BST)
> From:           	"Simon Pickett" <S.Pickett at exeter.ac.uk>
> To:             	R-help at stat.math.ethz.ch
> Subject:        	[R] help: trouble using lines()
>
>> 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-mod
>> els.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
>>
>> ______________________________________________
>> R-help at stat.math.ethz.ch 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.
>
> Petr Pikal
> petr.pikal at precheza.cz
>
>


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