I\'m drawing F1/F2 vowel graph (an example is here). Each vowel has several points/values, and I\'d like to draw an ellipse around the points, so that:
require(car)
x=rnorm(100)
y=1+.3*x+.3*rnorm(100)
dataEllipse(x,y, levels=0.80)
So with your data:
with(olm ,dataEllipse(ol.f1, ol.f2, levels=0.8) )
Another package, mixtools, has similar capabilities but uses the alpha level rather than the 1-alpha:
mu <- with(olm, c(mean(ol.f1), mean(ol.f2)) )
sigma <- var(olm) # returns a variance-covariance matrix.
sigma
# ol.f1 ol.f2
#ol.f1 1077.2098 865.9306
#ol.f2 865.9306 2090.2021
require(mixtools)
#Loading required package: mixtools
#Loading required package: boot
# And you get a warning that ellipse from car is masked.
ellipse(mu, sigma, alpha=0.2, npoints = 200, newplot = FALSE)
Which would overlay the earlier plot with the new estimate (which is slightly narrower in this case.