# testing for difference of differences

Suppose we have two samples (A and B) of 200 people each. There are 100 men and 100 women in each population.

The income difference between men and women in A is 1000 dollars (per month). The difference in income between men and women in B is 500 dollars. (both differences are statistically significant)

Under what conditions (and via what kind of tests) can we say that the difference in income between men and women in A is significantly different from the difference in income in group B?

Sorry for a very naive question. Any hint/point to the right direction will be welcome.

• Do you have the full populations? If you do, there there is no notion of statistical significance; either the values are the same or different, and you know that with certainty.
– Dave
Aug 16, 2021 at 14:11
• thanks for your comment. Nope, these are samples drawn from two different populations (A* and B* correspondingly) Aug 16, 2021 at 14:12
• Perhaps you should change your phrasing in the question to reflect the fact that you have samples, not populations.
– Dave
Aug 16, 2021 at 14:13
• thanks! I just did it Aug 16, 2021 at 14:14

Say that we denote salaries as $$x$$, and assume that in each population the indices 1-100 are for women and 101-200 are for men. That is, for each population we can define 100 variables of the form $$g_i=x_{100+i}-x_{i}$$, so the wage gap for population A as $$\bar{g}_A=1000$$ and for population B as $$\bar{g}_B=500$$. From here on it's straightforward two-sample t-test:

1. Calculate $$s^2_A=Var(g_A)$$ and $$s^2_B=Var(g_B)$$, the wage gap variance for each population
2. Find the pooled variance, $$s_p^2=(s_1^2+s_2^2)/2$$
3. The test statistic is

$$t=\frac{\bar{g}_A-\bar{g}_B}{s_p\sqrt{1/n_A+1/n_B}}=\frac{500}{s_p\sqrt{0.02}}$$

the significance of this result depends on your choice of $$\alpha$$, note that you should use 100+100-2=198 degrees of freedom.

• "result depends on your choice of 𝛼, " - what do you mean by 𝛼 in this case (you haven't referred to it before that). Aug 16, 2021 at 14:53
• If I understand correctly, this method assumes that men and women are paired. For example, you assume value #2 is paired to value #102, when computing g. There is nothing in the problem setup to suggest such pairing. Aug 16, 2021 at 15:05
• @HarveyMotulsky No, there's no such pairing at all. Pairing means two treatments for the same sample, while where I have suggested dividing to pairs just to make it easier to understand the concept of 100 differences out of population of 200 (this still stands, as $\bar{x}_m-\bar{x}_f$ would yield the exact same result as $\bar{g}$). Not all pairs are pairings. Aug 16, 2021 at 20:49
• @PhilippChapkovskievery the result of statistical significance test depends on the significance level chosen $\alpha$. A different $\alpha$ value results in a different critical value, which in turn might change the binary outcome of the test. Aug 16, 2021 at 20:52
• @Spätzle the follow-up question: would it be enough just to test for the significance of interaction term in ANOVA income~group*gender? Aug 18, 2021 at 16:50