Object Reference : Object View and Procedure Reference : Var
Vector autoregression and error correction object.
Var Declaration
var declare var estimation object .
To declare a var use the keyword var, followed by a name and, optionally, by an estimation specification:
var finvar
var empvar.ls 1 4 payroll hhold gdp
var finec.ec(e,2) 1 6 cp div r
Var Methods
bvar estimate a Bayesian VAR specification.
ec estimate a vector error correction model.
ls estimate an unrestricted VAR.
Var Views
arlm serial correlation LM test.
arroots inverse roots of the AR polynomial.
coint Johansen cointegration test.
correl residual autocorrelations.
display display table, graph, or spool in object window.
decomp variance decomposition.
endog table or graph of endogenous variables.
hdecomp perform historical decomposition for a standard VAR.
impulse impulse response functions.
jbera residual normality test.
label label information for the var object.
laglen lag order selection criteria.
output table of estimation results.
qstats residual portmanteau tests.
representations text describing var specification.
residcor residual correlation matrix.
residcov residual covariance matrix.
resids residual graphs.
results table of estimation results.
testexog exogeneity (Granger causality) tests.
testlags lag exclusion tests.
white White heteroskedasticity test.
Var Procs
append append restriction text.
clearhist clear the contents of the history attribute.
cleartext clear restriction text.
displayname set display name.
fit produce static forecasts from an estimated VAR .
forecast produce dynamic forecasts from an estimated VAR or VEC.
makecoint make group of cointegrating relations.
makeendog make group of endogenous series.
makemodel make model from the estimated VAR or VEC.
makeresids make residual series.
makesystem make system from var.
olepush push updates to OLE linked objects in open applications .
setattr set the value of an object attribute .
svar estimate factorization matrix for structural innovations.
Var Data Members
Scalar Values (individual level data)
@eqlogl(k) log likelihood for equation k.
@eqncoef(k) number of estimated coefficients in equation k.
@eqregobs(k) number of observations in equation k.
@meandep(k) mean of the dependent variable in equation k.
@r2(k) R-squared statistic for equation k.
@rbar2(k) adjusted R-squared statistic for equation k.
@sddep(k) std. dev. of dependent variable in equation k.
@se(k) standard error of the regression in equation k.
@ssr(k) sum of squared residuals in equation k.
a(i,j) adjustment coefficient for the j-th cointegrating equation in the i-th equation of the VEC (where applicable).
b(i,j) coefficient of the j-th variable in the i-th cointegrating equation (where applicable).
c(i,j) coefficient of the j-th regressor in the i-th equation of the var, or the coefficient of the j-th first-difference regressor in the i-th equation of the VEC.
Scalar Values (system level data)
@aic Akaike information criterion for the system.
@detresid determinant of the residual covariance matrix.
@hq Hannan-Quinn information criterion for the system.
@lagcount number of lags included in the VAR.
@lagorder highest lag order included in the VAR.
@logl log likelihood for system.
@ncoefs total number of estimated coefficients in the var.
@neqn number of equations.
@nrestrict number of coefficient restrictions in the system.
@regobs number of observations in the var.
@sc Schwarz information criterion for the system.
@svarcvgtype Returns an integer indicating the convergence type of the structural decomposition estimation: 0 (convergence achieved), 1 (convergence achieved, but first or second order conditions not met), 2 (failure to improve), 3 (maximum iterations reached), 4 (no convergence—structural decomposition not estimated).
@svaroverid over-identification LR statistic from structural factorization.
@totalobs sum of @eqregobs from each equation (“@regobs*@neqn”).
Vectors and Matrices
@coefmat coefficient matrix (as displayed in output table).
@coefse matrix of coefficient standard errors (corresponding to the output table).
@cointse standard errors of cointegrating vectors.
@cointvec cointegrating vectors.
@companion companion matrix for the full set of lag coefficients.
@impfact factorization matrix used in last impulse response view.
@lagcoefs coefficient matrix containing the full set of horizontally concatenated lag coefficient matrices.
@lagcoef(k) lag coefficient matrix for lag k.
@lagids vector of integers containing the lags included in the VAR.
@lrrsp accumulated long-run responses from last impulse response view.
@lrrspse standard errors of accumulated long-run responses.
@residcov (sym) covariance matrix of the residuals.
@svaramat estimated A matrix for structural factorization.
@svarbmat estimated B matrix for structural factorization.
@svarcovab covariance matrix of stacked A and B matrix for structural factorization.
@svarfmat estimated F matrix for long-run impulse responses.
@svarrcov restricted residual covariance matrix from structural factorization.
@svarsmat estimated S matrix for short-run impulse responses.
String values
@attr(“arg”) string containing the value of the arg attribute, where the argument is specified as a quoted string.
@command full command line form of the estimation command. Note this is a combination of @method and @options.
@description string containing the VAR object’s description (if available).
@detailedtype returns a string with the object type: “VAR”.
@displayname returns the VAR’s display name. If the VAR has no display name set, the VAR’s name is returned.
@name returns the VAR’s name.
@options command line form of estimation options.
@smpl sample used for estimation.
@type returns a string with the object type: “VAR”.
@updatetime returns a string representation of the time and date at which the VAR was last updated.
Var Examples
To declare a var estimate a VEC specification and make a residual series:
var finec.ec(e,2) 1 6 cp div r
To estimate an ordinary var, to create series containing residuals, and to form a model based upon the estimated var:
var empvar.ls 1 4 payroll hhold gdp
empvar.makeresids payres hholdres gdpres
empvar.makemodel(inmdl) cp fcp div fdiv r fr
To save coefficients in a scalar:
scalar coef1=empvar.b(1,2)