TUESDAY, Feb. 28, 2017 (HealthDay News) -- When it comes to sleeping pill prescriptions, doctors often stick to the same old routine, a new study suggests.

"Our results illuminate the notion that just as everyone else, many physicians are creatures of habit who tend to rely on cognitive shortcuts in their decision-making," said study first author Andrew Beam. He's a postdoctoral researcher at Harvard Medical School's department of biomedical informatics in Boston.

"Doctors are not always as rational as we'd like to believe," Beam added in a Harvard news release.

People with insomnia have difficulty falling asleep or staying asleep. The condition is believed to affect up to 40 percent of Americans, but is underdiagnosed and poorly treated, the researchers said.

Hoping to better understand what guides doctors' prescribing practices, Beam and his colleagues analyzed the medical records, including clinical notes, of more than 1,100 insomnia patients.

They focused on two commonly prescribed sleep aids: zolpidem (Ambien), a newer medication, and trazodone (Oleptro), an older drug usually used for depression. The researchers said trazodone is less effective for insomnia than Ambien but has a better safety record.

The researchers found that a doctor who prescribed a particular insomnia medication in the past was three times as likely to continue prescribing the same drug.

Also, patients with symptoms of depression in addition to insomnia were a bit more likely than those without depression to receive a prescription for trazodone.

That finding indicates that certain patient characteristics do have a role in doctors' prescription decisions, but still less so than habit, the researchers said.

The study was published recently in the journal Scientific Reports.

More information

The U.S. National Heart, Lung, and Blood Institute has more on insomnia.