Granger Causality Test Calculator

Inputs

p-value0.0005
F statistic5.40
Degrees of freedom4 / 108
Verdict at the 5% levelReject: X Granger-causes Y at 5%
How this was calculated
  1. Inputs: restricted RSS 120.00, unrestricted RSS 100.00, 4 lags, 120 observations, 12 parameters in the unrestricted model.
  2. F = [(RSSr - RSSu)/p] / [RSSu/(n - k)] = [(120.00 - 100.00)/4] / [100.00/108] = 5.40.
  3. The statistic follows an F distribution with 4 and 108 degrees of freedom under the null that the lags of X add nothing.
  4. The p-value is 0.0005: reject: x granger-causes y at 5%.

Granger causality is a deliberately modest claim wearing a grand name: X Granger-causes Y if the past of X improves the forecast of Y beyond what Y's own past achieves. The test is an ordinary F-test comparing two regressions - Y on its own lags, then Y on its own lags plus lags of X - and it lives or dies on the residual sums of squares. Enter the two RSS values, the lag order, the sample size and the unrestricted model's parameter count, and this calculator returns the F statistic, its degrees of freedom and the p-value.

Worked examples

Clear predictive content

(120 · 100 · 4 · 120 · 12)

p-value0.0005
F statistic5.40
Degrees of freedom4 / 108
Verdict at the 5% levelReject: X Granger-causes Y at 5%

Improvement too small to matter

(85.5 · 84 · 2 · 80 · 8)

p-value0.5288
F statistic0.64
Degrees of freedom2 / 72
Verdict at the 5% levelDo not reject: no Granger causality at 5%

Strong causality, large sample

(300 · 240 · 6 · 200 · 16)

p-value<0.0001
F statistic7.67
Degrees of freedom6 / 184
Verdict at the 5% levelReject: X Granger-causes Y at 5%

Prediction, not causation

Granger's 1969 definition is about precedence and information, not mechanism. A variable can Granger-cause another because it causes it, because it is announced earlier, because it proxies for a third variable that causes both, or because it is measured faster. The test cannot distinguish those stories, and honest reporting keeps the word Granger attached to the word causality every time. What the test does settle is narrower and useful: whether a forecasting equation for Y is leaving usable information in X's history on the table.

That narrower claim is the working test of market-efficiency arguments, of leading-indicator status, and of half the 'X predicts Y' headlines in applied time-series work. It deserves a correct F statistic, which is a matter of bookkeeping: the degrees of freedom are the lag count in the numerator and n minus the unrestricted parameter count in the denominator.

  • Restricted model: Y on its own lags only
  • Unrestricted model: adds p lags of X
  • F compares the two residual sums of squares
  • Both series should be stationary before testing

The restricted and unrestricted regressions

The arithmetic is transparent. In the first worked example the restricted RSS is 120 and adding four lags of X cuts it to 100; the improvement of 20 over 4 restrictions, scaled by the unrestricted fit of 100 over its 108 residual degrees of freedom, gives F of 5.40. On 4 and 108 degrees of freedom that is a p-value of 0.0005 - the lags of X are carrying real forecast content.

The second example is the necessary antidote to RSS optimism. Cutting the RSS from 85.5 to 84 looks like progress and is nothing of the kind: F of 0.64 on 2 and 72 degrees of freedom, a p-value of 0.5288. Any added regressors reduce the RSS; the F-test is the discipline that asks whether they reduced it by more than chance would. The third example, an RSS fall from 300 to 240 over six lags, gives F of 7.67 and a p-value below 0.0001.

Worked examples

Example 1: RSS, restricted model (Y on own lags) 120; RSS, unrestricted model (adds lags of X) 100; Lags of X tested p 4; Observations n 120; Parameters in the unrestricted model k 12. p-value = 0.0005. Supporting values: F statistic 5.40; Degrees of freedom 4 / 108; Verdict at the 5% level Reject: X Granger-causes Y at 5%. Inputs: restricted RSS 120.00, unrestricted RSS 100.00, 4 lags, 120 observations, 12 parameters in the unrestricted model. F = [(RSSr - RSSu)/p] / [RSSu/(n - k)] = [(120.00 - 100.00)/4] / [100.00/108] = 5.40. The statistic follows an F distribution with 4 and 108 degrees of freedom under the null that the lags of X add nothing. The p-value is 0.0005: reject: x granger-causes y at 5%.

Example 2: RSS, restricted model (Y on own lags) 85.5; RSS, unrestricted model (adds lags of X) 84; Lags of X tested p 2; Observations n 80; Parameters in the unrestricted model k 8. p-value = 0.5288. Supporting values: F statistic 0.64; Degrees of freedom 2 / 72; Verdict at the 5% level Do not reject: no Granger causality at 5%. Inputs: restricted RSS 85.50, unrestricted RSS 84.00, 2 lags, 80 observations, 8 parameters in the unrestricted model. F = [(RSSr - RSSu)/p] / [RSSu/(n - k)] = [(85.50 - 84.00)/2] / [84.00/72] = 0.64. The statistic follows an F distribution with 2 and 72 degrees of freedom under the null that the lags of X add nothing. The p-value is 0.5288: do not reject: no granger causality at 5%.

Example 3: RSS, restricted model (Y on own lags) 300; RSS, unrestricted model (adds lags of X) 240; Lags of X tested p 6; Observations n 200; Parameters in the unrestricted model k 16. p-value = <0.0001. Supporting values: F statistic 7.67; Degrees of freedom 6 / 184; Verdict at the 5% level Reject: X Granger-causes Y at 5%. Inputs: restricted RSS 300.00, unrestricted RSS 240.00, 6 lags, 200 observations, 16 parameters in the unrestricted model. F = [(RSSr - RSSu)/p] / [RSSu/(n - k)] = [(300.00 - 240.00)/6] / [240.00/184] = 7.67. The statistic follows an F distribution with 6 and 184 degrees of freedom under the null that the lags of X add nothing. The p-value is <0.0001: reject: x granger-causes y at 5%.

Choosing the lag length

The lag order p decides what the test can see. Too short, and a slow transmission - monetary policy to output, advertising to sales - is truncated before it acts. Too long, and the unrestricted model spends parameters until the denominator degrees of freedom thin out and power drains away. Information criteria on the unrestricted model, checked against the calendar of the process being studied, are the standard way to set it; reporting the test at two lag orders is the standard way to show the conclusion is not a hostage to that choice.

Note what the parameter count k does in the formula: it is every parameter of the unrestricted model, constant and own lags included, because the residual degrees of freedom are n - k. Undercounting k flatters the F statistic, and it is the most common bookkeeping error in hand-run versions of this test - one reason the count is an explicit input here rather than an assumption.

Stationarity first

The F distribution behind the p-value assumes stationary regressions. Run the test on two trending levels and the machinery happily reports causality between independent random walks - the spurious regression problem wearing a forecasting costume. The standard workflow differences or detrends first, or tests for cointegration and moves to an error-correction form if the levels are bound together; the augmented Dickey-Fuller page on this site is the natural preceding step.

There is a subtler failure in the other direction: over-differencing a stationary series manufactures moving-average errors that can mimic or mask Granger patterns. The test is a sharp instrument with a narrow handle - stationary inputs, a defensible lag order, and a verdict stated as prediction rather than mechanism.

Reading the verdict

A rejection says the restricted model is leaving forecastable structure unexploited, at the stated lag order, in this sample. It does not say the relationship is stable, economic in size, or exploitable after costs - the F statistic measures statistical, not practical, significance, and at large samples trivial improvements reject. Read the RSS reduction alongside: the first example's 20-point cut on a base of 120 is material; a rejection built on a 1% RSS improvement at n of 200 is a fact about the sample size as much as about the world.

Run in both directions, the test maps the feedback structure between two series - one-way, two-way or none - which is often the real research question. The calculator is built for that loop: cheap to run, explicit about its degrees of freedom, and honest about what its name promises.

The test's two-directional use produces the field's standard taxonomy, and it is worth being precise about its four cells. X Granger-causes Y alone: one-way predictive flow, the leading-indicator case. Y Granger-causes X alone: the reverse. Both: feedback, the signature of two series inside one dynamic system, common in macroeconomics where policy reacts to the variable it targets. Neither: whatever association the series show is contemporaneous or driven from outside the pair. The first example's F of 5.40 settles only the first cell's question; the taxonomy is completed by running the calculator again with the roles exchanged.

Sample discipline matters as much as the formula. The test compares nested models on identical data; if the restricted and unrestricted regressions are run over different spans - a common accident when lags eat initial observations unevenly - the RSS values stop being comparable and the F statistic becomes meaningless. The inputs this page asks for assume the two sums of squares came from the same n observations, which is why the observation count is entered once and the degrees of freedom are derived, not requested.

There is a multivariate shadow over every pairwise run of this test. X may appear to Granger-cause Y only because a third series drives both with different delays, and the pairwise test has no way to refuse the credit. The remedy is the conditional version - the same F comparison inside a system that includes the third series - and the calculator's restricted/unrestricted framing generalises to it directly: the restricted model simply carries the third variable's lags in both regressions. A pairwise rejection, like the first example's p-value of 0.0005, is therefore best reported as predictive content within the pair, pending the conditional check.

FAQs

What F statistic does the first worked example give?

5.40, from an RSS improvement of 120 to 100 over four lags, on 4 and 108 degrees of freedom.

What is its p-value?

0.0005 - the lags of X carry clear predictive content for Y in that example.

What are the degrees of freedom in the first example?

4 / 108: the lag count over n minus the unrestricted parameter count, 120 - 12.

What F does the second example give?

0.64. The RSS improvement from 85.5 to 84 is within what chance alone delivers.

What is the second example's p-value?

0.5288 - no evidence of Granger causality at any conventional level.

What F does the third example give?

7.67 on 6 and 184 degrees of freedom, with a p-value below 0.0001 - the strongest predictive showing of the three.

Sources

Related calculators

Augmented Dickey-Fuller Test Calculator
Judge an augmented Dickey-Fuller unit-root statistic against Fuller's tabulated critical values for your sample size and deterministic specification, interpolated in 1/T.
Correlation Coefficient Calculator
Pearson's r for up to six paired observations, with r² and the deviation sums shown — the full workings, not just the headline number.
Runs Test (Wald-Wolfowitz) Calculator
The Wald-Wolfowitz runs test for randomness of a two-kind sequence: the z statistic from the runs count and the two group sizes, with expected runs and the continuity-corrected z.