So you’re sitting on a plane, somewhere in the back. Sweat is rising off this human stew, and in horror you watch it condense, trickling down the window glass. You slam the blind shut. Eww.

Of course the feeling is irrational—you’re flying, through the sky!—but you hate everything right now. The airline, for its stinginess. The flight attendant, for pouring you half a can of Coke, then taking the can back. But most of all, you hate your fellow passengers. You hate humanity.

Someone next to you swipes his credit card to buy an in-flight movie, which again reminds you of the insult, the nickel and diming, of air travel.

And yet. After analyzing a confidential database of passenger and time-stamped purchase records, a Stanford professor discovered that if someone next to you buys something on the plane, you’re 30 percent more likely to buy something yourself.

That’s the power of peer pressure.

In a recent working paper, Pedro Gardete looked at 65,525 transactions across 1,966 flights and more than 257,000 passengers. He parsed the data into thousands of mini-experiments such as this:

If someone beside you ordered a snack or a film, Gardete was able to see whether later you did, too. In this natural experiment, the person sitting directly in front of you was the control subject. Purchases were made on a touchscreen; that person wouldn’t have been able to see anything. If you bought something, and the person in front of you didn’t, peer pressure may have been the reason.

Because he had reservation data, Gardete could exclude people flying together, and he controlled for all kinds of other factors such as seat choice. This is purely the effect of a stranger’s choice — not just that, but a stranger whom you might be resenting because he is sitting next to you, and this is a plane.

By adding up thousands of these little experiments, Gardete, an assistant professor of marketing at Stanford, came up with an estimate. On average, people bought stuff 15 to 16 percent of the time. But if you saw someone next to you order something, your chances of buying something, too, jumped by 30 percent, or about four percentage points.

“That magnitude I really didn’t expect,” Gardete says. “It’s crazy, crazy.”

The beauty of this paper is that it looks at social influences in a controlled situation. (What’s more of a trap than an airplane seat?) These natural experiments are hard to come by.

Economists and social scientists have long wondered about the power of peer pressure, but it’s one of the trickiest research problems.

“Social effects in consumption are very hard to measure,” Gardete says. “Just think of a supermarket. The number of things happening in a supermarket are so huge that it’s very hard to measure anything.”

Education research has been particularly dogged by the question of peer effects. We know firsthand, of course, how influential friends are. But does the composition of a classroom make or break the lesson plan? Are your peers more important than your teachers?

Some of the cleanest measurements come from college dorm rooms. If your randomly assigned roommate is a bookworm, you’ll probably study more. If they’re black and you’re white, you’ll probably become more supportive of affirmative action. If you both drank in high school, then you’ll probably enable each other and get into trouble.

Peer effects are much harder to detect in classrooms, where a million things are going on at once. Recently, though, two researchers had a clever idea.

Leonardo Bursztyn, an assistant professor at UCLA, and Robert Jensen a professor at the University of Pennsylvania, handed out fliers encouraging 11th-graders to sign up for a free SAT class. The twist: Some of the fliers said that everyone in the class would know who signed up. Some of the fliers said that decisions would be kept private.

In honors classrooms, kids were 25 percent more likely to sign up if they knew their peers would be judging them. In non-honors classrooms, kids were 25 percent less likely to sign up.

Kids in the non-honors classes were worried about what their friends would think. So were kids in the honors classes.

All this should be a reminder that all the people in your life influence you — even if it’s the sneezy guy who elbowed you off the armrest on your flight back from Thanksgiving.