If you’re a single man looking to make a higher salary, get married.

Of course, that’s not exactly how it works. But a recent study on wage and salary income of workers with at least a high school diploma by the Federal Reserve Bank of St. Louis shows that married men earn wages that dominate the other three categories of single men, single women and married women.

Both single men and women make similar wages throughout their careers but for women, getting married does little to improve their wages. In fact, it only exacerbates the gender and wage gap, especially as they get older, according to the chart above.

The study notes:

First, wages tend to increase with age—at least up until age 50. This is presumably because people accumulate human capital as they work and, therefore, become more productive. Second, for both men and women, there is a tendency for wages to decrease in the latter years of their working lives — that is, after age 50. This is probably because, by then, workers devote less effort to accumulating new human capital. Finally, the salary difference between men and women is noticeably less pronounced earlier in life rather than later in life.

The study notes it is tempting to attribute this to the fact that younger women are more likely to get married and then eventually leave their jobs to raise their kids. Once out of the labor force, these women no longer accumulate human capital and so they lose ground relative to their male counterparts.

But things aren’t that simple.

First, there are almost no gender differences in wages among single (that is, never-married) workers: Whether they are men or women, single workers earn very similar wages. Second, married and single women also earn similar wages. This is surprising since married women may be more likely to have children than single women. Thus, this second point is not consistent with the view that the gender wage gap results from women having children earlier in life and losing ground in human capital accumulation relative to men.

So why such the discrepancy between married men and the other three categories? The most likely conclusion is that men with higher wages are more likely to get married, so the average married man earns higher wages than the average single man.

Men often marry later than women, so there are relatively few married men in their 20s. This explains why the difference in wages is less pronounced earlier in life: The average male worker in his 20s is more likely single than married.

The Fed study concludes that asking why women earn less than men — married men, specifically — isn’t enough, and we should really be asking why married men make so much more than everyone else.