← Back to Publications

Diagnostic Analytics

Why Did It Happen?

Descriptive analytics tells you what happened — profit fell. Diagnostic analytics is the next, harder question: why. It is the step most dashboards skip and the one executives actually ask about. The work is to move from one observed change to a small set of candidate causes, then use evidence — correlation, statistical tests, and disciplined drill-down — to keep the explanations that survive scrutiny and discard the ones that don't.

This is a four-chapter mini-series. Each chapter shows the Python that runs the analysis and embeds the actual rendered output, on the same synthetic retail dataset used across the Descriptive and Visualization series. Every statistic quoted on these pages — the t-statistics, the chi-square values, the correlations — is computed from that data, not invented.

From a symptom, to tested hypotheses, to a cause Observed change profit down Discount level test: correlation Category mix test: chi-square Region test: control Confirmed driver deep discounts

Diagnostic analytics turns one symptom into testable hypotheses, then keeps only the drivers the evidence supports.

The Four Chapters

Reference Code

The correlation-to-target and group-comparison helpers shown here are packaged as reusable functions in the Data Analytics Library's diagnosticanalysis module. Diagnostic analytics sits between Descriptive ("what happened") and Predictive ("what will happen").

← Back to Publications