One of the first things you learn when living in New York is that what qualifies as wealthy somewhere else seems barely middle-class here. On the Upper West Side, where I live, it’s hard not to feel as if Manhattan is impossibly expensive for young professionals. The average nondoorman, one-bedroom apartment in the neighborhood rents for about $2,500 a month. Oatmeal-raisin cookies at Levain Bakery cost $4 each. A pair of sensible, unstylish walking flats from Harry’s Shoes can set you back $480. I suppose, by comparison, that the $198 chef’s menu at Jean-Georges doesn’t sound so ridiculous.

New Yorkers assume that we live in the most expensive city in the country, and cost-of-living indexes tend to back up that assertion. But those measures are built around the typical American’s shopping habits, which don’t really apply to the typical New Yorker — especially not college-educated New Yorkers with annual household incomes in the top income quintile, or around $100,000. According to a recent study by Jessie Handbury, an economist at the University of Pennsylvania’s Wharton School, people in different income classes do indeed have markedly different purchasing habits. That may not be surprising, but once you account for these different preferences, it turns out that living in New York is actually a relative bargain for the wealthy.

While compiling her research, Handbury looked at Nielsen shopping data for 40,000 American households, across more than 500 food categories, with details on everything from organic labeling to salt content. Remarkably, she found that for households earning above $100,000, grocery costs are 20 percent lower in cities with a high per-capita income (like New York) than in cities with a low per-capita income (like New Orleans). There’s evidence that the same forces hold true for other products that cater to upper-income people, from high-end retail to beauty services. The average manicure, for example, is about $3 cheaper in New York City than in each of the rest of the top 10 biggest cities in the United States, according to Centzy, a company that collects data on the prices of services.

Part of the reason high-income residents get good deals, Handbury explains, results from a particular economic system. Highly educated, high-income New Yorkers are surrounded by equally well-educated and well-paid people with similar tastes. More vendors compete for their business, which effectively lowers prices and provides variety. There’s also a high fixed cost to distributing a niche product to an area; if there’s more demand for that product, then the fixed cost can be spread across more customers, which will justify bringing the product to the market in the first place. That’s why companies go through the expensive hassle of distributing, say, St. Dalfour French fruit spreads in rich cities but not in poor ones and why New York can support institutions like the Metropolitan Opera.