Of course, the houses in rich neighborhoods tend to be larger, and their lawns are both bigger and richer in plant life. But even after adjusting for these factors, Leong still found a link between neighborhood income and arthropod diversity. In short: more money, more bugs.

“It’s vegetation at a neighborhood scale that’s really having this big effect,” says Leong. In affluent areas, people might be more likely to plant trees or shrubs, and not just in their own yards but in public spaces beyond. Alternatively, richer people might be more likely to move into greener places. Either way, the bountiful vegetation then fosters a thriving community of arthropods that can then find their way into homes.

Ann Kinzig from Arizona State University suggests that continuity between yards might matter too. “Often in rich neighborhoods, we find one yard looking much like the next,” she says. “In some poorer neighborhoods, we can find absolutely glorious and diverse yards but with less emphasis on conformity. If you are an animal or organism that needs more than one yard’s worth of habitat, this may not be a good place for you.”

It’s not just bugs. Urban ecologists have repeatedly found that monetary wealth affects biological richness. Wealthier neighborhoods also contain more species of birds, lizards, and bats—a pattern known as the “luxury effect.” As the team write, “Our work suggests that the management of neighborhoods and cities can have effects on biodiversity that can extend from trees and birds all the way to the arthropod life in bedrooms and basements.”

Leong admits that her study has some important limitations. She only had data for 50 homes, all of which were free-standing, and found in middle-and higher-income neighborhoods. “They’re not a representative slice of the local demographics,” she says. But her colleagues are now looking further afield, carrying out the same kinds of surveys in other neighborhoods and other parts of the world. They also want to look at how the diversity of arthropods varies with the presence of pets or carpets, the use of pesticides, or the layouts of rooms.

Studies like these sit in an awkward middle ground between two traditionally disparate disciplines: urban entomology, which has largely dealt with pest insects that live inside people’s homes; and urban ecology, which has focused on species that live in outdoor urban environments. Straddling these fields is indoor ecology—the study of the organisms that live within our four walls.

These, after all, are the creatures we spend most of our time with. And most of them are so small that walls and windows are more inconveniences than barriers. As Leong says, “What’s immediately outside the house affects what’s going on inside.”

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.