externalinstrument.Rd
Identify the impulse response for a VAR (using the VAR estimated from the vars package), using a high frequency instrument.
externalinstrument(var, instrument, dependent, p)
A varest var, or a dataframe of reduced form residuals.
A list containing the data for the instrument. Should be same length as the estimation sample.
Which variable in your var are you instrumenting (as a string).
(Integer) How many lags does your var have (only needed if supplying a dataframe instead of a varest).
library(vars)
#> Loading required package: MASS
#> Loading required package: strucchange
#> Loading required package: zoo
#>
#> Attaching package: ‘zoo’
#> The following objects are masked from ‘package:base’:
#>
#> as.Date, as.Date.numeric
#> Loading required package: sandwich
#> Loading required package: urca
#> Loading required package: lmtest
library(varexternalinstrument)
data(GKdata)
gkvar <- VAR(GKdata[, c("logip", "logcpi", "gs1", "ebp")], p = 12, type = "const")
shockcol <- externalinstrument(gkvar, GKdata$ff4_tc, "gs1")