# Generate some bivariate normal data in three groups with different means
# Means (1,0), (0,1) and (0,0)
means <- matrix(c(1,0,0,1,0,0), ncol=3)
data <- matrix(nrow=300, ncol=2)
groups <- sample(rep(c(1,2,3), 100))
for(i in 1:300) data[i,] <- rnorm(c(1,1), mean=means[,groups[i]])
# Plot confidence ellipses with shading
CIplot_biv(data[,1], data[,2], group=groups, shade=TRUE)
Run the code above in your browser using DataLab