**[TS] varbasic** -- Fit a simple VAR and graph IRFs and FEVDs

__Syntax__

**varbasic** *depvarlist* [*if*] [*in*] [**,** *options*]

*options* Description
-------------------------------------------------------------------------
Main
__la__**gs(***numlist***)** use *numlist* lags in the model; default is **lags(1 2)**
__i__**rf** produce matrix graph of IRFs
__f__**evd** produce matrix graph of FEVDs
__nog__**raph** do not produce a graph
__s__**tep(***#***)** set forecast horizon *#* for estimating the OIRFs, IRFs,
and FEVDs; default is **step(8)**
-------------------------------------------------------------------------
You must **tsset** your data before using **varbasic**; see **[TS] tsset**.
*depvarlist* may contain time-series operators; see tsvarlist.
**rolling**, **statsby**, and **xi** are allowed; see prefix.
See **[TS] varbasic postestimation** for features available after estimation.

__Menu__

**Statistics > Multivariate time series > Basic VAR**

__Description__

**varbasic** fits a basic vector autoregressive (VAR) model and graphs the
impulse-response functions (IRFs), the orthogonalized impulse-response
functions (OIRFs), or the forecast-error variance decompositions (FEVDs).

__Options__

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

**lags(***numlist***)** specifies the lags to be included in the model. The
default is **lags(1 2)**. This option takes a numlist and not simply an
integer for the maximum lag. For instance, **lags(2)** would include
only the second lag in the model, whereas **lags(1/2)** would include
both the first and second lags in the model. See *numlist* and
tsvarlist for a more discussion of numlists and lags.

**irf** causes **varbasic** to produce a matrix graph of the IRFs instead of a
matrix graph of the OIRFs, which is produced by default.

**fevd** causes **varbasic** to produce a matrix graph of the FEVDs instead of a
matrix graph of the OIRFs, which is produced by default.

**nograph** specifies that no graph be produced. The IRFs, OIRFs, and FEVDs
are still estimated and saved in the IRF file **_varbasic.irf**.

**step(***#***)** specifies the forecast horizon for estimating the IRFs, OIRFs,
and FEVDs. The default is eight periods.

__Examples__

Setup
**. webuse lutkepohl2**

Fit a VAR model and graph OIRFs
**. varbasic dln_inv dln_inc dln_consump**

Same as above, but restrict to specified time period
**. varbasic dln_inv dln_inc dln_consump if qtr<=tq(1978q4)**

Same as above, but use 10 as the forecast horizon
**. varbasic dln_inv dln_inc dln_consump if qtr<=tq(1978q4),** **step(10)**

Fit a VAR model and graph IRFs
**. varbasic dln_inv dln_inc dln_consump if qtr<=tq(1978q4),** **irf**

Same as above, but include the first, second, and third lags in the model
**. varbasic dln_inv dln_inc dln_consump if qtr<=tq(1978q4),** **irf**
**lags(1/3)**

Fit a VAR model and graph FEVDs
**. varbasic dln_inv dln_inc dln_consump if qtr<=tq(1978q4),** **fevd**

__Stored results__

See *Stored results* in **[TS] var**.