Suicide rates in the U.S. have gone up considerably in recent years, claiming an average of 36,000 lives annually.

Most people take their lives in or near home. But suicide on the job is also increasing and, according to federal researchers, suicide risk changes depending on the type of work people do.

Researchers from the National Institute for Occupational Safety and Health analyzed census data and compared suicide rates among different occupations.

They found that, between 2003 and 2010, a total of 1,719 people died by suicide in the workplace. Rates of suicide on the job declined from 1.5 per million workers in 2003 to 1.2 per million in 2007. Then the rate climbed to 1.8 per million in 2010.

Overall, men were more likely to take their lives than women. And older workers, those between the ages of 65 and 74, were more likely to commit suicide than their younger counterparts.

The study findings are being published by the American Journal of Preventive Medicine.

Why do some people choose the workplace to take their lives? Researchers don't know for sure but suggest that it could be an effort by some to protect family and friends from discovering their deceased body.

Jobs with greatest risk include law enforcement, firefighting and protective services, such as private detectives and security guards. The suicide rate for the group was 1.5 per million workers per year over the study period. The vast majority of these suicides (84 percent) involved firearms. Easy access to guns for some and the high stress in these jobs may both play roles in the workers' decisions about suicide.

Researchers say financial woes and social isolation may be to blame for an increased suicide risk among workers in farming, fishing and forestry. This occupational group had the second-highest rate of workplace suicide at 5.1 per million.

Workers at car repair shops also face an elevated risk, due in part to chronic long-term exposure to toxic chemicals and solvents that could result in memory impairment, irritability, depressive symptoms, emotional instability and brain damage, all risk factors for suicide.

Medical doctors are also at risk. And again, it's suspected that easy access to the means of suicide plays a role. In the case of doctors, the culprit is lethal medications.

In this analysis, suicide within the military was excluded since those deaths are tracked differently by the Department of Defense and the Veterans Affairs.

Copyright 2016 NPR. To see more, visit http://www.npr.org/.