It turns out that stress in the workplace really is killing you, taking years off life expectancy in some cases, according to a new study by Harvard and Stanford researchers.

Researchers found that some workers lost six months of their life to work-related stress, while others lost as much as three years of their life.

Participants were divided into 18 different groups defined by race, education and sex. The researchers then used 10 different workplace factors including number of hours worked, health insurance and unemployment to estimate the effect each job had on life expectancy.

They found that the number of years lost to stress varied significantly among different races, educational levels, genders and place of residence. Other factors that came into play were unemployment, layoffs, lack of health insurance and having little control over one's job, reported The Washington Post.

Workers with lower education levels were more likely to take jobs in more stressful work environments.

In general, blacks and Hispanics lost more years to stress than whites, with the most affected being black men with 12 or fewer years of education, noted CNBC.

Those with the highest levels of education had only between five and 10 percent reductions in life due to the demanding workplace practices, compared to 12-19 percent for those with the lowest levels of education, according to the study.

Others researchers have said in the past that people in some areas of the country could lose up to 33 years of life due to stress, according to CBS.

The study was published in the October issue of the journal Health Affairs.