More restaurants nationwide are eliminating gratuities to pay staff higher wages. A D.C. restaurant has found that switching to a non-tipped pay structure has created a better business model and reduced tension between cooks and servers. (Daron Taylor,Jayne Orenstein/The Washington Post)

At a cafe in Upstate New York, a waiter paused for a moment in the kitchen to draw a playing card from a shuffled deck before bringing a check out to a table of diners. If the card he drew was red, the waiter would give every diner at the table a high-quality chocolate in foil wrapping paper along with their bill.  However, if the playing card he drew was black, the bill would come out chocolate-free.

The waiter was a (willing) participant in an experiment concocted by behavioral scientists to study how a small gift (in this case, a chocolate) could influence how much restaurant patrons decided to tip.

The standard view in the field of economics is that tipping in any service encounter where you don’t expect to be a return customer is a behavioral quirk — something that, in a world where humans are rational, return-maximizing actors, really should not happen.

It makes sense to leave a tip for your regular waiter at your regular diner or to give one to your doorman each holiday season, since the service quality you receive in the future will likely depend on those tips. But economists find it peculiar that people tip the bellman upon departing from a hotel they’ll never visit again, a waitress at an out-of-town restaurant or a cabdriver in a big city. There’s technically no economic reason for such transactions, beyond a social expectation. And so nerdy behavioral scientists have had a field day running studies to figure out what oddities shape our decisions about tipping — decisions economic theory asserts we often shouldn’t be making in the first place.

Much of that research has been done in restaurants with unsuspecting diners following procedures like the ones at the Upstate New York cafe.

There, researchers found the average tip from diners who were offered wrapped chocolates with their check was 18 percent, but it was only 15 percent under normal circumstances. It turns out friendly gestures from your server can have a surprisingly large impact on your tipping decisions, though you may not realize it. Dozens of experiments with similar designs (using playing cards or other randomizing devices to determine what “special treatment” customers would receive) in a variety of restaurants around the country have reinforced just how much small acts affect tips. For instance, tips go up two percentage points if a server writes “Thank You” on the back of a patron’s check, four percentage points if a server notes on the back of a bill that the forecast is for good weather tomorrow, eight percentage points if a server introduces him or herself by name, and five percentage points if a server touches a patron’s hand (though notably this last study was only conducted with female servers!). This evidence all points to huge benefits from making patrons feel like you have a real relationship and from taking steps to boost their mood.

And this isn’t a restaurant-specific phenomenon — it matters in cabs too. One massive study of the tips given after 13.82 million taxi rides taken in New York City in 2009 found that mood matters even when it’s affected by factors outside of your driver’s control. Cloud cover makes us grumpy, and researchers found that cloud cover influences tips even after accounting for other weather conditions and the season. When it’s fully overcast, a cabdriver can expect to earn an average of about a half a percentage point less in tips than when it’s completely clear and sunny.

Recent advances in technology have made it easier to tip our tipping decisions as we interact with screens at the point of sale. Companies like Square and Uber are now suggesting a set of possible tips when we make a purchase, and these suggestions, perhaps not surprisingly, influence our choices.

A recently published study of the same 13.82 million New York City taxi rides mentioned above looked at the influence of the tip suggestions that appear on a rider’s screen when she pays her cab fare with a credit card. One cut of the data zoomed in on 100,577 daytime taxi rides initiated at LaGuardia Airport with fares of $15 or more and compared the tips riders gave when they were “randomly” put in cabs from two different companies that displayed different suggested tip percentages on their payment screens (20 percent, 25 percent or 30 percent versus 15 percent, 20 percent or 25 percent). Higher suggested tips boosted drivers’ average gratuities by about seven tenths of a percentage point — a small but precisely estimated increase amounting to about $7 in extra tips for every $1,000 in fares.

An interesting side effect also showed up in the data, however: rides with higher suggested tips were over 50 percent more likely to produce no tip at all. So higher suggested tips produce a bimodal response — higher average tips, but more people opting out of tipping entirely, perhaps due to their irritation with the excessively high suggestions offered on-screen.

So what’s the punchline of all this? Primarily, it’s that you’re not alone if you feel unsure about how much to tip when. Economics suggests there is no “right” answer and research shows we’re all easy marks for manipulation. If you work in the service industry, some of the studies I’ve described here should give you ideas about how to boost your tips. If you’re only a patron, my advice is you try to let go of your tipping anxiety and don’t feel too bad about following suggestions from technology (or your heart) about what to tip — everyone else does, too.

Katherine L. Milkman is a professor at the Wharton School of the University of Pennsylvania who does research about behavioral economics.  Follow her on twitter @Katy_Milkman