**[TS] irf graph** -- Graphs of IRFs, dynamic-multiplier functions, and FEVDs

__Syntax__

**irf** __g__**raph** *stat* [**,** *options*]

*stat* Description
-----------------------------------------------------------------------
Main
**irf** impulse-response function
**oirf** orthogonalized impulse-response function
**dm** dynamic-multiplier function
**cirf** cumulative impulse-response function
**coirf** cumulative orthogonalized impulse-response function
**cdm** cumulative dynamic-multiplier function
**fevd** Cholesky forecast-error variance decomposition
**sirf** structural impulse-response function
**sfevd** structural forecast-error variance decomposition
-----------------------------------------------------------------------
Notes: (1) No statistic may appear more than once.
(2) If confidence intervals are included (the default), only two
statistics may be included.
(3) If confidence intervals are suppressed (option **noci**), up to
four statistics may be included.

*options* Description
-------------------------------------------------------------------------
Main
**set(***filename***)** make *filename* active
__ir__**f(***irfnames***)** use *irfnames* IRF result sets
__i__**mpulse(***impulsevar***)** use *impulsevar* as impulse variables
__r__**esponse(***endogvars***)** use endogenous variables as response
variables
**noci** suppress confidence bands
__l__**evel(***#***)** set confidence level; default is
**level(95)**
__lst__**ep(***#***)** use *#* for first step
__ust__**ep(***#***)** use *#* for maximum step

Advanced
__in__**dividual** graph each combination individually
**iname(***namestub* [**,** **replace**]**)** stub for naming the individual graphs
__isa__**ving(***filename**stub* [**,** **replace**]**)** stub for saving the individual graphs
to files

Plots
__plot____#__**opts(***cline_options***)** affect rendition of the line plotting
the *#* *stat*

CI plots
__ci____#__**opts(***area_options***)** affect rendition of the confidence
interval for the *#* *stat*

Y axis, X axis, Titles, Legend, Overall
*twoway_options* any options other than **by()**
documented in **[G-3]** *twoway_options*
__byop__**ts(***by_option***)** how subgraphs are combined, labeled,
etc.
-------------------------------------------------------------------------

__Menu__

**Statistics > Multivariate time series > IRF and FEVD analysis >** **Graphs by**
**impulse or response**

__Description__

**irf graph** graphs impulse-response functions (IRFs), dynamic-multiplier
functions, and forecast-error variance decompositions (FEVDs) over time.

__Options__

+------+
----+ Main +-------------------------------------------------------------

**set(***filename***)** specifies the file to be made active; see **[TS] irf set**. If
**set()** is not specified, the active file is used.

**irf(***irfnames***)** specifies the IRF result sets to be used. If **irf()** is not
specified, each of the results in the active IRF file is used.
(Files often contain just one set of IRF results saved under one
*irfname*; in that case, those results are used.)

**impulse(***impulsevars***)** and **response(***endogvars***)** specify the impulse and
response variables. Usually one of each is specified, and one graph
is drawn. If multiple variables are specified, a separate subgraph
is drawn for each impulse-response combination. If **impulse()** and
**response()** are not specified, subgraphs are drawn for all
combinations of impulse and response variables.

*impulsevar* should be specified as an endogenous variable for all
statistics except **dm** or **cdm**; for those, specify as an exogenous
variable.

**noci** suppresses graphing the confidence interval for each statistic.
**noci** is assumed when the model was fit by **vec** because no confidence
intervals were estimated.

**level(***#***)** specifies the default confidence level, as a percentage, for
confidence intervals, when they are reported. The default is
**level(95)** or as set by **set level**. Also see **[TS] irf cgraph** for a
graph command that allows the confidence level to vary over the
graphs.

**lstep(***#***)** specifies the first step, or period, to be included in the
graphs. **lstep(0)** is the default.

**ustep(***#***)**, *#* __>__ 1, specifies the maximum step, or period, to be included in
the graphs.

+----------+
----+ Advanced +---------------------------------------------------------

**individual** specifies that each graph be displayed individually. By
default, **irf graph** combines the subgraphs into one image. When
**individual** is specified, **byopts()** may not be specified, but the
**isaving()** and **iname()** options may be specified.

**iname(***namestub* [**, replace**]**)** specifies that the ith individual graph be
stored in memory under the name *namestubi*, which must be a valid
Stata name of 24 characters or fewer. **iname()** may be specified only
with the **individual** option.

**isaving(***filename**stub* [**, replace**]**)** specifies that the ith individual graph
should be saved to disk in the current working directory under the
name *filenamestubi***.gph**. **isaving()** may be specified only when the
**individual** option is also specified.

+-------+
----+ Plots +------------------------------------------------------------

**plot1opts(***cline_options***)**, ..., **plot4opts(***cline_options***)** affect the
rendition of the plotted statistics (the *stat*). **plot1opts()** affects
the rendition of the first statistic; **plot2opts()**, the second; and so
on. *cline_options* are as described in **[G-3]** *cline_options*.

+----------+
----+ CI plots +---------------------------------------------------------

**ci1opts(***area_options***)** and **ci2opts(***area_options***)** affect the affect the
rendition of the confidence intervals for the first (**ci1opts()**) and
second (**ci2opts()**) statistics in *stat*. *area_options* are as described
in **[G-3]** *area_options*.

+-----------------------------------------+
----+ Y axis, X axis, Titles, Legend, Overall +--------------------------

*twoway_options* are any of the options documented in **[G-3]** *twoway_options*,
excluding **by()**. These include options for titling the graph (see
**[G-3]** *title_options*) and for saving the graph to disk (see **[G-3]**
*saving_option*). The **saving()** and **name()** options may not be combined
with the **individual** option.

**byopts(***by_option***)** is as documented in **[G-3]** *by_option* and may not be
specified when **individual** is specified. **byopts()** affects how the
subgraphs are combined, labeled, etc.

__Examples__

Setup
**. webuse lutkepohl2**

Fit vector error-correction model
**. var dln_inv dln_inc dln_consump if qtr<=tq(1978q4),** **lags(1/2) dfk**

Estimate IRFs and FEVDs and save under **order1** in **myirf1**
**. irf create order1, step(10) set(myirf1, replace)**

Graph the orthogonalized impulse-response function, using **dln_inc** as the
impulse variable and **dln_consump** as the response variable
**. irf graph oirf, impulse(dln_inc) response(dln_consump)**

Same as above, but use 1 for the first step
**. irf graph oirf, impulse(dln_inc) response(dln_consump)** **lstep(1)**

__Stored results__

**irf graph** stores the following in **r()**:

Scalars
**r(k)** number of graphs

Macros
**r(stats)** *statlist*
**r(irfname)** *resultslist*
**r(impulse)** *impulselist*
**r(response)** *responselist*
**r(plot***#***)** contents of **plot***#***opts()**
**r(ci)** level applied to confidence intervals or **noci**
**r(ciopts***#***)** contents of **ci***#***opts()**
**r(byopts)** contents of **byopts()**
**r(saving)** supplied **saving()** option
**r(name)** supplied **name()** option
**r(individual)** **individual** or blank
**r(isaving)** contents of **saving()**
**r(iname)** contents of **name()**
**r(subtitle***#***)** subtitle for individual graph *#*