Stop me if you’ve heard this one before: You meet someone great. The conversation is dazzling, the interests are mutual, the personalities click. It would be cool to hang out, or to hang out again.

Aarian Marshall covers autonomous vehicles, transportation policy, and urban planning for WIRED.

Then the hammer drops. You live where? The highway goes nowhere near that place, or you’d have to transfer subways three times. And thus, something beautiful dies before it even begins.

If you’ve made similar cold-hearted friendship decisions, new research suggests you are not alone. A working paper published this month by the National Bureau of Economic Research finds that New Yorkers’ social connections are driven less by physical distance than public transit infrastructure. In other words: You are where you subway.

The paper, written by researchers from Princeton University, New York University, and Facebook, draws on anonymized and aggregated Facebook data from March 2018, from New York City\–area users who had enabled location history. (The data is aggregated by zip code to preserve users’ anonymity, and excludes zip codes with fewer than 500 residents.)

In prior research, which looked at Facebook users across wider swaths of the country, this same team of social scientists found that, yeah, your social network is shaped by physical distance. The closer someone is, the more likely they are to be your Facebook friend. But the researchers were surprised to find that, in New York at least, transportation ease was an even stronger predictor of Facebook friendship than distance. Upping the distance between neighborhoods by 10 percent correlates with almost a 10 percent reduction in Facebook friendships. But upping the travel times by 10 percent leads to an almost 15 percent reduction. The relationship between travel time and likelihood of a Facebook connection held even after the economists controlled for factors known to spur friendship, like income, educational level, and race.

Data from social media platforms like Facebook has given scientists unprecedented glimpses into human relationships and how they’re formed, says Theresa Kuchler, a coauthor of the paper and assistant professor of finance at NYU’s Stern School of Business who studies how people make economic decisions. Sure, most people aren’t best friends with all their Facebook friends, but “if we want to figure out what type of people you know, who you talk to, and what areas of the country you have friends in, it’s a good way to capture that,” she says. “Facebook has been a unique treasure trove for this type of work.”

For now, the researchers haven’t done work to suggest that the relationship between friendship and public transportation travel time holds for places outside of New York City. And it’s true that in the US, New York is sui generis—no other city has such a well-developed and widely used transit system. But researchers think it’s possible that transportation determines “friendships” elsewhere, too. “I think if you did this for a city that’s not New York, public transit wouldn't matter, but road routings would matter,” says Leah Brooks, an economist at George Washington University who has studied cities and transportation systems. It’s very possible, she says, that two neighboring suburban areas might not have a lot of social connections if there’s not an easy way to get between them. Brooks’ own research has found that cities continue to be shaped by long-ago public transit infrastructure, like streetcar lines. “If you told me public transit matters [to social connectedness] in San Diego, I’d be really surprised,” she says—the city doesn’t have great transit.

For now, the researchers on the New York study can’t say that public transit creates social connectedness. “If someone could randomly open a subway line for us, that would be fantastic, and we could answer that question,” says Kuchler.

But the work points to something about transportation that gets forgotten: The way you get around determines a lot about your life. It shapes how you make money and how you spend money, and what sorts of opportunities your kids might have. It also shapes your Facebook friendships—and which of those might blossom into something more.

More Great WIRED Stories