Within two years of having a heart attack, nearly 1 in 5 people stop taking lifesaving cholesterol-lowering drugs known as statins, according to a new study. And nearly 2 in 5 end up taking the drugs in lower doses or less often than they should, researchers report in JAMA Cardiology.

“From a societal perspective, we need to make sure the highest-risk individuals are being treated with guideline-directed therapy,” said senior author Robert Rosenson, a professor of cardiology at the Icahn School of Medicine at Mount Sinai in New York.

Rosenson and colleagues write that guidelines from the American College of Cardiology and the American Heart Association (ACC/AHA) recommend high-intensity statins for people age 75 and younger who have coronary heart disease. The pills help prevent cardiovascular events.

Statins include medications such as Lipitor, sold generically as atorvastatin, and Crestor, also known as rosuvastatin. They work by inhibiting the production of cholesterol in the liver.

Rosenson said his team had previously found low use of high-intensity statins in heart-attack survivors. The new study aimed to find out what traits were associated with discontinuing or reducing these drugs.

The researchers analyzed data collected from 57,898 people age 66 and older who had been hospitalized for a heart attack between 2007 and 2012. They had all filled a prescription for a high-intensity statin within 30 days of leaving the hospital.

After six months, about 59 percent of people age 66 to 75 continued to regularly take their high-intensity statin. About 9 percent switched to a lower dose. About another 17 percent took the medications irregularly, and about 12 percent stopped taking the drugs altogether.

After two years, only about 42 percent were regularly taking their statins. About 13 percent had switched to a lower dose. About 19 percent were taking the drugs infrequently and another 19 percent had stopped the drugs altogether.

The researchers saw similar results for people 75 and older, for whom the ACC/AHA guidelines generally recommend a slightly lower dose of statins. African Americans and Hispanics, and those taking statins for the first time, were less likely than others to take their medication regularly.

People were more likely to regularly take their statins if they saw their cardiologists often, took part in cardiac rehabilitation programs or were enrolled in Medicaid, the health insurance program for low-income people that is administered by states and the federal government.

The researchers conclude that lower costs, more cardiologist visits and cardiac rehabilitation may boost the number of people staying on high-intensity statins and ultimately reduce the risk of repeat heart attacks.

Rosenson noted that statins are available in less expensive generic forms as well as under brand labels. “You can’t say that cost accounts for all of this,” he said.

People should know that statins have benefits beyond lowering low-density lipoprotein (LDL), also known as “bad” cholesterol, he said. They also have anti-inflammatory benefits.

“I think what the public needs to know is: Discontinuing or down-titrating your statins is associated with a greater risk of having a second heart attack and being in the hospital with a cardiovascular event that may result in a procedure that results in higher health-care cost for them and the entire public,” he said.