First calculate the ellipse, then determine the lengths of the major and minor axes, and then calculate the area.
Here's a brainless approximation.
First, your data.
dat <- structure(list(x = c(1.158362492, 1.1430148, 1.11058971, 1.120573931,
1.149219113, 1.123851641, 1.096910013), y = c(1.322219295, 1.267171728,
1.252853031, 1.260071388, 1.278753601, 1.276461804, 1.222716471
)), .Names = c("x", "y"), class = "data.frame", row.names = c(NA,
-7L))
Then load the package car
; dataEllipse
can be used to calculate an ellipse using a bivariate normal approximation to the data.
require(car)
dataEllipse(dat$x, dat$y, levels=0.5)
A call to ellipse
can give points along the ellipse that dataEllipse
plots.
me <- apply(dat, 2, mean)
v <- var(dat)
rad <- sqrt(2*qf(0.5, 2, nrow(dat)-1))
z <- ellipse(me, v, rad, segments=1001)
We can then calculate the distance from each point on the ellipse to the center.
dist2center <- sqrt(rowSums((t(t(z)-me))^2))
The minimum and maximum of these distances are the half-lengths of the minor and major axes. So we can get the area as follows.
pi*min(dist2center)*max(dist2center)