question about confidence ellipses

776 views
Skip to first unread message

Justin Touchon

unread,
Aug 8, 2013, 3:13:47 PM8/8/13
to factomin...@googlegroups.com
Hi Francois and other FactoMineR users,

I have a question about how the confidence ellipses are calculated in plotellipses and coord.ellipse.  I am running a PCA of the parameters of different frog calls (to discriminate 5 different species) and would like to plot the confidence ellipses around the centroid.  plotellipses does a nice job, but when I used coord.ellipses, which I assumed would do the same thing but simply return the points used to make the ellipses I got something very different.  See the attached plot -  the colored lines are those drawn automatically by plotellipses, and the black circles are the coordinates returned from coord.ellipse, which are obviously much larger.  Both are supposed to be 95% CI based on the documentation.  

The code I used is simple and the sample.frogcall data should be attached.  

fc.PCA<-PCA(sample.frogcall,quali.sup=12)

plotellipses(fc.PCA)

points(coord.ellipse(cbind.data.frame(sample.frogcall[,12],fc.PCA$ind$coord))$res[,2:3], cex=.5)


Thanks for any insight into this.  Saludos,

Justin


sample.frogcall.csv

Julie Josse

unread,
Aug 8, 2013, 3:20:35 PM8/8/13
to factomin...@googlegroups.com
Hi Justin,
What is on your code the $res[,2:3]?
Best,
Julie.

Thanks for any insight into this.  Saludos,

Justin


--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes FactoMineR users.
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse factominer-use...@googlegroups.com.
Pour plus d'options, visitez le site https://groups.google.com/groups/opt_out .
 
 

Justin Touchon

unread,
Aug 8, 2013, 3:32:40 PM8/8/13
to factomin...@googlegroups.com
Hi Julie,

coord.ellipse returns a list containing two things, one of which is "res" (maybe "response"?) which contains the coordinates of the outlines of the ellipses.  Thus, the $res[,2:3] is just calling the 2nd and 3rd columns, which are the x and y coordinates.

Justin

Julie Josse

unread,
Aug 8, 2013, 3:35:41 PM8/8/13
to factomin...@googlegroups.com
have you checked as in the ex?

data(decathlon)
res.pca <- PCA(decathlon, quanti.sup = 11:12, quali.sup = 13,graph=FALSE)
aa <- cbind.data.frame(decathlon[,13],res.pca$ind$coord)
bb <- coord.ellipse(aa,bary=TRUE)
plot.PCA(res.pca,habillage=13,ellipse=bb)

## To automatically draw ellipses around the barycentres of all the categorical variables
plotellipses(res.pca)

Justin Touchon

unread,
Aug 8, 2013, 3:56:30 PM8/8/13
to factomin...@googlegroups.com
Hi Julie,

So the difference is in the "bary" argument.  If bary=T, you get small ellipses, if bary=F, they are huge.  That explains that, but that brings up another question: if one was trying to plot a 95% confidence ellipse, would you use the barycentric scaling or not?  Obviously the example shows how to do that, and that is what plotellipses is doing automatically, but what is the rationale behind one or the other?  This is the first time I've ever run into that term so I'm just trying to understand what is going on with it.  Thanks,

Justin

François Husson

unread,
Aug 12, 2013, 9:23:51 AM8/12/13
to factomin...@googlegroups.com
Hi Justin,

The argument bary=TRUE means that you draw a confidence ellipse around the mean point of the category whereas bary=FALSE means that you draw a confidence ellipse around the points that take the category. So the confidence ellipse is larger in the latter case.

FH

Justin Touchon

unread,
Aug 15, 2013, 2:11:39 PM8/15/13
to factomin...@googlegroups.com
Thanks François.  

antjeg...@gmail.com

unread,
Aug 20, 2013, 8:18:33 AM8/20/13
to factomin...@googlegroups.com
Dear François,

I think this discussion is very interesting as I was also wondering what the rational is behind the different values for the "means" argument in the plotellipse command. Choosing TRUE or FALSE of course results in different confidence ellipses, but I would like to know what the difference in meaning is. And which one is the more "reliable" when it comes to distinguishing predefined groups from each other?

Best regards and thanks for your opinion,
Antje

Rob Timans

unread,
Feb 28, 2014, 2:05:09 PM2/28/14
to factomin...@googlegroups.com
Dear All,

I know this discussion has been dormant for a while, but I landed here wondering about the possibility to draw concentration ellipses in a (specific) MCA. Would it be safe to say that drawing a confidence ellipse with the bary=FALSE argument amounts to actually drawing a concentration ellipse around the individuals who chose that category?

Thanks in advance for replying,

Best regards,
Rob 
Reply all
Reply to author
Forward
0 new messages