[R] calculating/plotting error ellipses

bbolker bolker at ufl.edu
Mon Sep 24 19:12:47 CEST 2007




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


-- 
View this message in context: http://www.nabble.com/calculating-plotting-error-ellipses-tf4509082.html#a12864033
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list