Help for lpgraph

Description

lpgraph plots together the results of previously estimated IRFs of more than one model into one graph. The graph can include up to 3 IRFs.
It can also generate 3 separate IRF graphs and combine them in one in the same fashion as the command grah combine.

The first option is convenient when we want to have a graph in which we compare the magnitude of the different IRFs, since they share
the same axis.

The second option is more convenient when you want to create separate IRF graphs of previously estimated and saved results, and then combine them into a single graph.

lpgraph is a post-estimation command, and it uses the IRFs results saved as variables by the command locproj, which saves the IRF,
its standard error and its confidence bands using the name defined by the user through the options saveirf and irfname().

The command lpgraph can also be used to combine IRF results from other estimation methods, such as VAR, SVAR, arima, etc., as long as the results
of those commands are saved with the same name structure in which locproj saves the IRFs results.

Syntax

lpgraph irfname1 irfname2 irfname3
,
[ hor(numlist integer) zero title(string) ttitle(string) ytitle(string)} separate
ti1(string) ti2(string) ti3(string)
lab1(string) lab2(string) lab3(string)
lc1(string) lc2(string) lc3(string)
nolegend
grname(string) grsave(string)
as(string) other_options]

Options

hor(numlist/integer) Specifies the number of steps or horizon length for the IRF.
It can be specified either as a range (e.g. hor(0/6) or hor(1/6)), or just as the final horizon period (e.g. hor(6))
in which case the command assumes the horizon starts at period 0 and ends in period 6. The default horizon range is hor = 0,...,5
if nothing is specified.

separate If this option is specified, each IRF is plotted in a separate graph, and then all of them are combined in a new one,
in the same fashion as if we were combining them by using the command graph combine. The only difference of using the option separate
and the command graph combine is that lpgraph will first generate new graphs for each IRF.

zero If this option is specified the graph(s) includes a dashed line for the value 0.

title(string) Specifies a title for the final graph.

ti#(string) Specifies a title for each one of the 3 separated graphs, e.g. ti1(Title A), ti2(Title B), ti3(Title C).

lc#(string) Specifies a color for the IRF line and confidence bands of each one of the 3 IRFs,
e.g. lc1(gray), lc2(green), lc3(blue).

lcolor(string) Specifies a unique color for the IRF line and the confidence bands of each one of the separated graphs.

lab#(string) Specifies a label for each one of the IRFs, e.g. lab1(Label A), lab2(Label B), lab3(Label C).

nolegend Specifies that legends should not be shown. It could be useful if you have separated graphs and each one of
them has a title.

ttitle(string) Specifies a name for the time axis in the IRF graph.

grname(string) Specifies a graph name that could be used, for instance, when combining various graphs.

grsave(string) Specifies a file name and path that should be used to save the IRF graph on the disk.

as(string) Specifies the desired file format of the saved graph.

other_options Specifies any other graph options not defined elsewhere. The user just need to enter any other graph option not included
in the list before alongside the rest of lpgraph options.

combine(string) Specifies any other options specific to the grah combine command not defined elsewhere. The user just need to enter any other graph combine option not included before inside the option parenthesis.

Example 1. Creating one graph with various IRFs

. use AED_INTERESTRATES.dta

First, we are going to estimate 3 different IRFs, the first one is a model in levels, the second one uses cumulative changes and the third one
includes a cuadratic term in the shock. We do not generate graphs (nograph) and we save the IRFs giving each one a different name
(e.g. level, cmlt, cuad):

. locproj gs10 l(0/4).gs1, h(12) m(newey) hopt(lag) yl(3) nograph save irfn(level)

. locproj gs10 l(0/4).gs1, h(12) m(newey) hopt(lag) yl(3) tr(cmlt) nograph save irfn(cmlt)

. locproj gs10, shock(gs1 c.gs1#c.gs1) m(newey) hopt(lag) yl(3) sl(4) h(12) nograph save irfn(cuad)

Second, we are going to create one graph with the 3 IRFs plotted together.

. lpgraph level cmlt cuad, h(12) tti(Number of Days) lab1(Levels) lab2(Cumulative) lab3(Cuadratic) title(1-Year Treasury IRF, size(*0.9))

In this case we have the option of choosing the color of each one of the IRFs:

. lpgraph level cmlt cuad, h(12) tti(Number of Days) lab1(Levels) lab2(Cumulative) lab3(Cuadratic) lc1(red) lc2(brown) lc3(blue) title(1-Year Treasury IRF, size(*0.9))

Example 2. Creating separate graphs and combining them into a single one

We are going to create three separate graphs and then combine them into a single one. For doing so, we need to specify the option
separate. In this case, we are giving each separate graph a title, and therefore, we also specify the option nogelend.
Additionally, we are choosing the color red for the IRFs lines of the three graphs:

. lpgraph level cmlt cuad, h(12) tti(Number of Days) ti1("1-Year Treasury IRF // Levels") ti2("1-Year Treasury IRF // Cumulative") ti3("1-Year Treasury IRF // Cuadratic") separate nolegend lcolor(red)

Author

Alfonso Ugarte-Ruiz
alfonso.ugarte@bbva.com