Investing can be a tricky and confusing business. For those who are new to it and thus gun-shy about choosing where to put their money, one appealing option is to mimic the investments of peers who seem to be doing well.

That might sound like it makes sense, but it’s often a dangerous strategy: When too many people jump on a hot investment trend, it can lead to huge losses if the market turns, or if the underlying asset proves to be not quite what people thought it was. Because this phenomenon can present problems not just to individuals but to entire markets, economists have given it a name—“investor contagion.”

Until now, most theories about how an investment idea spreads—and how detrimental this can be—were based on anecdotal examples of investment bandwagons. One of the most famous is when, in the 1600s, people in the Netherlands poured incredible amounts of money into the market for, of all things, tulips. During the market’s heyday, all manner of Dutch people joined in, including, in the words of some economists, “nobles, citizens, farmers, mechanics, seamen, footmen, maid-servants, even chimney-sweeps and old clotheswomen.” Then the market for the flowers crashed spectacularly.

But now, a new study from the National Bureau of Economic Research is taking a more rigorous approach by looking at the investments a group of people made, and then comparing them to the investments their neighbors made.

The study’s authors, the economists Patrick Bayer, James W. Roberts, and Kyle Mangum, focus on the case of the early-2000s housing boom to explore the problem of copycat investing. It’s a prime example because as the housing boom continued, home values rose and speculation increased. It seem like anyone could (and should) join in by trying to invest in real estate themselves.

Using housing data from Los Angeles, the researchers examined the investment habits of entire neighborhoods to see if the behavior of some residents mirrored that of others. Bayer and his colleagues found that it did, in two significant ways: If a household was within a block (0.10 miles) of another household that invested in property, it was 8 percent more likely to invest in housing over the next year, and 20 percent more likely to do so within a three-year span. Similarly, those who lived in a neighborhood where a house had been successfully purchased, renovated, and resold were 9 percent more likely to invest in housing within a year, and 19 percent more likely over a three-year period. These investing decisions may become contagious via word-of-mouth or personal observation, the economist suggest. At the peak of the housing boom, they estimate that neighborhood contagion could have been responsible for about 11 percent of speculative real-estate investment at 10 percent of investors.

It may not seem like a very big deal that people tend to mimic investments that have proved lucrative for others, but the increased speculation can help create financial bubbles. And those who join investment trends late in the cycle tend to fare worse than those who invested (and likely exited) earlier, the researchers find. In other words, those who were influenced by the activity of their neighbors tended to buy high and sell low. They held onto investments well past the market boom, and were forced to sell after prices had already declined. They were also more likely to default on their investments than people who made similar investments earlier.

Often, the people who jump on investment bandwagons are the worst-equipped to handle any losses. The economists note that late-stage investors also tend to be novice investors, who are more heavily swayed by the success of their peers than by the financial soundness of an investment. That’s especially bad news since novice investors can often hail from populations who don’t traditionally have tons of economic wiggle room to absorb significant losses: young families, minorities, or couples nearing retirement who are trying to build up a nest egg.

But investing contagion has implications beyond personal losses—it can lead to widespread economic crisis that can cripple entire regions, industries, or—in the most dangerous iterations, such as housing—an entire nation.