What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Granger causality tests whether the past of one time series improves forecasts of another. It does not prove that one variable physically produces the other. If past values of X improve predictions of Y after past Y is already included, then X Granger-causes Y in the predictive sense.

That distinction makes the method useful for the chicken-and-egg problem: instead of asking which came first in an absolute philosophical sense, you ask whether past chicken observations improve egg forecasts, whether past egg observations improve chicken forecasts, or both.

What “Granger-causes” means

Clive Granger introduced the framework in 1969 (original paper). In modern usage, a series X Granger-causes Y when lagged values of X add statistically significant forecasting information for Y, beyond the information already contained in lagged Y.

Important: Granger causality means “helps predict,” not necessarily “produces.” A physical or intervention-based causal claim asks what would happen to Y if an intervention changed X. A standard Granger test does not answer that question by itself.

The test does establish temporal precedence at the selected sampling interval: information in X must be observed before the corresponding values of Y. Temporal precedence is necessary for many causal explanations, but it is not sufficient. Confounding, common trends, omitted variables, nonlinear effects, and timing errors can all create predictive relationships without a direct intervention effect. See the methodological review at PMC10571505.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Why the chicken-and-egg problem is a useful analogy

Suppose Ct represents a chicken-related series and Et an egg-related series. Correlation may show that they move together, but it cannot tell you which one leads, whether the relationship is delayed, or whether a third factor drives both.

Granger analysis asks two separate questions:

  1. Do past chicken values improve forecasts of eggs?
  2. Do past egg values improve forecasts of chickens?
Result Meaning
Neither direction is significant The chosen model finds no sufficient incremental predictive information in either direction.
Chicken → egg only Past chicken observations improve egg forecasts, but the reverse improvement is not established.
Egg → chicken only Past egg observations improve chicken forecasts, but the reverse improvement is not established.
Both directions are significant Both histories add predictive information. This may reflect feedback, omitted common causes, or model limitations.

This is an analogy, not proof that a particular empirical chicken-and-egg dataset has been philosophically resolved.

Correlation versus Granger causality

Question Correlation Granger causality
Measures association? Yes Yes, through a forecasting model
Uses time ordering? Not necessarily Yes
Tests direction? No Yes; each direction requires its own test
Proves physical causation? No No
Depends on model choices? Fewer Lag length, transformations, deterministic terms, and specification matter

High correlation can result from a shared trend, seasonality, a delayed copy, or a common cause. Granger testing adds temporal structure, but it does not automatically remove those problems.

The two models behind the test

Restricted model

To test whether X adds information for Y, first predict Y using only its own history:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Yt = α0 + Σi=1p αiYt−i + εt

Unrestricted model

Then add the selected lags of X:

Yt = β0 + Σi=1p βiYt−i + Σi=1p γiXt−i + ηt

Null hypothesis

The null is that all lagged X coefficients are jointly zero:

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

H0: γ1 = γ2 = … = γp = 0

The alternative is that at least one is nonzero. This is normally a joint test of the chosen lags, not a claim based on one coefficient in isolation.

  • Fail to reject: the data do not provide sufficient evidence that past X improves forecasts of Y under this specification.
  • Reject: past X adds statistically significant predictive information for Y, conditional on past Y, the selected lags, and the model.

Running the test in Python

Install the packages

python -m pip install pandas numpy statsmodels

Arrange and clean the data

The statsmodels function expects a two-column array, does not accept missing values, and interprets the second column as the possible predictor of the first. The example below names the columns to make that direction explicit.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
import pandas as pd
from statsmodels.tsa.stattools import grangercausalitytests

df = pd.read_csv("data.csv")

# y is the target; x is the candidate predictor
data = df[["y", "x"]].dropna()

Before dropping rows, align timestamps, time zones, frequencies, and timestamp conventions. Removing isolated missing rows may be reasonable; blindly interpolating long gaps can manufacture lead-lag patterns.

Test whether x predicts y

results = grangercausalitytests(
    data[["y", "x"]],
    maxlag=4,
    addconst=True,
    verbose=False
)

for lag, result in results.items():
    tests = result[0]
    print(f"Lag {lag}")
    print("SSR-based F-test:", tests["ssr_ftest"])
    print("Parameter F-test:", tests["params_ftest"])

With ["y", "x"], the function tests whether x Granger-causes y. This column convention and the returned test statistics are documented by statsmodels.

Test the reverse direction

reverse_results = grangercausalitytests(
    data[["x", "y"]],
    maxlag=4,
    addconst=True,
    verbose=False
)

Now the second column is y, so the test asks whether y Granger-causes x.

Extract a p-value

lag = 4
test_statistics = results[lag][0]
p_value = test_statistics["ssr_ftest"][1]
print(f"p-value: {p_value:.4f}")

State which statistic you report. The result object includes SSR-based F, parameter F, SSR chi-square, and likelihood-ratio tests. A common beginner-friendly choice is the SSR-based F-test.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

How to choose a lag length

A lag is one observation interval: one hour for hourly data, one day for daily data, or one trading period for market data. The lag range should reflect how quickly an effect could plausibly appear.

  • Use domain knowledge about expected delays.
  • Consider AIC, BIC, or HQIC when selecting a model order.
  • Keep the sample size and degrees of freedom in view; many lags consume parameters.
  • Pre-specify a plausible maximum and perform sensitivity checks.
  • Do not test many lag lengths and report only the smallest p-value.

Lag length and treatment of nonstationary series are major sources of sensitivity, as noted by SAS documentation.

Prepare the time series before testing

Check stationarity and trends

Trending, nonstationary series can appear predictive even when their underlying processes are unrelated. Inspect plots and use appropriate unit-root diagnostics. Depending on the question, possible treatments include first differences, log differences, seasonal differences, or detrending.

Do not difference automatically. Differencing can remove useful long-run information. If theory suggests a long-run equilibrium, test for cointegration and consider a vector error-correction model (VECM). Statsmodels provides a Granger-causality test for VECM results at this documentation page.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Include deterministic terms deliberately

Document whether the model includes a constant, trend, seasonal terms, or exogenous variables. The choice changes the test and should not be hidden in code defaults.

Check model adequacy

  • Residual autocorrelation
  • Model stability
  • Outliers and influential observations
  • Structural breaks
  • Seasonality
  • Unequal observation intervals
  • Enough observations for the selected lag order

How to interpret p-values and direction

For a conventional significance level of 0.05, an illustrative report might look like this:

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Direction tested p-value Decision at α = 0.05 Correct interpretation
X → Y 0.012 Reject H0 Past X adds predictive information for Y.
Y → X 0.31 Fail to reject H0 There is insufficient evidence that past Y adds information for X.

A significant result does not measure how large or practically useful the forecasting improvement is. Where possible, also report out-of-sample forecast errors with and without X, forecast-error reduction, information criteria, and uncertainty intervals.

A nonsignificant result is not proof that X has no relationship with Y. The effect may be nonlinear, contemporaneous, too delayed for the tested range, hidden by noise or confounding, or undetectable in a small sample.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Situations that can mislead a standard test

Confounding and omitted variables

If rainfall affects both chicken health and egg production, omitting rainfall can make one series appear to predict the other. A multivariate model can condition on plausible confounders, but it also increases parameter count, collinearity, lag-selection complexity, and sample-size requirements.

Instantaneous effects and sampling frequency

Lagged testing does not identify what happens within one sampling interval. Hourly data cannot resolve a minute-level ordering, while very high-frequency data may be noisy or asynchronous. Distinguish lagged predictive influence from same-period association.

Nonlinear relationships

A linear autoregressive test can miss nonlinear predictive information. Alternatives include nonlinear autoregressive models, kernel methods, nonlinear state-space models, and transfer entropy. These methods use different assumptions and are not interchangeable.

Seasonality

Aligned weekly, monthly, or annual cycles can create apparent predictive relationships. Consider seasonal differencing, seasonal dummies, seasonal autoregressive terms, or explicit decomposition, while remembering that seasonality may be part of the phenomenon rather than unwanted noise.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Structural breaks

Policy changes, market regimes, product launches, biological adaptation, sensor replacements, or revised definitions can change a relationship. Rolling windows, subperiod analysis, break tests, or time-varying models may be more informative than one full-sample estimate. Repeated windows introduce dependence and multiple-testing concerns.

Multiple testing

Testing both directions, many lags, variable pairs, transformations, and subperiods inflates the chance of a false positive. Pre-specify primary analyses, report the tested range, avoid selective p-value reporting, and use multiplicity corrections when appropriate.

Timing errors and leakage

A timestamp does not guarantee real-time availability. Revised economic data, publication delays, end-of-day aggregates, future-inclusive calculations, and unsynchronized sensors can leak information into the predictor. Use the information-availability time, not merely the recorded timestamp.

How to report a result responsibly

Use a statement that identifies the data scale, period, variables, lags, test, and limitation:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Using [frequency] observations from [period], we tested whether lagged X improved prediction of Y after controlling for [variables and lags]. At lag [p], the [test name] produced p = [value]. This provides [evidence/no sufficient evidence] of Granger causality from X to Y under this specification; it is not proof of an intervention-based causal effect.

Extensions and alternatives

  • VAR: models several time series jointly and can test conditional predictive relationships.
  • VECM: handles cointegrated series, separating short-run dynamics from long-run adjustment.
  • Conditional or multivariate Granger causality: adds plausible variables instead of relying on a pairwise model.
  • Toda–Yamamoto procedures: provide an alternative approach for certain integration-order and cointegration settings, subject to their assumptions.
  • Nonlinear Granger methods and transfer entropy: target nonlinear or information-theoretic relationships with different interpretations.
  • Structural causal models, experiments, and quasi-experiments: are better suited when the question concerns intervention effects rather than predictive precedence.

Key takeaways

  • Granger causality is about incremental predictive usefulness over time.
  • Test both directions explicitly; the reverse direction cannot be inferred from one result.
  • A low p-value supports a model-dependent predictive claim, not automatic proof of real-world causation.
  • Stationarity, cointegration, lags, confounding, seasonality, structural breaks, nonlinearities, sampling, and information timing determine whether the result is credible.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.