0% found this document useful (0 votes)
23 views6 pages

Tsvargranger

This document describes the vargranger command in Stata, which performs Granger causality tests after fitting a vector autoregression model. The command provides Wald tests for each equation in the VAR to test if other variables Granger-cause the dependent variable. Examples show how to use vargranger on VAR and SVAR results and how the tests it produces can also be obtained using the test command.

Uploaded by

123456789brunito
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views6 pages

Tsvargranger

This document describes the vargranger command in Stata, which performs Granger causality tests after fitting a vector autoregression model. The command provides Wald tests for each equation in the VAR to test if other variables Granger-cause the dependent variable. Examples show how to use vargranger on VAR and SVAR results and how the tests it produces can also be obtained using the test command.

Uploaded by

123456789brunito
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Title stata.

com
vargranger — Pairwise Granger causality tests after var or svar

Description Quick start Menu Syntax


Options Remarks and examples Stored results Methods and formulas
References Also see

Description
vargranger performs a set of Granger causality tests for each equation in a VAR, providing a
convenient alternative to test; see [R] test.

Quick start
Perform a Granger causality test after var or svar
vargranger
Perform a Granger causality test on vector autoregression estimation results stored as myest
vargranger, estimates(myest)

Menu
Statistics > Multivariate time series > VAR diagnostics and tests > Granger causality tests

1
2 vargranger — Pairwise Granger causality tests after var or svar

Syntax
 
vargranger , estimates(estname) separator(#)

vargranger can be used only after var or svar; see [TS] var and [TS] var svar.
collect is allowed; see [U] 11.1.10 Prefix commands.

Options
estimates(estname) requests that vargranger use the previously obtained set of var or svar
estimates stored as estname. By default, vargranger uses the active results. See [R] estimates
for information on manipulating estimation results.
separator(#) specifies how often separator lines should be drawn between rows. By default, separator
lines appear every K lines, where K is the number of equations in the VAR under analysis. For
example, separator(1) would draw a line between each row, separator(2) between every
other row, and so on. separator(0) specifies that lines not appear in the table.

Remarks and examples stata.com


After fitting a VAR, we may want to know whether one variable “Granger-causes” another
(Granger 1969). A variable x is said to Granger-cause a variable y if, given the past values of y ,
past values of x are useful for predicting y . A common method for testing Granger causality is to
regress y on its own lagged values and on lagged values of x and test the null hypothesis that the
estimated coefficients on the lagged values of x are jointly zero. Failure to reject the null hypothesis
is equivalent to failing to reject the hypothesis that x does not Granger-cause y .
For each equation and each endogenous variable that is not the dependent variable in that equation,
vargranger computes and reports Wald tests that the coefficients on all the lags of an endogenous
variable are jointly zero. For each equation in a VAR, vargranger tests the hypotheses that each of
the other endogenous variables does not Granger-cause the dependent variable in that equation.
Because it may be interesting to investigate these types of hypotheses by using the VAR that
underlies an SVAR, vargranger can also produce these tests by using the e() results from an svar.
When vargranger uses svar e() results, the hypotheses concern the underlying var estimates.
See [TS] var and [TS] var svar for information about fitting VARs and SVARs in Stata. See
Lütkepohl (2005), Hamilton (1994), and Amisano and Giannini (1997) for information about Granger
causality and on VARs and SVARs in general.
vargranger — Pairwise Granger causality tests after var or svar 3

Example 1: After var


Here we refit the model with German data described in [TS] var and then perform Granger causality
tests with vargranger.
. use https://www.stata-press.com/data/r18/lutkepohl2
(Quarterly SA West German macro data, Bil DM, from Lutkepohl 1993 Table E.1)
. var dln_inv dln_inc dln_consump if qtr<=tq(1978q4), dfk small
(output omitted )
. vargranger
Granger causality Wald tests

Equation Excluded F df df_r Prob > F

dln_inv dln_inc .04847 2 66 0.9527


dln_inv dln_consump 1.5004 2 66 0.2306
dln_inv ALL 1.5917 4 66 0.1869

dln_inc dln_inv 1.7683 2 66 0.1786


dln_inc dln_consump 1.7184 2 66 0.1873
dln_inc ALL 1.9466 4 66 0.1130

dln_consump dln_inv .97147 2 66 0.3839


dln_consump dln_inc 6.1465 2 66 0.0036
dln_consump ALL 3.7746 4 66 0.0080

Because the estimates() option was not specified, vargranger used the active e() results.
Consider the results of the three tests for the first equation. The first is a Wald test that the coefficients
on the two lags of dln inc that appear in the equation for dln inv are jointly zero. The null
hypothesis that dln inc does not Granger-cause dln inv cannot be rejected. Similarly, we cannot
reject the null hypothesis that the coefficients on the two lags of dln consump in the equation for
dln inv are jointly zero, so we cannot reject the hypothesis that dln consump does not Granger-
cause dln inv. The third test is with respect to the null hypothesis that the coefficients on the two
lags of all the other endogenous variables are jointly zero. Because this cannot be rejected, we cannot
reject the null hypothesis that dln inc and dln consump, jointly, do not Granger-cause dln inv.
Because we failed to reject most of these null hypotheses, we might be interested in imposing
some constraints on the coefficients. See [TS] var for more on fitting VAR models with constraints
on the coefficients.
4 vargranger — Pairwise Granger causality tests after var or svar

Example 2: Using test instead of vargranger


We could have used test to compute these Wald tests, but vargranger saves a great deal of
typing. Still, seeing how to use test to obtain the results reported by vargranger is useful.
. test [dln_inv]L.dln_inc [dln_inv]L2.dln_inc
( 1) [dln_inv]L.dln_inc = 0
( 2) [dln_inv]L2.dln_inc = 0
F( 2, 66) = 0.05
Prob > F = 0.9527
. test [dln_inv]L.dln_consump [dln_inv]L2.dln_consump, accumulate
( 1)[dln_inv]L.dln_inc = 0
( 2)[dln_inv]L2.dln_inc = 0
( 3)[dln_inv]L.dln_consump = 0
( 4)[dln_inv]L2.dln_consump = 0
F( 4, 66) = 1.59
Prob > F = 0.1869
. test [dln_inv]L.dln_inv [dln_inv]L2.dln_inv, accumulate
( 1) [dln_inv]L.dln_inc = 0
( 2) [dln_inv]L2.dln_inc = 0
( 3) [dln_inv]L.dln_consump = 0
( 4) [dln_inv]L2.dln_consump = 0
( 5) [dln_inv]L.dln_inv = 0
( 6) [dln_inv]L2.dln_inv = 0
F( 6, 66) = 1.62
Prob > F = 0.1547

The first two calls to test show how vargranger obtains its results. The first test reproduces
the first test reported for the dln inv equation. The second test reproduces the ALL entry for the
first equation. The third test reproduces the standard F statistic for the dln inv equation, reported
in the header of the var output in the previous example. The standard F statistic also includes the
lags of the dependent variable, as well as any exogenous variables in the equation. This illustrates
that the test performed by vargranger of the null hypothesis that the coefficients on all the lags of
all the other endogenous variables are jointly zero for a particular equation; that is, the All test is
not the same as the standard F statistic for that equation.
vargranger — Pairwise Granger causality tests after var or svar 5

Example 3: After svar


When vargranger is run on svar estimates, the null hypotheses are with respect to the underlying
var estimates. We run vargranger after using svar to fit an SVAR that has the same underlying
VAR as our model in example 1.
. matrix A = (., 0,0 \ ., ., 0\ .,.,.)
. matrix B = I(3)
. svar dln_inv dln_inc dln_consump if qtr<=tq(1978q4), dfk small aeq(A) beq(B)
(output omitted )
. vargranger
Granger causality Wald tests

Equation Excluded F df df_r Prob > F

dln_inv dln_inc .04847 2 66 0.9527


dln_inv dln_consump 1.5004 2 66 0.2306
dln_inv ALL 1.5917 4 66 0.1869

dln_inc dln_inv 1.7683 2 66 0.1786


dln_inc dln_consump 1.7184 2 66 0.1873
dln_inc ALL 1.9466 4 66 0.1130

dln_consump dln_inv .97147 2 66 0.3839


dln_consump dln_inc 6.1465 2 66 0.0036
dln_consump ALL 3.7746 4 66 0.0080

As we expected, the vargranger results are identical to those in the first example.

Stored results
vargranger stores the following in r():
Matrices
r(gstats) χ2 , df, and p-values (if e(small)=="")
r(gstats) F , df, df r, and p-values (if e(small)!="")

Methods and formulas


vargranger uses test to obtain Wald statistics of the hypothesis that all coefficients on the
lags of variable x are jointly zero in the equation for variable y . vargranger uses the e() results
stored by var or svar to determine whether to calculate and report small-sample F statistics or
large-sample χ2 statistics.


Clive William John Granger (1934–2009) was born in Swansea, Wales, and earned degrees
in mathematics and statistics at the University of Nottingham. Joining the staff there, he also
worked at Princeton on the spectral analysis of economic time series before moving in 1974 to
the University of California, San Diego. He was awarded the 2003 Nobel Prize in Economics
for methods of analyzing economic time series with common trends (cointegration). He was
knighted in 2005, thus becoming Sir Clive Granger.
 
6 vargranger — Pairwise Granger causality tests after var or svar

References
Amisano, G., and C. Giannini. 1997. Topics in Structural VAR Econometrics. 2nd ed, revised and enlarged. Heidelberg:
Springer.
Baum, C. F., S. Hurn, and J. Otero. 2022. Testing for time-varying Granger causality. Stata Journal 22: 355–378.
Granger, C. W. J. 1969. Investigating causal relations by econometric models and cross-spectral methods. Econometrica
37: 424–438. https://doi.org/10.2307/1912791.
Hamilton, J. D. 1994. Time Series Analysis. Princeton, NJ: Princeton University Press.
Lopez, L., and S. Weber. 2017. Testing for Granger causality in panel data. Stata Journal 17: 972–984.
Lütkepohl, H. 1993. Introduction to Multiple Time Series Analysis. 2nd ed. New York: Springer.
. 2005. New Introduction to Multiple Time Series Analysis. New York: Springer.
Phillips, P. C. B. 1997. The ET Interview: Professor Clive Granger. Econometric Theory 13: 253–303.
https://doi.org/10.1017/S0266466600005740.
Rossi, B., and Y. Wang. 2019. Vector autoregressive-based Granger causality test in the presence of instabilities. Stata
Journal 19: 883–899.
Schenck, D. 2016. Vector autoregressions in Stata. The Stata Blog: Not Elsewhere Classified.
http://blog.stata.com/2016/08/09/vector-autoregressions-in-stata/.
Tastan, H. 2015. Testing for spectral Granger causality. Stata Journal 15: 1157–1166.

Also see
[TS] var — Vector autoregressive models
[TS] var intro — Introduction to vector autoregressive models
[TS] var svar — Structural vector autoregressive models
[TS] varbasic — Fit a simple VAR and graph IRFs or FEVDs

Stata, Stata Press, and Mata are registered trademarks of StataCorp LLC. Stata and
®
Stata Press are registered trademarks with the World Intellectual Property Organization
of the United Nations. Other brand and product names are registered trademarks or
trademarks of their respective companies. Copyright c 1985–2023 StataCorp LLC,
College Station, TX, USA. All rights reserved.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy