EconStatsCraft › Stacked bar

Stacked bar

Each bar is a whole and each segment a part, so it answers "what is this made of" for several categories at once. Only the bottom segment sits on a flat baseline, so it compares totals well and middle segments badly.

What it needs

The intuition

A stacked bar shows composition: each bar totals to something, and the segments are its parts. It does one job well - comparing TOTALS across bars - and one job badly. Only the bottom segment starts from a common baseline, so every segment above it floats on a moving base and cannot be compared across bars by eye. That single geometric fact explains most of what goes wrong with this chart.

When to use it

When a reader needs both "how big is each group" and "what is each group made of". If only the composition matters, normalise the bars to 100%.

Where the estimator comes from

Segment j of bar k occupies the interval \left[\sum_{i<j}y_{ik},\ \sum_{i\le j}y_{ik}\right]. Its LENGTH encodes y_{jk}, but its POSITION depends on every segment below it. Comparing lengths that begin at different places is the "position along non-aligned scales" task, which Cleveland and McGill ranked well below position on a common scale - the bottom segment gets the accurate judgement and the rest do not. A 100% stacked bar normalises each column to \sum_i y_{ik}=1, which makes shares comparable and discards the totals entirely.

What it assumes

Statistical properties

How to read the output

A worked reading

Four quarters of revenue split into five product lines. The chart answers "which quarter was biggest" instantly and reliably, because that is a total and totals are the full bar length from zero. Ask it "did product C grow" and it cannot help: product C sits third from the bottom, so its segment starts at a different height in every quarter, and the eye is being asked to compare four floating lengths. The honest response to that question is a second chart with product C alone against a zero baseline.

Symptom → diagnosis → what to do

If you see thisIt meansDo this
Middle segments hard to compareThey float on a moving baselineInherent. Move the key series to the bottom or facet
A component seeming to jumpThe segment below it movedPlot that component alone to check
Bars all the same heightIt is a 100% stackTotals have been normalised away; show them separately
Eight or more segmentsBeyond colour capacityGroup the tail, or use small multiples
Negative values in the stackThe geometry breaksUse a grouped bar or a diverging chart
Reader comparing the top segment across barsThe least reliable comparison on the chartGive it its own panel

Common mistakes

Where to read this properly

See also

Bar chart, for one quantity per category. Area chart, the same stacking problem over continuous time.

Related Charts

Line chart · Area chart · Bar chart · Scatter plot · Bubble chart · Histogram · Box plot · Pie chart · Heat map · Rebased to 100 · Lorenz curve and Gini

All analyses

Charts

Line chart · Area chart · Bar chart · Stacked bar · Scatter plot · Bubble chart · Histogram · Box plot · Pie chart · Heat map · Rebased to 100 · Lorenz curve and Gini

Maps

World map · Bivariate map · Flow map · India - state map · India - district map

Explore

Descriptive statistics · Summary by group · Two-way table · Classical statistical tests

Regression

Multiple regression (OLS) · Logit / Probit · Tobit (censored) · Truncated regression · Multinomial logit · Ordered logit / probit · Quantile regression · Poisson / Negative binomial

Time series - one series

Time-varying coefficients (Kalman) · Unit root tests · Correlogram (ACF / PACF) · ARIMA / SARIMA · Rolling-origin cross-validation · Theta method · Unobserved components · STL forecasting · Forecast combination · Markov regime switching · Change frequency (resample) · ARCH / GARCH volatility · Decompose & filter · Spectral analysis · Exponential smoothing · Forecast accuracy

Time series - several series

Yield curve (Nelson–Siegel / Svensson) · Dynamic factor model · Dynamic regression (ARIMAX) · Structural VAR · VAR · Granger causality · Cointegration · VECM · ARDL & bounds test

Panel data

Panel regression · Panel cointegration tests · Heterogeneous panel: Mean Group & PMG · Gravity model of trade · Dynamic panel GMM · Panel diagnostics · Panel unit-root tests

Multivariate statistics

Principal components (PCA) · Factor analysis · Cluster analysis

Marketing research

Conjoint analysis · MaxDiff (best–worst scaling) · TURF - reach of a product line · Price sensitivity (Van Westendorp) · Market basket analysis · Perceptual map · Scale reliability (Cronbach’s alpha) · Key driver analysis

Causal

Spatial autocorrelation · Spatial regression · Heckman selection · Instrumental variables (2SLS) · Difference-in-differences · Staggered difference-in-differences · Regression discontinuity · Matching & weighting · Oaxaca–Blinder decomposition

Finance & risk

Black–Scholes option pricing · Bond price, duration & convexity · Merton distance to default · EMI / home loan planner · CAPM / beta estimation · Multi-factor model · Portfolio optimization · Value at Risk & Expected Shortfall · Performance & drawdown · Time value of money & NPV/IRR · Equity valuation (DDM, FCF, residual income) · Cost of capital (WACC) · Binomial option pricing · Option strategies (payoff & profit) · Forwards, futures & swaps · Credit risk & Basel capital · Extreme value theory (tail risk)

Actuarial

Life table · Life annuity · Life insurance pricing · Chain ladder reserving · Buhlmann credibility · Survival analysis · Mortality graduation · Aggregate loss model · Ruin probability · Multi-state Markov model · Loss severity fitting

Tests & breaks

Monte Carlo experiment · F-test, Wald & Chow · Structural breaks & stability

Machine learning

Regression vs machine learning · Ridge / Lasso / Elastic Net · Random forest · Gradient boosting

Open the workspace →

Starting engine…

EconStatsCraft rigorous, plain-spoken econometrics

Econometrics that explains itself.

Regression, panel data, time series and the whole battery of tests. Every result is followed by a verdict you can defend.

Load a dataset to see it here.