Quantifying the 'agreement' between the distribution of age in two populations I have a set of patients, of which a subset are 'enrolled' patients who were included into a study (the study population). For all the patients I have some limited data, including their age at the time of the study.
In order to demonstrate the characteristics of our study population and compare it with the whole population, I produced the following density plot:

I quite like this plot, however I would also like to quantify the level of 'agreement' between the two populations in terms of the distribution of age. What measure would be appropriate?
 A: Note:you can't really "Quantify" the difference between two distributions because that would require evaluation of the difference in all the various parameters, moments, quantiles etc. Putting all that into one measure isn't possible.
However a test exists to determine whether an assumption of equal distribution should be rejected. That is the K-S test.
The non parametric Kolomogorov-smirnov test would work well here. It test for any differences in the distributions(F(X) and F(Y)) of any 2 random variables X and Y. 
Step1: the hypotheses
The null is
$$H_0: F(X) = G(Y)$$
and a general alternative hypothesis $$H_1: F(X) ≠ G(Y) $$
The test will depend on the empirical distributions of the observed $X$ and $Y$
step 2: The test statistic
the test statistic used is :
$$J=\frac{mn}{d} max_{i=1,2...N}(|F_m(Z_{(i )}) − G_n (Z_{(i )})|)$$
$where:$
$m$ is the sample size of $X$
$n$ is the sample size of $Y$
$d$ = GCD of $m$ and $n$
$N=n+m$
$Z_{(i)}$ is the combined ordered sample of $X$ and $Y$ and 
$F_{t}(k)$ is the empirical distribution
As with all hypothesis test there is a critical value (based on a chosen significance level) which is denoted by $J_{\alpha}$ which can be obtained from the software used
The decision rule
The null is rejected if $J$ $>$ $J_{\alpha}$
PS


*

*When there are ties in the data the test statistic will need some adjustment


The reference book is Wiley's Series in Probability and Statistics: Non parametric statistics
