PairScanner

Case study · US equities

Coca-Cola
/ PepsiCo

How do two familiar names become a statistical relationship to examine? This example walks through PairScanner’s calculations, from price paths to the Z-score.

Historical snapshot as of
Analysis: PairScanner

Correlation
0.68
Daily returns
P-value
0.9065
Test threshold: 0.05
Closing Z-score
0.83
Window: 60 sessions
Coefficient β
-0.2804
Log-price regression

Period studied : 2021-07-27 → 2026-09-08 · 1284 shared sessions

Compare the paths from the same starting point

Both series start at 100 on the first shared date. A level of 120 represents a 20% increase from that starting point, calculated from closing prices adjusted for dividends and splits. The chart compares changes, not dollar prices.

Price paths normalized to 100
KO · Coca-ColaPEP · PepsiCo
75.0100.0125.0150.0175.0200.0Price paths normalized to 100Shared dates and starting point. Both curves use the full period shown.
2021-07-272024-02-142026-09-08
Shared dates and starting point. Both curves use the full period shown.

Daily return correlation is 0.68. It describes how day-to-day changes have moved together. It does not establish whether the gap between the two assets returns to a lasting equilibrium.

Test the stability of the relationship

PairScanner estimates β by regression, then constructs the spread S = ln(KO) − β × ln(PEP). The Engle-Granger test uses log prices. Its null hypothesis is no cointegration; a p-value below 0.05 rejects that hypothesis at the selected level.

Spread centered on its historical mean
Mean
-0.40-0.200.000.200.400.60Spread centered on its historical meanThe full-period mean is subtracted to place the reference at zero. This retrospective view is not a trading simulation.
2021-07-272024-02-142026-09-08
The full-period mean is subtracted to place the reference at zero. This retrospective view is not a trading simulation.

Here, p = 0.9065. The threshold is not met: that finding is kept, even for a familiar pair.

Why the negative β deserves attention

Over this period, β is -0.2804. The spread formula therefore adds the log prices with a positive weight on PEP. It does not represent the usual interpretation of buying one asset and selling the other. This coefficient is not a number of shares to trade.

Locate the gap at the last close

The Z-score measures the spread’s distance from its rolling mean in standard deviations over 60 sessions. Dashed lines at ±2 are reference levels. Z can still be calculated when the cointegration test is inconclusive.

Spread Z-score and reference levels
Reference levels ±2
-4.0-2.00.02.04.0Spread Z-score and reference levelsThe window includes the observed session. Initial sessions without a complete window are not plotted.
2021-07-272024-02-142026-09-08
The window includes the observed session. Initial sessions without a complete window are not plotted.

At the study date, Z = 0.83, inside the ±2 reference levels. It describes the gap at that close; it does not validate the relationship on its own.

Scope and limits of this reading

Data
Adjusted closing prices used by PairScanner. Shared dates only; missing, non-finite and non-positive observations are excluded. Last observation: 2026-09-08.
Estimation
β and the cointegration test use all 1284 observations in this study. Charts are descriptive and retrospective: β was not known in advance for each session shown.
Out of sample
Not run: the initial cointegration test did not meet the threshold. This check therefore neither passed nor failed.
Multiple testing
The displayed p-value belongs to this individual test. It is not a q-value adjusted across all scanner pairs. A p-value is not the probability of a profitable trade.

What this example helps you understand

Correlation describes daily changes, cointegration tests a relationship between price levels, and the Z-score locates a deviation. These three readings complement each other. This is a dated study: the application’s figures can change after subsequent closes.

This educational study is independent of the pair of the day, which is selected for its trading relevance.

Another result, the same method

MBB / SPMB complements this reading with two ETFs tracking the same benchmark. Compare the tests, spread and out-of-sample validation at a fixed date.

Read the MBB / SPMB study →
Also explore: KMI / WMB, an entry-zone Z demonstration →

Explore the scanner’s pairs

Find updated analyses and results in PairScanner.

Open PairScanner

Historical results do not determine future outcomes. This study is not an investment recommendation.