There is a life-expectancy gap in America. One report, using actuarial data, found that white-collar workers live longer than blue-collar workers. Another study confirmed this, finding that high-income workers have longer life expectancy than low-income ones. Does the the kind of job someone has contribute to, or detract from, their longevity? And, if so, how?

A new study that looks at the effects of workplace stress on the human lifespan offers a possible explanation. Working from the premise that better-paid jobs are associated with better health outcomes, a team of researchers from Harvard Business School and Stanford University used data from the General Social Survey and the American Community Survey to measure harmful workplace conditions’ influence on disparities in life expectancy. To calculate the stressfulness of a given workplace, they considered the probability of getting laid off, the length of working hours, the option to have employer-provided health insurance, and several other proxies.

The study found that stressful workplaces did make it more likely for workers to die earlier, although the size of the effect differed based on race and educational background. The effect was smaller for well-educated people: Five to 10 percent of their mortality was associated with exposure to these stressful workplace factors, whereas for those with less schooling the effect was between 12 and 19 percent.

White people had the lowest loss in life expectancy as a result of workplace stress, but there were exceptions when the data was broken down by gender and education: The life spans of Hispanic women with a college degree weren’t as diminished by workplace stress as those of white women with the same educational background were. (This is consistent with research about the longevity of Hispanic women in the U.S., who have the longest life expectancy of any group—83.7 years.)

But for all demographic groups, two particular career-related things played the biggest part in shortening lifespans: having been unemployed (at any time) and lacking of health insurance. “The results suggest that policies to encourage healthier psychosocial work environments, especially for jobs likely to be held by the most disadvantaged demographic groups,” wrote the authors, “should be seriously considered as part of any comprehensive strategy that aims to reduce the extent of these health inequalities.”