Skip to content

About

Jusqu'où augmenter ses prix ? Élasticité-prix par catégorie (régression log-log, effets fixes) sur 48 produits d'un jeu public Kaggle. Projet personnel, Python.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

Price Elasticity — Where Can a Retailer Actually Raise Prices?

One-line: A naive sales-vs-price regression tells this retailer to raise prices everywhere. Corrected for product mix, the truth is the opposite — and that gap is the whole point of the project.

Objective

Answer a question every business owner asks: "How much can I raise prices before I lose customers?" — and show why the intuitive way of answering it is dangerously wrong.

Data

Retail Price Optimization (Kaggle, derived from the Brazilian Olist e-commerce dataset). A monthly panel of 48 products across 7 categories (617 clean rows), with unit price, quantity sold, a competitor price and the calendar month. 100% public data.

Exploratory analysis: prices vary across categories, and volume falls as price rises

Method

Price elasticity = the % change in quantity sold for a +1% change in price. It is read directly from the slope of a log-log regression: ln(qty) = β₀ + β₁·ln(price) + …, where β₁ is the elasticity.

  • Naive model — one regression per category, controlling for competitor price and seasonality.
  • Corrected model — the same, plus product fixed effects C(product_id), so elasticity is measured within the same product over time rather than across different products. This removes the mix bias described below.

The trap (key result)

The naive model recommends raising prices on all 7 categories — several categories even show a positive elasticity, i.e. "raise the price and you'll sell more." That is economically impossible. It happens because the model compares different products: an expensive product often sells well because it's a better product, not because the high price drives demand. The regression confuses "this product is premium" with "this product got more expensive."

Naive vs corrected elasticities: the naive model shows impossible positive elasticities; product fixed effects restore the negative sign

Add product fixed effects and the picture flips:

Category Naive Corrected +10% price → revenue
furniture_decor +0.14 −6.0 −38%
bed_bath_table +0.50 −3.8 −24%
computers_accessories +0.82 −3.0 −18%
watches_gifts +0.11 −2.8 −16%

Four categories move from an absurd positive elasticity to a strongly negative one. All four significant categories are highly price-elastic (|e| > 1): raising prices there destroys revenue. Not one category shows real pricing power.

Pricing decision matrix: every significant category sits in the elastic zone where a price hike cuts revenue

Business lesson

A casual price-vs-sales analysis doesn't just give a fuzzy answer — it can point you the exact wrong way, telling you to raise prices on demand that is in fact highly price-sensitive. Measuring elasticity correctly requires isolating the price effect from everything else that makes a product sell.

Limitations (read this)

  • With product fixed effects, the price variation that identifies elasticity is mostly promotions (a product's price moving over time ≈ discounts). So these are closer to promotional elasticities — naturally large — than to structural list-price elasticities. The direction is robust; the exact magnitudes are not.
  • Small panel (48 products) → wide confidence intervals; 3 of 7 categories are not significant and are shown in grey.
  • Observational data. The gold standard would be an experiment (randomized price tests) or an instrumental variable (a cost shock) — out of scope for a 1.5-day build.

Files

  • analyse.py — cleaning + EDA → figures/01_eda_prix_volume.png
  • elasticite.py — naive vs fixed-effects model + pricing simulation → figures 02 & 03
  • reports/elasticites.csv — full results

Run

pip install -r requirements.txt
python analyse.py
python elasticite.py

About

Jusqu'où augmenter ses prix ? Élasticité-prix par catégorie (régression log-log, effets fixes) sur 48 produits d'un jeu public Kaggle. Projet personnel, Python.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages