There are many, many things that rich people buy in larger quantities. It turns out medications for certain serious diseases may be one of them.

A new analysis has found that, for some types of medications, income is a pretty strong predictor of how often someone is picking up a drug to treat an ailment.

The analysis, by GoodRx, a company that tracks prescription drug prices, looked at how often residents of different neighborhoods filled prescriptions for different categories of drugs.

Patients in wealthier neighborhoods were much more likely to pick up prescriptions for lifestyle problems: erectile dysfunction, baldness, anti-wrinkle Botox injections and an eye medicine that thickens eyelashes. This may be unsurprising.

But the analysis also showed that richer patients were more likely to buy drugs for certain serious conditions, including mental health disorders. This was the case even though the analysis showed that income doesn’t track with overall prescription use.

These prescriptions for serious conditions were filled disproportionately in rich neighborhoods despite evidence that the rich tend to be in overall better health. In fact, people in rich neighborhoods filled fewer prescriptions than people in middle-class neighborhoods. The blend of data suggests that, while prescriptions and income don’t track well over all, there are points where they do.

The relationship between income and prescription drug purchasing is more complicated than whether someone has money to spend at the pharmacy. Depending on income and life circumstances, Americans may have different odds of developing certain illnesses and of seeking treatment — even before the direct cost of medicines becomes an issue.

“There are definitely a bunch of financial barriers before you even get to the point of getting to fill a drug,” said Stacie B. Dusetzina, an associate professor of health policy at Vanderbilt University. She said social and cultural factors could matter, too: Evidence has shown that doctors are less likely to prescribe pain medicines to black patients than white ones, for example.