# The X quantile of the difference between two RV's

To first provide some context, I have two boxplots (displaying median, 25th, and 75th percentiles), and I'm wondering what a boxplot of the difference between these two boxplots would look like. The random variables (RV's) aren't necessarily distributed normally. Specifically, the "random variables" are samples from posterior distributions, but I think my question is ultimately pretty generic.

Since I have many samples from these 2 RV's, one way to do this would be to compute the differences between randomized pairings, then compute the quantile of interest from these differences. Because my statistical terminology might be flawed, let me say this in the R language:

X <- rnorm(10, 1000) # The first RV, a numeric vector of length 1000
Y <- rnorm(20, 1000) # The second RV
Qs <- quantile(X-Y, probs=c(0.25, 0.5, 0.75) #The quantiles of their difference


However, I was wondering if there could be a way to compute the quantile of the difference between these RV's without going back to the original data. For example, from some combination of summary statistics (means, medians, variances, other quantiles, etc) computed from X and Y.

An example of something that does not give the correct answer, but which might shed light onto what I'm looking for:

wrong_Qs <- quantile(X, probs=c(0.25, 0.5, 0.75)) - quantile(Y, probs=c(0.25, 0.5, 0.75))


I am looking for something akin to the formulas for the propagation of uncertainty (variance) , but I haven't found anything yet.

• What it looks like depends on the joint distribution of the two variables, something you can't infer from the full marginals, let alone what's effectively a 5-number summary of them (the boxplot). – Glen_b Aug 12 '13 at 2:23

Here is a simple example: Values $X = 1,2,3,4,5$ and $Y = 5,4,3,2,1$ produce the same box plot, but the differences are $4,2,0,-2,-4$. Let $Z$ be another copy of either $X$ or $Y$; then necessarily the differences between $X$ and $Z$ or $Y$ and $Z$ are $0,0,0,0,0$.