Home  /  Products  /  StataNow  /  Instrumental-variables local-projection IRFs

<- See more new Stata features

Highlights

  • Local projections using instrumental variables

  • Simple and cumulative structural IRFs

  • Single and joint estimation of IRFs

  • Compare model results with the irf suite

  • Tabulate or graph impulse responses with irf table and irf graph

  • See more time-series features

With the new ivlpirf command, you can account for endogeneity when using local projections to estimate dynamic causal effects. This command is part of StataNow™.

Local projections are a method for estimating dynamic causal effects, which measure the effect of a shock to one variable on one or more outcomes over time. These causal effects are also called structural IRFs.

What if the shock of interest is to an endogenous variable? Estimation of the IRFs must account for the endogeneity. When an instrument is available, the instrumental-variables local-projection method can untangle the causal effects.

Let's see it work

We have monthly data on industrial production growth, inflation, and the interest rate in the United States from 1969 to 2019.

. webuse usmacro3
(Federal Reserve Economic Data - St. Louis Fed, 2023-09-01)

. describe

Contains data from https://www.stata-press.com/data/r18/usmacro3.dta
 Observations:           785                  Federal Reserve Economic Data -
                                                St. Louis Fed, 2023-09-01
    Variables:             6                  13 Mar 2024 12:08

Variable Storage Display Value
name type format label Variable label
datem int %tm Monthly date ip_growth float %9.0g * Monthly industrial production growth rate inflation float %9.0g * Monthly inflation rate fedfunds float %9.0g Federal funds rate oil_inst float %9.0g Annual net oil price increase money_inst double %9.0g * Romer and Romer (2004) monetary shocks * indicated variables have notes
Sorted by: datem

We are interested in the effect of an unexpected increase in interest rates (fedfunds) on industrial production growth (ip_growth) and inflation (inflation). We are concerned that the interest rate is endogenous: changes in interest rates affect other economic variables, but the interest rate itself responds to those same economic variables. We need to acount for this potential endogeneity to reliability estimate the effects of the shock to interest rates; an instrumental-variables approach allows us to do this. We have an instrument, money_inst, that isolates exogenous changes to the interest rate. We can use the new ivlpirf command to estimate structural IRFs for the effects of an interest rate increase on industrial production growth response, using money_inst as an instrument for the endogenous impulse change in interest rate (d.fedfunds):

. ivlpirf ip_growth , endogenous(d.fedfunds = money_inst)

Step 1:
Iteration 0:  GMM criterion Q(b) =  .22620934  
Iteration 1:  GMM criterion Q(b) =  1.336e-32  
Iteration 2:  GMM criterion Q(b) =  1.500e-34  

Step 2:
Iteration 0:  GMM criterion Q(b) =  3.122e-34  
Iteration 1:  GMM criterion Q(b) =  2.535e-34  

note: model is exactly identified.

Instrumental-variables local-projection impulse responses

Sample: 1969m1 thru 2007m12                                Number of obs = 468

 ( 1)  [D.fedfunds]D.fedfunds = 1

IRF Robust
coefficient std. err. z P>|z| [95% conf. interval]
ip_growth
--. .3902078 .2381631 1.64 0.101 -.0765833 .8569989
F1. .3610046 .3089668 1.17 0.243 -.2445592 .9665685
F2. .1629727 .2189905 0.74 0.457 -.2662408 .5921862
F3. -.0997817 .1333441 -0.75 0.454 -.3611313 .1615678
F4. -.1677662 .1170584 -1.43 0.152 -.3971965 .061664
fedfunds
D1. 1 (constrained)
FD. 1.476712 .5963349 2.48 0.013 .3079167 2.645506
F2D. .3870066 .3807016 1.02 0.309 -.3591549 1.133168
F3D. -.1729338 .2029923 -0.85 0.394 -.5707913 .2249238
F4D. -.3460389 .1569646 -2.20 0.027 -.6536839 -.0383939
Note: Structural impulse–response functions are reported. Impulse: D.fedfunds Responses: ip_growth D.fedfunds Instrument: money_inst Controls: L.ip_growth L2.ip_growth LD.fedfunds L2D.fedfunds

The output table displays IRF coefficients for the effect on impact (labeled --.) and for four periods after impact (labeled F1. through F4.). With an IRF coefficient of 0.39, we see that instustrial production growth on impact, but we do not have evidence that the effect is different from zero. It might take time for the effects of an interest rate change to be seen in industrial production, so longer horizons could be necessary to view the effect. The interest rate response is normalized to 1 on impact. The interest rate enters the model measured in changes (D.fedfunds), so subsequent coefficients on fedfunds are also changes. The change in interest rate rises by 1 percentage point on impact by construction, then changes in the same direction by 1.48 percentage points in the subsequent period, and so on.

The estimates above display IRFs that are expressed in the units of the variables—in this case, growth rates. We might also be interested in the cumulative response, which can be interpreted as the change in the level of the variable and can be calculated by summing the responses of the growth rates. ivlpirf supports this calculation with the cumulative option. Below, we specify ivlpirf with the cumulative option to report cumulative IRFs. We also compute the effects on two response variables (ip_growth and inflation) simultaneously.

. ivlpirf ip_growth inflation, endogenous(d.fedfunds = money_inst) cumulative

Step 1:
Iteration 0:  GMM criterion Q(b) =  1.8287366  
Iteration 1:  GMM criterion Q(b) =  1.742e-32  
Iteration 2:  GMM criterion Q(b) =  7.589e-33  

Step 2:
Iteration 0:  GMM criterion Q(b) =  2.793e-32  
Iteration 1:  GMM criterion Q(b) =  1.989e-32  

note: model is exactly identified.

Instrumental-variables local-projection impulse responses

Sample: 1969m1 thru 2007m12                                Number of obs = 468

 ( 1)  [D.fedfunds]D.fedfunds = 1

IRF Robust
coefficient std. err. z P>|z| [95% conf. interval]
ip_growth
--. .3767377 .2067382 1.82 0.068 -.0284617 .7819371
F1. .725611 .4473294 1.62 0.105 -.1511386 1.60236
F2. .8729816 .5831643 1.50 0.134 -.2699994 2.015963
F3. .7572531 .6219763 1.22 0.223 -.4617981 1.976304
F4. .5751773 .567312 1.01 0.311 -.5367338 1.687088
inflation
--. .0725715 .0391172 1.86 0.064 -.0040968 .1492398
F1. .1381907 .0682327 2.03 0.043 .0044571 .2719243
F1. .2424316 .0933341 2.60 0.009 .0595001 .425363
F1. .4166317 .1646479 2.53 0.011 .0939278 .7393355
F1. .505858 .2142514 2.36 0.018 .085933 .925783
fedfunds
D1. 1 (constrained)
FD. 2.481322 .5854004 4.24 0.000 1.333959 3.628686
F2D. 2.867292 .8518579 3.37 0.001 1.197681 4.536903
F3D. 2.696978 .9320981 2.89 0.004 .8700996 4.523857
F4D. 2.354742 .8938336 2.63 0.008 .6028599 4.106623
Note: Cumulative structural impulse–response functions are reported. Impulse: D.fedfunds Responses: ip_growth inflation D.fedfunds Instrument: money_inst Controls: L.ip_growth L2.ip_growth L.inflation L2.inflation LD.fedfunds L2D.fedfunds

The coefficient table now displays the cumulative IRFs. They can be interpreted as the responses of industrial production (not industrial production growth), of price (not price inflation), and of interest rate (not change in interest rate) to the shock.

Rather than estimating only the default 4 months of responses, let's use the step() option to estimate 3 years (36 months) of responses. Instead of looking at all of these cumulative IRFs in output table from ivlpirf, we will graph them using the irf commands.

 . quietly ivlpirf ip_growth inflation, endogenous(d.fedfunds = money_inst) cumulative step(36) lag(1/12)

. irf set ivlp.irf, replace
(file ivlp.irf created)
(file ivlp.irf now active)

. irf create ivlp
(file ivlp.irf updated)

. irf graph csirf, yline(0) xlabel(0(12)36) impulse(D.fedfunds)

In the fourth line, notice that we specified the csirf statistic, which requests cumulative structural IRFs. The resulting graphs plot the paths for industrial production, the price level, and the interest rate.

Each panel displays the cumulative response of a variable. The top-left panel shows the response of the interest rate to a shock to interest rate change: the interest rates rises and remains elevated for about one year before returning to its long-run level. The top-right panel shows the cumulative response of inflation, that is, the response of the price level. Prices do not change much for the first two years after the shock, but the response becomes negative by the third year after. The bottom-left panel shows the response of industrial production, which does not change much in the first year after the shock, but becomes negative in the second year, reaching a trough of about -4% after two years.

Tell me more

Read more in the Stata Time-Series Reference Manual; see [TS] ivlpirf.

View all the new features in Stata 18 and, in particular, New in time series.

Made for data science.

Get started today.