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.
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.
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:
| Column | Formula |
|---|---|
tip_pct | [tip_amount] / ([total_amount] - [tip_amount]) * 100 |
duration_min | ([tpep_dropoff_datetime] - [tpep_pickup_datetime]) * 1440 |
pickup_hour | hour([tpep_pickup_datetime]) |
weekday | weekday([tpep_pickup_datetime]) (1 = Sunday; labelled Sun–Sat) |
airport | if([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 type | Rides | Mean tip % | $0 tip |
|---|---|---|---|
| Credit card | 2,727,585 | 16.97 | 9.8% |
| Code 0 ("Flex Fare") | 955,371 | 1.51 | 90.7% |
| Cash | 372,909 | 0.002 | 99.99% |
| Dispute / No charge | 34,971 | ≈ 0 | ≈ 100% |
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.
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.
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.
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.
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).
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.
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:
| Term | Estimate | t |
|---|---|---|
| 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 |
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.
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.
Refit on the honest response — tapped 20%, within half a point:
| Term | Odds ratio | 95% CI | p |
|---|---|---|---|
| Airport pickup (vs none) | 0.281 | 0.277–0.284 | ≈ 0 |
| Vendor 2 (vs 1) | 1.008 | 1.001–1.014 | 0.022 |
| trip_distance (per mile) | 1.022 | 1.021–1.024 | ≈ 0 |
| fare_amount (per $) | 0.9955 | 0.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.
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.
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.