← All projects

Retail Sales: Statistical Inference & OLS Regression

The problem

Three notebooks that go from “what is related to sales?” to “by how much, and what should a store expect to sell?”: which factors are associated with store sales, whether a new teaching method really raised pass rates, and how much shelf location, price and advertising move sales.

Approach

  1. Exploration and hypothesis tests: median/mode imputation, a 3× IQR outlier check, a correlation heatmap, chi-square tests and one-way ANOVA on 400 stores.
  2. Permutation test: 1,000 random shuffles of 200 students’ outcomes to check whether a 15-point rise in the pass rate could be chance.
  3. OLS regression: simple regression, forward stepwise selection on adjusted R², dummy encoding of shelf location and a point forecast for a new store.

Histogram of 1,000 shuffled pass-rate differences, with the observed 15-point difference far in the right tail

Results

  • The teaching method worked: only 3 of 1,000 shuffles produced a larger gap than the observed 15 points (p = 0.003), so the improvement is very unlikely to be chance.
  • Shelf location drives sales (ANOVA, p < 0.0001) and is independent of urban/rural and US/international location, so it is a lever management controls. Price correlates −0.45 with sales.
  • Regression: stepwise OLS kept Price, Advertising and Income (R² 0.294). Adding shelf location as dummy variables raised R² to 0.625. All else equal, a Good shelf sells about 4,800 more units than a Bad one, and a Medium shelf about 1,900 more.
  • Forecast: a store with price $120, advertising $11K, income $73K and a Bad shelf is expected to sell 5.71 thousand units.

Limitations: the regression is fit and evaluated on the same 400 stores; a holdout set or cross-validation is the next step. Store results come from the original course run (the course dataset is not redistributed); the permutation test runs anywhere and is fully executed in the repo.