# confidence ellipses for MDS plot in edgeR?

Is it possible to draw e.g. 95% confidence ellipses around samples from the same group on the results from the plotMDS function under edgeR? If so, how?

• What does the 95% confidence correspond to? MDS doesn’t directly give confidence intervals. Jun 5, 2017 at 17:28
• That depends on whether or not you have a frequentist or bayesian view about confidence intervals. I would expect (from a bayesian interpretation) that the confidence ellipses on a 2D plot would contain 95% of the points that would be expected in a given sample group.
– gringer
Jun 5, 2017 at 21:07
• @gringer Hmm. For a typical experimental setup in NGS, a sample group contains < 10 points. Often < 5. So there’s a lot of uncertainty about the placement of the ellipses based on this. ;-) Jun 6, 2017 at 11:40
• I agree to what @KonradRudolph said. If your group has less < 10 or < 5 , in that case the ellipse criterion might not even hold true or I would not believe in it. First of all MDSplot might not be needed as well for doing the 95% ellipse as well. This link explains pretty well about its use. I am just thinking some times we do a lot of over-estimation or over-calculation of certain statistical measures which for the first choice might not be required. Do you even want to do that? stats.stackexchange.com/questions/217374/… . Jun 6, 2017 at 14:08
• The question assumes that the position on an MDS plot is a population parameter for a population from which each of the samples in the group are drawn from. It assumes that each sample is a point estimate of the population for that group. Under this interpretation, a confidence ellipse is a valid thing. However, i'm not sure position on an MDS plot can be called a population parameter due to the nature of how an MDS plot is constructed (specifcally the position of each sample is not independent of the position of the others). But perhaps some suitable parameter does exist? Jun 6, 2017 at 14:25

I can see that there would be a three step process to doing this:

1. Merge counts from all samples in the group and then resample pseudo-replicates from this. If x is a matrix with samples in the group being columns and genes being rows

s <- sample(row.names(x), n = mean(colSums(x)), probs=rowSums(x)/sum(rowSums(x))
stab <- table(s)
s <- as.vector(stab)
names(s) <- names(stab)


Do this thousands of times.

2. You would then want to project those onto your MDS plot space - i'm less clear about how you could do this without perturbing the space itself.

3. Calculate the parameter for an ellipise that would contain 95% of these points. Again, I'm not so sure about how to do this, but I think the car pacakge might be a good place to start looking.