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.

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:

*

*Calculate $s^2_A=Var(g_A)$ and $s^2_B=Var(g_B)$, the wage gap variance for each population

*Find the pooled variance, $s_p^2=(s_1^2+s_2^2)/2$

*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.
