Hi All:

How would you find out the probability that a point lies within an ellipse?
For eg if I was plotting (x,y) for 300 datasets in an 95% ellipsoid region,
how do I calculate how many times out of 300 will my points fall inside the
ellipse?

Heres the code I am using

library(MASS)
seed<-1234
x<-NULL
k<-20
Sigma2 <- matrix(c(.72,.57,.57,.46),2,2)
Sigma2
rho <- Sigma2[1,2]/sqrt(Sigma2[1,1]*Sigma2[2,2])
rho
eta1<-replicate(300,mvrnorm(k, mu=c(-1.59,-2.44), Sigma2))

library(car)
dataEllipse(eta1[1,],eta1[2,], levels=c(0.05, 0.95))

Thanks for your help.

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org 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.

Reply via email to