Contrary to popular belief, it’s good to be neighbors with Mary Jane.

A new study from real-estate marketing firm Clever found that home values increased nearly $23,000 more between 2014 and 2019 in cities that allow retail cannabis dispensaries to set up shop compared with cities where recreational marijuana was illegal.

“Investors see the opportunity to enter a new market, and home values respond,” Luke Babich, co-founder and chief strategy officer of Clever Real Estate, wrote in the report.

To produce these findings, researchers at Clever examined housing data from Zillow ZG, -2.70% and 2018 population estimates from the U.S. Census Bureau. They compared the home value increases that occurred between 2017 and 2019 in cities where marijuana became legal recreationally, where it was legal for medical uses and where it was not legal. The analysis controlled for population and the initial home values in each city.

Clever’s findings build on research from the Cato Institute, a libertarian think-tank, which found that single-family homes within one-tenth of a mile of a cannabis retailer increased 8.4% in value as compared with homes located slightly further away.

Read more:Why Americans pay more for cannabis than Canadians

Here are the researchers’ other findings:

• In Colorado, the home values in some cities that had at least one dispensary increased at nearly double the average rate nationally. In Sheridan, a community roughly 10 miles south of Denver, home values increased over 90% between January 2014 and January 2019.

• The increase in home values happened almost immediately following the legalization of marijuana — even before states set up the licensing procedures that allow dispensaries to begin operations. The initial bump was more than $6,000 on average.

• Medical marijuana legalization doesn’t produce the same effect as recreational legalization. In cities where you can buy medicinal cannabis products, home values increased at roughly the same rate as cities where those substances are completely illegal.

Crime should not necessarily be a concern to home buyers in cannabis cities

As the Clever researchers note, public opinion polls often show that people are opposed to marijuana legalization because of concerns that it would lead to an increase in crime.

If that were true, that would be a negative for home values. However, research has shown that marijuana dispensaries don’t necessarily increase the crime rates in the neighborhoods where they are located. Nor does the retail element promote more drug or alcohol abuse among young people, according to some studies. Tobacco and liquor stores, comparatively, do seem to promote higher rates of violent crime.

Also see:Trump administration targets states that legalized marijuana — how this affects you

Real-estate investors may not necessarily want to get too excited about buying in states where marijuana is legal, as cannabis alone likely isn’t responsible for the uptick in home values.