What Predicts a Taxi Tip? Regression and a Random Forest on 4 Million Rides

Every NYC yellow-cab trip in May 2026 — 4,090,836 rows — from a Parquet file to logistic regression and a random forest. Three recording traps, one default button, and the one thing that moves it. No code.

Dataset: NYC Taxi & Limousine Commission Yellow Taxi Trip Records, May 2026 — 4,090,836 real rides × 20 columns (times, distance, fare, surcharges, payment type, tip), published free by the TLC. Get the data from the TLC (direct Parquet file, 70 MB), open it in Stratum as-is, and follow along — every figure is a real screenshot from this file.

New York's Taxi and Limousine Commission publishes every yellow-cab trip: pickup and drop-off times, distance, fare, surcharges, payment type and tip. May 2026 alone is 4,090,836 rides. We loaded the whole month and asked one question: what actually predicts the tip?

The first answer the raw data gives you is that 37.7% of rides record no tip at all. That number is wrong, and working out why is half the analysis. The other half is the real finding: nearly half of all card rides land in a single one-point bin at 20%. The biggest force in a New York taxi tip isn't the ride. It's the default button.

Histogram of tip percentage for 2.5 million card rides, with one bar at 20 percent towering over the rest
Tip as a percent of the pre-tip bill, 2,518,494 card rides. One bar — 20% to 21% — holds 47.6% of them.

Step 0 — Four million rows, straight from Parquet

The TLC publishes each month as a 70 MB Parquet file. File ▸ Import File… (or drag the file onto Stratum) opens it directly — no conversion, no script, and no import wizard, because Parquet carries its own types: integers stay integers and both timestamps arrive as date/times. 4,090,836 rows × 20 columns. Excel stops at 1,048,576; Stratum is built to stay comfortable up to about five million. From that download to the last model below, nobody writes a line of Python, R or SQL.

Then a few formula columns (Data ▸ Add Column…), each one line evaluated over every row:

ColumnFormula
tip_pct[tip_amount] / ([total_amount] - [tip_amount]) * 100
duration_min([tpep_dropoff_datetime] - [tpep_pickup_datetime]) * 1440
pickup_hourhour([tpep_pickup_datetime])
weekdayweekday([tpep_pickup_datetime]) (1 = Sunday; labelled Sun–Sat)
airportif([Airport_fee] > 0, "Airport pickup", "No airport fee")

Step 1 — The zeros that aren't tips

Across all 4,090,836 rides the average tip is $2.98, the average tip percentage is 11.7%, and 37.7% of rides record a $0 tip. You could write the "stingy New Yorkers" story right there. Don't. A Trend chart of mean tip percent by payment type shows why:

Payment typeRidesMean tip %$0 tip
Credit card2,727,58516.979.8%
Code 0 ("Flex Fare")955,3711.5190.7%
Cash372,9090.00299.99%
Dispute / No charge34,971≈ 0≈ 100%
Bar chart of mean tip percent by payment type: credit card about 17, cash essentially zero
Mean tip % by payment type, all 4,090,836 rides. Cash is not stingy — cash tips are simply never recorded.

The TLC's own data dictionary says it: cash tips are not included. Payment code 0 — almost a quarter of the file — has no passenger count and no rate code on any row. Those zeros mean "not recorded," not "didn't tip," and averaging them in biases everything downstream.

So we filter, honestly, with every rule on screen (Organize ▸ Filter, Keep rows matching All): card payments only; fare above $0; distance above 0 and below 100 miles; duration above 0 and below 3 hours; tip below 100%. 2,658,827 rows survive. The junk rules on their own remove 182,426 rows (4.5%) — including all 51,750 trips from one small vendor, which records identical pickup and drop-off times.

Stratum Organize panel with seven Keep rules and the counter 2,658,827 of 4,090,836 rows
Seven rules, all visible, all counted: 2,658,827 of 4,090,836 rows kept.

Then the second trap. Mean tip percent by rate code sits between 15 and 18 for every code except one: rate code 99 ("Null/unknown") — 140,333 card rides, essentially all with a $0 tip, and 140,835 of the file's 140,897 rate-99 rows come from a single vendor. One more rule leaves the analysis set: 2,518,494 card rides.

Bar chart of mean tip percent by rate code, with rate code 99 at zero
Mean tip % by rate code (card rides). Every code tips 15–18% — except "unknown," which records zero.
The share of riders who tip nothing: 37.7% → 4.8%. Not one of those removals is a judgment call about people; each is a field that the data dictionary or the data itself says was never recorded.

Step 2 — Skew, a log axis, and the 20% tower

Fares, distances and durations are all heavily right-skewed (fare: median $13.50, mean $19.51, max $498; skewness 3.4). Turn on Inspector ▸ Axes ▸ Log Scale and the histogram bins in log space — equal widths in log10 — so the fare becomes a single well-behaved hump centred near $15 (the geometric mean is $15.08; the skewness of log10 fare is 0.68). More on that in when to log-transform.

Histogram of fare on a log axis, a single hump centred near fifteen dollars
Fare on a log axis, binned in log space: one hump, centred near $15.

Then histogram the tip itself, bin width one point. The bin from 20% to 21% holds 1,197,921 rides — 47.6% of the analysis set, 5.9× the next-tallest bar. 44.5% of riders tip exactly 20% of the pre-tip total, to the cent. Smaller spikes sit at 25% (6.2%), 15% (3.2%), 30% (2.6%) and 10% (2.3%) — the preset buttons on the back-seat screen.

Histogram of tip percent with a single dominant bar at 20 percent
Not a distribution of generosity — a distribution of defaults.

Step 3 — When do New Yorkers tip?

A heatmap with one column per pickup hour and one row per weekday — exactly 24 × 7 = 168 cells, 2.5 million rides binned in one pass — shows the city breathing: the busiest cell is Friday 6 p.m. (30,984 rides), the quietest Tuesday 3 a.m. (384).

Heatmap of ride counts by pickup hour and weekday
Rides by pickup hour × weekday. Friday at 6 p.m. peaks at 30,984.

Set the heatmap's value to tip percent, statistic Mean, and the map goes almost flat: 15.8% (Saturday 3 a.m.) to 18.4% (Tuesday 1 p.m.) across all 168 cells. A Trend by pickup hour puts the daily swing at about two points — 16.1% at 3 a.m. to 18.3% at 11 a.m. Real, but small.

Heatmap of mean tip percent by pickup hour and weekday, nearly uniform
Mean tip % by hour × weekday: 15.8% to 18.4% across every cell.

Step 4 — A regression that is significant and nearly useless

Linear regression of tip percent on fare, distance, duration, pickup hour and vendor, fitted on all 2,518,494 rows:

TermEstimatet
Vendor 2 (vs 1)−1.130−97.3
fare_amount−0.0377−52.8
trip_distance+0.0534+19.6
duration_min+0.0131+21.7
pickup_hour+0.0132+16.7
Stratum linear regression report with R-squared 0.0065 on 2,518,494 observations
Every p-value ≈ 0. R² = 0.0065.

Every predictor is wildly significant, and together they explain about two-thirds of one percent of the variation (residual SE 7.1 points on a mean of 17.7). That is the habit that matters at this scale: with millions of rows the p-value stops carrying information. Ask how big, and how much it explains. Each extra dollar of fare lowers the expected tip by 0.04 points — a $20 ride and a $60 ride differ by about 1.5 points. (More: effect size explained, reading regression diagnostics.)

Part of the problem is the question. Half the city never chose a tip percent — it tapped a button. So ask the yes-or-no version.

Step 5 — Logistic regression asks who taps the button

Analyze ▸ Logistic Regression — response "exactly 20%" vs "other" (event: exactly 20%), the same predictors plus an airport-pickup flag, all 2,518,494 rides. The Coefficients table carries odds ratios, and one is enormous: Vendor 2 vs Vendor 1, odds ratio 7.64 (95% CI 7.57–7.71). The meter company predicts an exact 20% tip better than anything about the ride.

Stratum logistic regression report with an odds ratio of 7.64 for vendor 2
"Who tips exactly 20%?" — the model's answer is the meter vendor. That should make you suspicious.

Widen "exactly 20%" to "within half a point of 20%" and the two vendors are identical — 53.7% vs 53.3%. A contingency table shows why: on Vendor 1, 90.9% of rides carry a tip that's a whole multiple of 5¢; on Vendor 2, 35.5%. Vendor 1 rounds tips to the nickel, so its riders' 20% taps land at 19.9 or 20.1. The model's best predictor was a rounding rule — a third recording trap, and it took a model to surface it.

Contingency table of vendor by tip cents, showing vendor 1 tips are almost all multiples of five cents
Vendor 1 rounds tips to the nickel (90.9% of rides vs 35.5%).

Refit on the honest response — tapped 20%, within half a point:

TermOdds ratio95% CIp
Airport pickup (vs none)0.2810.277–0.284≈ 0
Vendor 2 (vs 1)1.0081.001–1.0140.022
trip_distance (per mile)1.0221.021–1.024≈ 0
fare_amount (per $)0.99550.9951–0.9959≈ 0
  • The vendor effect collapses to an odds ratio of 1.008 — still "significant" at p = 0.02 on 2.5 million rows, and meaningless. Same habit, new model.
  • One effect holds: an airport pickup's odds of tapping 20% are 0.28 times everyone else's. In plain numbers, airport pickups tap 20% 29.9% of the time against 55.3% elsewhere — while tipping about the same percentage on average (17.2% vs 17.8%).
  • McFadden R² is 0.015 and accuracy at the 0.5 cutoff is 56.5% against a 53.4% baseline: for most rides, nothing measurable predicts who takes the default.
Stratum logistic regression report for tapping 20 percent, with an airport odds ratio of 0.28
With the artifact removed, the airport is the one effect that matters: odds ratio 0.28.

Step 6 — A random forest checks the straight lines

Logistic regression is linear in the log-odds; maybe the real pattern is curved or hides in an interaction. Analyze ▸ Data Mining ▸ Random Forest on the same response — ten predictors (fare, distance, duration, hour, weekday, vendor, pickup and drop-off zone, passengers, airport), 100 trees, depth 12, all 2.5 million rides:

  • Out-of-bag accuracy ≈ 57% against the 53.4% baseline — the same ceiling the logistic model hit. Two very different models, one honest answer.
  • Permutation importance (out-of-bag) puts the airport first, as the odds ratios did.
  • Trip distance comes second — but long rides are airport rides (52% of trips of 7–10 miles start at one). Holding the airport fixed, the logistic model finds longer rides slightly more likely to tap 20%, not less. Among non-airport rides, the tap rate is 53–56% at every distance under 20 miles. Permutation importance tells you what a model leans on; the odds ratios told us why.
Random forest permutation importance for tapping 20 percent, led by the airport flag
The forest agrees: the airport leads. (How tree importance works: decision trees explained.)

Airport riders don't tip less. They just stop pressing the button and type their own.

What we actually did

A Parquet import, formula columns, a seven-rule filter with every count on screen, Trend charts, histograms, a 24 × 7 heatmap, linear and logistic regression, and a random forest with permutation importance — on four million rows, no code — turning "38% of New Yorkers don't tip" into three recording artifacts, one default button, and one thing that actually moves it.

Two notes for the skeptical analyst. We never down-sampled to make things fit: both regressions and the forest train on every row the filter keeps. And we didn't need the zone lookup — Data ▸ Merge Data… will join the TLC's zone table onto the trips, but 91% of these pickups are in Manhattan, so borough carries no signal here.

The data is free from the TLC and so is the trial. Download Stratum, open the May Parquet file as-is, then try April (3.8 million rides) — does the airport effect hold?
case-study large-data regression logistic-regression random-forest data-cleaning