San Francisco is famously America's most expensive city. That means there's all kinds of political agitation for rent regulations and other affordable housing mandates. But a new study from the National Bureau of Economic Research finds that the city's rent control laws help a certain set of haves while costing a larger set of have-nots.

In 1994, the City by the Bay imposed rent regulations via ballot initiative on "small multifamily housing built prior to 1980." This allowed Stanford researchers to compare units constructed before and after that year. As might be expected, rent control helped keep people where they already were, with "the beneficiaries of rent control…between 10 and 20 [percent] more likely to remain at their 1994 address relative to the control group." The longer you've been stationary and the older you are, the stronger that effect.

That's the sort of result fans want to see—keeping people in their homes!—but the economists also find that for shorter-term tenants, "the impact of rent control can be negative." Since the policy allows rents to reset to higher rates when people move out, many landlords have an incentive to do whatever they can to get rid of their residents. Rent-controlled buildings were 10 percent more likely to convert to condos or another legal form that allows for booting tenants.

Rent control in this case (and most cases) is politically appealing, as the winners are concentrated and visible, while the losers are widely dispersed and also not likely to recognize the law as the architect of their sorrow. The study concludes that "rent control offered large benefits to impacted tenants during the 1995–2012 period, averaging between $2300 and $6600 per person each year, with aggregate benefits totaling over $214 million annually and $2.9 billion present discounted value terms."

But because of the supply restrictions that followed—when rents are held down artificially, the incentive to be a landlord fades; this study found San Francisco's rent control reduced the rental housing stock by 15 percent—the rest of the city faced a rent increase of 5.1 percent. That's the equivalent of $2.9 billion in additional costs to other tenants—a total wash in direct costs and benefits to residents inside or outside rent control's "protection." The overall effect, the researchers found, was more gentrification and "a higher level of income inequality in the city overall."

The authors, for some reason still amenable to public action on the problem of San Francisco housing costs being too high, suggest government social insurance against large rent increases as a less costly solution than rent control.