# Compare which of two groups is MORE similar to a third group?

I know I can use an ANOVA (+ post-hoc tests) to determine the equality (or inequality) of three groups:

• (i.e., H0: each of 3 means are equal; H A: at least 1 of 3 means is not equal).

However, how do I determine which of 2 group means is more similar to a third group's mean?

Obviously I could do this using arithmetic by comparing the means of each group

• i.e., something like: [(meanA - meanC)] < [(meanB - meanC)],

but I'm looking for a formal statistical test to answer this question.

Update:

A formal hypothesis might look something like:

• H0: [meanA - meanC] = [meanB - meanC]

• HA: [meanA - meanC] > [meanB - meanC]

(However, he hypothesis doesn't necessarily need to take that mathematical form.)

EXAMPLE:

Are the average heights of cherry trees or maple trees closer to the average height of apple trees?

• ANOVA is not used to show equality but rather inequality of group means. As such, the question is not easy to follow. – Michael M Sep 26 '19 at 19:27
• One suggestion I have is the Kullback–Leibler divergence, but it will depend immensely on what you consider similarity to mean. Please elaborate on what you want to be similar. Means? Means and variances? Medians and skewness? Entire distributions? – Dave Sep 26 '19 at 19:27
• @Dave the implicit sense of "similar" in an ANOVA context must be in terms of differences of means. Like Michael M, though, I find it hard to follow this question because it is predicated on a misinterpretation of ANOVA and also because "which of two groups is similar to a third" is ambiguous: exactly what hypothesis is being proposed here? – whuber Sep 26 '19 at 19:49
• @whuber I took the ANOVA comment as an analogy, not that means are the only way that groups 1 and 2 could differ from group 3. Anyway, yes, we definitely need additional clarification about what comparison is interesting. However, what would you think about comparing KL divergences if the question isn't just about similarity of means but of the distributions overall? – Dave Sep 26 '19 at 19:56
• @Dave I have a hard time with KL divergences because--unless I haven't correctly apprehended your proposal--first you need to perform some kind of continuous density estimation based on the data and, without huge amounts of data, I believe the resulting estimates of KL divergences to be unstable and sensitive to the choice of density estimator. I am more inclined to explore with a client which aspect(s) of the distributions are important for their study so we can choose (or develop) procedures suitable for comparing (and discriminating) those particular features. – whuber Sep 26 '19 at 20:03

Some ideas: I will write a formal model in ANOVA style using normal assumptions, but that part can surely be relaxed. So let $$Y_{ij}$$ be independent observations, $$Y_{ij} \sim \mathcal{N}(\mu_i, \sigma^2)$$ for $$j=A,B,C$$, $$i=1, \dotsc, n_j$$. I will measure "similarity" of the distributions by the absolute value of the difference of means, so define $$\delta_A=\mu_A-\mu_C, \delta_B=\mu_B-\mu_C$$ and then our interest or focal parameter as $$\Delta=\delta_A-\delta_B.$$ For a fast solution (which also avoids the normality assumption) I would use bootstrapping to construct a confidence interval for $$\Delta$$. But that assumes a reasonably large sample size. A more principled (and maybe better) solution would be to construct the profile likelihood function for $$\Delta$$, and get a confidence interval from that. See for instance Constructing confidence intervals based on profile likelihood.