*! version 1 03dec2020
help tvgc

Title

tvgc -- Time-Varying Granger Causality tests

Syntax

tvgc varlist [if] [in] [,
trend
prefix(string)
p(integer)
d(integer)
window(integer)
robust
matrix
boot(integer)
sizecontrol(integer)
seed(integer)
graph
eps
pdf
notitle
restab]

You must tsset your data before using tvgc; see [TS] tsset.

varlist contains the variables in the VAR or LA-VAR. tvgc tests whether the first variable in varlist is Granger-caused by the remaining variables.

The varlist can contain time-series operators. The sample may not contain gaps.

The moremata community-contributed package must be installed from the SSC Archive via ssc install moremata.

Description

tvgc implements the VAR-based time-varying Granger causality tests proposed by Shi, Phillips and Hurn (2018).
These are sequences of Wald statistics based on forward recursive estimation, rolling estimation, and recursive evolving estimation.
The command also supports estimation of these three sequences of Wald statistics in the context of a Lag-Augmented VAR (LA-VAR) model, as recommended to allow for the possibility of integrated variables;
see Shi, Hurn, Phillips (2020) and the references therein.

tvgc computes 90th, 95th, and 99th percentile bootstrap critical values following the bootstrap scheme advocated by Shi et al. (2018, 2020).

Options

trend includes a linear trend in the VAR (LA-VAR) model.

prefix can be used to provide a `stub' with which variables created in tvgc will be named.
If this option is given, three Stata variables will be created for the appropriate range of dates:
prefix_forward_varname, prefix_rolling_varname, prefix_recursive_varname. These variables must not already exist in memory.
These variables record the Wald statistics that result from estimating the VAR or LA-VAR model using forward recursive, rolling and recursive evolving windows.
The prefix option must be specified to enable the graph option, which includes 90th and 95th percentile bootstrap critical values in the plots.

p sets the number of lags in the VAR model. This can be determined using the Stata command [TS] varsoc.

d sets the number of lags in the lag-augmented part of the VAR model. This option must be used when there are integrated variables in the VAR model. See Toda and Yamamoto (1995) and Dolado and Lütkepohl (1996).

window specifies the initial window width used in forward recursive, rolling and recursive evolving windows estimation. If not specified, 20% of the number of available observations is used.

robust indicates that the Wald statistics should be computed using a heteroskedastic-robust specification of the variance-covariance matrix.

boot computes right-tail Monte Carlo critical values for 90, 95 and 99 percentiles based on the bootstrap advocated by Shi et al. (2018, 2020), using the specified number of replications.
If not provided, 199 replications are computed. No fewer than 20 replications are computed.
The bootstrap critical values can be replicated if the option seed is used.

sizecontrol specifies the number of periods included in the bootstrap critical values in order to control the size of the test. If not specified, 12 periods are used.

seed sets the seed for random number generation in the bootstrap results.

noprint specifies that detailed results are not to be printed.

graph, if combined with prefix, specifies that the timeseries with the sequences of Wald statistics should be graphed along with their 90% and 95% bootstrapped critical values. The graphs can be saved from the Graph window.

eps specifies that graphs are to be saved as .eps files as well as displayed in the Graph Window.

pdf specifies that graphs are to be saved as .pdf files as well as displayed in the Graph Window.

notitle specifies that graph titles are suppressed.

restab writes the results of tests and their 95th and 99th percentile values to a LaTeX table
as restab.tex. The file will be replaced if it exists. When including this fragment in a LaTeX
document, the booktabs package is required.

Example of use

We illustrate the use of the tvgc command using monthly data for the US economy
used in the Shi et al. (2018, 2020) articles. Their data, available online, was converted from MATLAB to Stata format and
placed with the Boston College Economics Stata datasets.

We being by loading the dataset using the command bcuse, available from the SSC Archive, and verifying that it is a time series:

. bcuse MoneyIncome

. tsset

We would like to test whether the logarithm of US industrial production (li) is Granger-caused
by the log of the money base (lm1), the log of the price index (lp) and the three-month Treasury bill interest rate (r).
The data span January 1959 to April 2014 and can be accessed from FRED with freduse.
The three time-varying Granger causality statistics are computed using a specification with p=2 lags and d=1 lag augmented in the LA-VAR model, including a trend.
The sequence of tests for the forward recursive, rolling window, and recursive evolving procedures run with 72 observations for the minimum window size; hence, we use the option win=72.
The bootstrapped critical values are obtained with the default number of 199 repetitions and size controlled over a one-year period; this means that we can use the dafault value of sizecontrol which is 12.

The prefix option is used to save the constructed test statistics as additional variables. This example should run in about 3-4 minutes.

. tvgc li lm1 lp r, p(2) d(1) trend win(72) prefix(_WALD) graph

The new variables _WALDforward_lm1, _WALDrolling_lm1, and _WALDrecursive_lm1 replicate, to a great degree of precision, the sequences of statistics plotted in Figures 2a, 2b 2c of Shi et al. (2020).
The bootstrapped critical values are not replicable because of random variation.

To replicate the sequences of statistics plotted in Figures 3a, 3c and 3e of Shi et al. (2020), we compute heteroskedasticity-robust version of the Wald statistics:

. tvgc li lm1 lp r, p(2) d(1) trend win(72) robust prefix(_WALDROB) graph

To replicate the sequences of statistics plotted in Figures 3b, 3d and 3f of Shi et al. (2020), size controlled over a five-year period. This example should run in about 15-18 minutes.

. tvgc li lm1 lp r, p(2) d(1) trend win(72) sizecontrol(60) prefix(_WALD5Y) graph

Stored results

tvgc stores the following in r():

Scalars

r(T) number of observations available for test statistics

r(p) maximum lag order in VAR/LA-VAR

r(d) lag augmentation in test

r(bootrepl) number of bootstrap replications

Macros

r(depvar) dependent variable

r(rhsvars) RHS variable list

r(cmdline) command line

r(cmd) tvgc

Matrices

r(gcres) matrix of test statistics

r(gccv90) matrix of bootstrap critical values, 90th percentile

r(gccv95) matrix of bootstrap critical values, 95th percentile

r(gccv99) matrix of bootstrap critical values, 99th percentile

References

Dolado, J. J., and H. Lütkepohl. 1996. Making Wald tests work for cointegrated VAR systems. Econometric Reviews 15: 369–386.

Shi, S., S. Hurn, P.C.B. Phillips. 2020. Causal change detection in possibly integrated systems: Revisiting the money-income relationship. Journal of Financial Econometrics 18: 158–180.

Shi, S., P.C.B. Phillips, S. Hurn. 2018. Change detection and the causal impact of the yield curve. Journal of Time Series Analysis 39: 966-987.

Toda, H. Y., and T. Yamamoto. 1995. Statistical inference in vector autoregressions with possibly integrated Processes. Journal of Econometrics 66: 225–250.

Authors

Christopher F. Baum

Boston College

Chestnut Hill, MA USA

baum@bc.edu

Jesús Otero

Universidad del Rosario

Bogotá, Colombia

jesus.otero@urosario.edu.co

Stan Hurn

Queensland University of Technology

Brisbane, Australia

s.hurn@qut.edu.au

Also see

Article: Stata Journal, volume 18, number 1: st0508_1,

Stata Journal, volume 17, number 4: st0508