[R] calculating/plotting error ellipses
Jan M. Wiener
jan.wiener at tuebingen.mpg.de
Tue Sep 25 11:13:58 CEST 2007
Hello,
thank you very much for the quick answer.
This works well. it draws a nice ellipse in the right orientation.
However, I doubt that the ellipse represents the 95% confidence
interval, even if that is the standard-parameter for level is .95. The
ellipse surely is to large?
Any further help would be greatly appreciated.
Best,
Jan
bbolker wrote:
>
> Jan M. Wiener wrote:
>
>> hello,
>> sorry for posting what may be a simple question:
>> i do have a matrix of coordinates (positional judgments, see below) and
>> now want to calculate and plot the corresponding error ellipse.
>> can anyone help me with the exact steps/syntax?
>>
>>
>
> Something along the lines of:
>
> m = colMeans(xyDat) # calc. column means
> v = var(xyDat) # compute var-cov matrix
> library(ellipse) # you may need install.packages("ellipse")
> first
> plot(ellipse(v,centre=m),type="l") ## draw the confidence ellipse
> points(m[,1],m[,2]) # add the cent(re|er) point
>
> Of course, I haven't actually tested this ...
>
> Ben Bolker
>
>
More information about the R-help
mailing list