ds@mcpanalytics.aiEmail your data and your question and get an answer about your own data, with the method shown.Email your data and question. Get an answer.
What's actually driving this? Outcome drivers analyses | MCP Analytics
Question

What's actually driving this?

By MCP Analytics Team | Published , updated

Compare two groups? Find what drives an outcome? Spot a trend? The question decides which statistics fit, so it is the first thing to get right.

See a worked example

How the analyses here work

Worked example

How do weekly sales move with ad spend?

The data. standard_linear_regression_v2.csv, the published sample file for Linear regression: 240 rows; columns ad_spend_k, region, sales_k, unit_price, week. Sample data, not a customer's.

The calculation. Python, standard library only. This exact code ran against the file when this page was built, and printed the output below it.

import csv
rows = list(csv.DictReader(open("standard_linear_regression_v2.csv")))
x = [float(r["ad_spend_k"]) for r in rows]
y = [float(r["sales_k"]) for r in rows]
n = len(x)
mx, my = sum(x) / n, sum(y) / n
sxy = sum((a - mx) * (b - my) for a, b in zip(x, y))
sxx = sum((a - mx) ** 2 for a in x)
syy = sum((b - my) ** 2 for b in y)
slope, r = sxy / sxx, sxy / (sxx * syy) ** 0.5
print(n, "rows")
print("sales_k =", round(my - slope * mx, 1), "+", round(slope, 2),
      "x ad_spend_k")
print("correlation r =", round(r, 2), " r squared =", round(r * r, 2))
240 rows
sales_k = 58.3 + 6.57 x ad_spend_k
correlation r = 0.93  r squared = 0.87

What it says. In this file each extra 1k of ad spend goes with about 6.57k more sales, and ad spend alone lines up with 87% of the variation in sales across these 240 rows, one per region and week (r = 0.93).

What it does not say. This is an association, not the effect of spending more: weeks with more spend may also be busier weeks, and the four regions are pooled here. One predictor is used here; the library analysis takes up to five drivers, such as region and price, reports an interval for each coefficient, and shows the residuals.

Run Linear regression on this file or your own, or open its stored sample report.

Sources

Further reading on the method in the worked example. Each reference was looked up and its authors, title, year and venue confirmed between 27 October 2026 and 30 October 2026.

  1. James G, Witten D, Hastie T, Tibshirani R. An Introduction to Statistical Learning (2nd ed.). https://www.statlearning.com/
  2. Pearson K (1895). Note on regression and inheritance in the case of two parents. Proceedings of the Royal Society of London. https://doi.org/10.1098/rspl.1895.0041
  3. White H (1980). A Heteroskedasticity-Consistent Covariance Matrix Estimator and a Direct Test for Heteroskedasticity. Econometrica. https://doi.org/10.2307/1912934

By MCP Analytics Team. Updated November 2026. Analysis list from the library catalog.

A delivered report from this list

Classification: sample report Open full report →

The stored sample report for Classification. Each analysis has its own report layout; open its page to see what it returns.