The Pricing Trap: Why Your Regression Model Is Lying to You (And What to Do About It)
I used to think pricing was simple math. Look at your data, find the correlation between price and sales, adjust accordingly. Easy, right?
The Pricing Trap: Why Your Regression Model Is Lying to You (And What to Do About It)
I used to think pricing was simple math. Look at your data, find the correlation between price and sales, adjust accordingly. Easy, right?
Wrong. So incredibly wrong.
Let me tell you what happened when I tried to optimize pricing for a coffee shop chain.

The Mistake Everyone Makes
I pulled six months of sales data. The pattern was clear: our $5 lattes sold way more than our $3 drip coffee. The data screamed at me: “Raise your prices!”
So that’s what I recommended. Bump everything up 15%. More revenue, right?
The experienced store manager asked one simple question: “But what about the holiday season data in there?”
I froze.
She continued: “And wasn’t there that Starbucks promotion across the street in March? And didn’t we run out of oat milk for two weeks in April?”
Every single one of those things affects both price AND sales. The $5 lattes sold more because:
- We promoted them during Christmas (high traffic)
- They were featured drinks (better placement)
- Starbucks was out of stock on alternatives
- We only offered them in premium locations
The price wasn’t causing the sales. Everything else was.
The Real Problem: Confounding
Here’s what actually happens in retail pricing:
You see: Premium items at higher prices sell more
You think: “Customers prefer expensive things!”
Reality: Expensive items also get:
- Better shelf placement
- More advertising budget
- Stocked during peak seasons
- Pushed by sales staff
- Placed in high-traffic stores
Price is tangled up with everything else. Traditional regression just measures that tangled mess and calls it “price elasticity.”
It’s like saying “people who carry umbrellas get wet more often” and concluding umbrellas cause rain.
Solution 1: Start With Log-Log Regression
Before you get fancy, start here. It’s the simplest way to measure price elasticity while controlling for obvious confounders.
The model:
log(Sales) = β₀ + β₁×log(Price) + β₂×Holiday + β₃×Promotion + β₄×Competitor_Price + ...
Why logarithms? Because β₁ directly gives you price elasticity. If β₁ = -1.5, it means “a 1% price increase causes a 1.5% decrease in sales.” Done. No extra math.
Example from our coffee shop:
Without controls:
- Price coefficient = +0.3 (“higher prices = more sales!”)
- Completely wrong
With controls (holiday, promotions, competitor actions, stock-outs):
- Price coefficient = -1.8 (“higher prices = fewer sales!”)
- Much more realistic
The confounders were hiding the true relationship.
What to control for:
- Seasonality (holidays, weekends, weather)
- Promotions (yours and competitors’)
- Stock-outs
- Competitor pricing changes
- Day of week
- Local events
This gets you 80% of the way there for most retail situations.
Solution 2: Hierarchical Mixed-Effects Models
But here’s the thing: not all stores are the same.
Our Manhattan location could charge $6 for a latte. Our small-town Ohio store maxed out at $4.50. Same product, different worlds.
Traditional regression gives you ONE price elasticity for everything.
Hierarchical models let each group (store, region, product category) have its own personality while still learning from the overall pattern.
Think of it like this:
Instead of one equation:
Sales = 100 - 2×Price
You get parallel equations with different starting points:
Manhattan: Sales = (100 + 50) - 2×Price = 150 - 2×Price
Brooklyn: Sales = (100 + 20) - 2×Price = 120 - 2×Price
Ohio: Sales = (100 - 30) - 2×Price = 70 - 2×Price
Same slope (-2), different baselines. Manhattan just sells more coffee naturally. The price effect is the same everywhere.
The hierarchy:
Country
├── Region (Northeast, South, Midwest)
│ ├── State
│ │ ├── City
│ │ │ ├── Store
│ │ │ │ └── Product Category
Why this matters:
You discover:
- Cold brew in Miami: elasticity = -0.8 (inelastic, raise prices!)
- Cold brew in Seattle: elasticity = -2.1 (elastic, lower prices!)
- Hot coffee everywhere: elasticity = -1.5
Actionable insight: Different pricing strategies by location and product, not one-size-fits-all.
When to use it:
- You have distinct groups (stores, regions, product lines)
- Each group behaves differently
- You want to borrow statistical strength across groups
- You need location-specific pricing strategies
We implemented this and immediately found:
- Airport stores: Could charge 40% more (captive customers, inelastic)
- College campus stores: Had to discount 15% (broke students, very elastic)
- Downtown locations: Premium pricing worked during weekday mornings only
Solution 3: Causal ML (DoubleML) — When You Need the Truth
But even hierarchical models have a problem: they still assume you can “control” for confounders by adding them as variables.
What if the relationships are complex? What if promotions interact with seasonality? What if competitor actions depend on your pricing?
This is where DoubleML comes in.
Think of it as cleaning your data twice before measuring the effect.
The old way: Look at price and sales together, control for stuff, hope you got it right.
The DoubleML way:
Step 1: Use machine learning to predict “What SHOULD the price be, given everything else?”
- If you’re running a promotion, in Manhattan, during Christmas, with Starbucks next door… you’d probably charge $5.50
- You actually charge $6.00
- Price residual = +$0.50 (the “random” part of your pricing)
Step 2: Use machine learning to predict “What SHOULD sales be, given everything EXCEPT price?”
- Given the promotion, location, season… you’d expect 200 cups sold
- You actually sold 180
- Sales residual = -20 cups (the unexplained part)
Step 3: Connect the two residuals
- Random price increase of $0.50 → Random sales decrease of 20 cups
- TRUE causal effect: $1 increase = 40 fewer cups
This is free from confounding because you’ve used ML to remove all the patterns from both price and sales separately.
Real example:
We noticed pumpkin spice lattes at $6 sold like crazy in October. Traditional regression said: “Charge $7 next year!”
DoubleML said: “Wait. ML predicts those SHOULD cost $6 in October (it’s fall, everyone does pumpkin spice, high demand). The TRUE causal effect of price is still negative. You’re selling well DESPITE the price, not BECAUSE of it.”
We kept the price at $6. Sales stayed strong. Revenue maximized.
When you need DoubleML:
- High confounding (lots of promotions, competitor moves, seasonal patterns)
- Complex, non-linear relationships
- You’re making million-dollar decisions
- Traditional methods give unstable results
- You need to prove causation, not just correlation
What We Actually Found
After going through this process for our coffee chain:
Traditional regression told us:
- Raise prices 15% across the board
- Expected revenue increase: 12%
What actually would have happened:
- Sales would drop 25%
- Revenue would tank 14%
- We’d lose customers permanently
Causal ML told us:
- Lower prices 5% in college towns (elastic demand)
- Raise prices 10% in airports (inelastic)
- Keep current pricing in downtown (already optimal)
- Dynamic pricing for seasonal drinks
Actual results after implementation:
- Revenue up 8%
- Customer count up 3%
- Margin improved 5 percentage points
The Bottom Line
Pricing isn’t about finding correlations in your data. It’s about finding what actually causes sales to change when you move the price.
Most pricing models fail because they measure the wrong thing. They measure “what happened” instead of “what would happen if.”
Start simple. Control for the obvious stuff. Add hierarchy when groups behave differently. Bring in causal ML when the stakes are high and confounding is severe.
Your data is probably lying to you. The question is: how much?
메타데이터
- post_id
- 1c7ee3df897d
- slug
- the-pricing-trap-why-your-regression-model-is-lying-to-you-and-what-to-do-about-it-1c7ee3df897d
- url
- https://medium.com/@sainamaali/the-pricing-trap-why-your-regression-model-is-lying-to-you-and-what-to-do-about-it-1c7ee3df897d
- canonical_url
- https://medium.com/@sainamaali/the-pricing-trap-why-your-regression-model-is-lying-to-you-and-what-to-do-about-it-1c7ee3df897d
- author_url
- https://medium.com/@sainamaali
- status
- ok
- fetched_at
- 2026-06-09 15:37:30