Is Function of Random Samples of Two Independent Populations I.I.D.? I want to bound the difference between two variables sampled from two different populations. When it's just one population with paired measurements a.k.a. "paired samples" (e.g. before treatment vs after treatment), I simply subtract the paired measurements and use univariate statistical inference. Is there a reason I cannot do the same for independent samples? Say I have two i.i.d. samples $X_1,X_2,...,X_n$ and $Y_1,Y_2,...,Y_m$ with respective cumulative distribution functions $F_X$ and $F_Y$. Of course, if I construct a set from all possible pairwise differences, the set is not i.i.d.; $X_1-Y_1$ and $X_1-Y_2$ are dependent, for example. However, if I construct a set where each random variable from the original two samples only appears in at most one difference, such as ${X_1-Y_1,X_2-Y_2,...,X_{min(n, m)}-Y_{min(n, m)}}$, is that set i.i.d. with cumulative distribution function $F_{X-Y}$? If so, can I then apply univariate statistics to that?
UPDATE: Based on the two methods of constructing a set from two independent samples, I simulated 10,000 confidence intervals for the
median bound by order statistics and 10,000 tolerance intervals bound
by order statistics for the difference between two normal random
variables. I stuck to normal variables because I could derive the median and cdf to test if a particular simulated interval really did contain the median or population proportion. The dependent nXm pairwise differences method yielded intervals that contained the median/proportion far less frequently than the intervals should have for iid samples, which is expected for a non-iid sample, and the min(n,m) differences method contained the median/proportion about as frequently as the interval should have for iid samples. I'm working on a way to do the same for non-normal populations next, but it's clear from this that the n*m non-iid sample wouldn't work for order statistics-based intervals.
 A: In general if a family of $X_i$ are $iid$, then so so are $f(X_i)$. In your case, you're defining a new random variable $Z_i:=X_i-Y_i$, in which case $Z_i$ form an $iid$ sequence. 
A: Briefly, to answer your first sentence: if X and Y are independent, then X-Y has expectation EX-EY, and its variances add only because of independence, so X-Y has variance var(X)+var(Y). You could bound the difference through e.g. Chebyshev's inequality, although these bounds are usually too wide to be of use.
What you are proposing is essentially a calculation of the empirical distribution of X-Y by going over all n by m combinations of X and Y, which also works and might be a bit stronger if you're looking to bound quantiles of the difference, for example. I'm less sure about the finite sample properties of bootstrap though.
Your first example taking all n x m combinations is the 'correct' way to proceed; I don't recommend the second method as you're essentially throwing out potential observations of the bootstrap. Then you can find the $j/(nm)$-th quartile by ordering your $nm$ observations and taking the j-th smallest value. In particular, the number of observations of each $X_i=k$ is directly proportional to the probability density $f_X(k)$, and similarly for $Y_j$, and by independence the probability of observing them both jointly is proportional to the product of the marginals. So you have to go through all n x m combinations to construct the empirical population of $X_i-Y_j$. Your second proposal has a total of m (or n) data points; both methods have the same properties but you're throwing out so much information by doing so. The only reason to do that is if, as you remarked, you have a natural pairing, in which case the difference of $X_i-Y_i$ allows you to cancel out an $i$-level effect, i.e. you have correlation between $X_i$ and $Y_i$.
Also, your use of 'iid' is a bit confused. iid only makes sense if you're talking about random variables; $X_1-Y_1$ and $X_1-Y_2$ aren't random; they're observed because you already have the data on the $X_i,Y_i$. If you have a program that picks a random $X_i$ and $Y_j$ and subtracts them, then that variable $X_i-Y_j$ where there are no restrictions on $i$ or $j$ is iid.
A: Your defined set of differences will be i.i.d.
Regarding the distribution of the differences, you can estimate it using the empirical cdf, non parametrically, if you don't know the underlying distributions. If X and Y are not exceedingly skewed, it will give you a good approximation.
