help: r2var dialog:

Title

r2var: (VAR) Overall System R2, F-Test, and Chi2-Test

Table of Contents

Syntax

Options

Description

Saved Results

References

*** Examples

Authors

Syntax

r2var depvars [if] [in] , [ noconstant lags(numlist)
exog(varlist)

nolog constraints(numlist) iterate(#) dfk nobigf small

tolerance(#) noisure nocnsreport level(#) ]

Options

Model

noconstant suppress constant term

lags(#/#) Dependent Variables Lag length; default is (1/1)

exog(varlist) use exogenous variables varlist

Model 2
constraints(numlist) apply specified linear constraints

nolog suppress SURE iteration log

tolerance(#) set convergence tolerance of SURE

noisure use one-step SURE

dfk make small-sample degrees-of-freedom adjustment

small report small-sample t and F statistics

nobigf do not compute parameter vector for coefficients implicitly set to zero

iterate(#) set maximum number of iterations for SURE; default is iterate(1600)

Reporting
level(#) set confidence level; default is level(95)

nocnsreport do not display constraints

*** tsset must be used before using r2var

depvarlist and varlist may contain time-series operators; see tsvarlist

Description

r2var computes Overall System R-squared (R2), Adjusted R2, and the overall significance of F-Test, and Chi2-Test, after:

- (var): Vector Autoregressive Model (VAR).

Most r2var options are identically to official (var) command

r2var used 5 types of criteria and tests, as discussed in:

McElroy(1977), Judge et al(1985), Dhrymes(1974), Greene(1993), and Berndt(1991).

see eq.12.1.33-36 in Judge et al(1985, p.477).

1- Berndt System R2 = 1-|E'E| / |Yb'Yb|
2- McElroy System R2 = 1-(U'W*U)/ (Y'W*Y)
3- Judge System R2 = 1-(U'U) / (Y'Y)
Q
4- Dhrymes System R2 = Sum [R2i (yi' Dt yi']/[Y(I(Q) # Dt)Y]
i=1
5- Greene System R2 = 1-(Q/trace(inv(Sig))*SYs)

From each type of these system R2's, r2var can calculate Adjusted R2, F-Test, and Chi2-Test:

Adjusted R2 = 1-(1-R2)*((QN-Q)/(QN-K))
F-Test = R2/(1-R2)*[(QN-K)/(K-Q)]
Chi2-Test = -N*(log(1-R2))

where
|E'E| = determinant of residual matrix (NxQ)
|Yb'Yb| = determinant of dependent variables matrix in deviation from mean (NxQ)
yi = dependent variable of eq. i (Nx1)
Y = stacked vector of dependent variables (QNx1)
U = stacked vector of residuals (QNx1)
W = variance-covariance matrix of residuals (W=inv(Omega) # I(N))
N = number of observations
K = Number of Parameters
Q = Number of Equations
R2i = R2 of eq. i
Dt = I(N)-JJ'/N, with J=(1,1,...,1)' (Nx1)
SYs = (Yb1*Yb2*...Ybq)/N
Sig = Sigma hat Matrix
Degrees of Freedom F-Test = (K-Q), (QN)
Degrees of Freedom Chi2-Test = (K-Q)
Log Determinant of Sigma = log|Sigma matrix|
Log Likelihood Function LLF =-(N*Q/2)*(1+log(2*_pi))-(N/2*abs(log(Sigma)))

- (var) model with SURE estimations assumes:

1- Independence of the errors in each eqution or no correlations between different periods in the same equation.

2- no correlations between the errors for any of two equtions between two different periods, this is called "Intertemporal Correlation".

3- correlations may be exist between different two equations, but at the same period, and this is called "Contemporaneous Correlation".

4- SURE can be applied when there is correlations between different two equations at the same period, or if the independent variables are differnt from equation to equation.

4- If "Contemporaneous Correlation" does not exist, ordinary least squares (OLS) can be applied separately to each equation, the results are fully efficient and there is no need to estimate SURE.

Breusch-Pagan Diagonal Covariance Matrix LM Test can test whether contemporaneous diagonal covariance matrix is 0. (Independence of the Errors), or correlated if at least one covariance is nonzero.

Ho: no Contemporaneous Correlation: Sig12 = Sig13 = Sig23 = ... = 0.

Ha: Contemporaneous Correlation: at least one Covariance is nonzero.

Saved Results

r2var saves the following in r():

Scalars

r(N) Number of Observations
r(k) Number of Parameters
r(k_eq) Number of Equations
r(chi_df) DF chi-squared
r(f_df1) F-Test DF1 Numerator
r(f_df2) F-Test DF2 Denominator

r(r2_b) Berndt R-squared
r(r2_j) Judge R-squared
r(r2_m) McElroy R-squared
r(r2_d) Dhrymes R-squared
r(r2_g) Greene R-squared

r(r2a_b) Berndt Adjusted R-squared
r(r2a_j) Judge Adjusted R-squared
r(r2a_m) McElroy Adjusted R-squared
r(r2a_d) Dhrymes Adjusted R-squared
r(r2a_g) Greene Adjusted R-squared

r(f_b) Berndt F Test
r(f_j) Judge F Test
r(f_m) McElroy F Test
r(f_d) Dhrymes F Test
r(f_g) Greene F Test

r(chi_b) Berndt Chi2 Test
r(chi_j) Judge Chi2 Test
r(chi_m) McElroy Chi2 Test
r(chi_d) Dhrymes Chi2 Test
r(chi_g) Greene Chi2 Test

r(lsig2) Log Determinant of Sigma
r(llf) Log Likelihood Function

References

Berndt, Ernst R. (1991)
"The practice of econometrics: Classical and contemporary",
Addison-Wesley Publishing Company; 468.

Dhrymes, Phoebus J. (1974)
"Econometrics: Statistical Foundations and Applications",
2ed edition Springer- Verlag New York, USA..

Greene, William (1993)
"Econometric Analysis",
2nd ed., Macmillan Publishing Company Inc., New York, USA.; 490-491.

Judge, Georege, R. Carter Hill, William . E. Griffiths, Helmut Lutkepohl, & Tsoung-Chao Lee (1988)
"Introduction To The Theory And Practice Of Econometrics",
2nd ed., John Wiley & Sons, Inc., New York, USA; 758-763.

Judge, Georege, W. E. Griffiths, R. Carter Hill, Helmut Lutkepohl, & Tsoung-Chao Lee(1985)
"The Theory and Practice of Econometrics",
2nd ed., John Wiley & Sons, Inc., New York, USA; 477-478.

Kmenta, Jan (1986)
"Elements of Econometrics",
2nd ed., Macmillan Publishing Company, Inc., New York, USA; 645.

McElroy, Marjorie B. (1977)
"Goodness of Fit for Seemingly Unrelated Regressions: Glahn's R2y,x and Hooper's r~2",
Journal of Econometrics, 6(3), November; 381-387.

Examples

* If you want to use dialog box: Press OK to compute r2var

db r2var

* Data of This example are taken from:

Judge, Georege, R. Carter Hill, William . E. Griffiths, Helmut Lutkepohl, & Tsoung-Chao Lee (1988)
"Introduction To The Theory And Practice Of Econometrics",
2nd ed., John Wiley & Sons, Inc., New York, USA; 758-763.

clear all

sysuse r2var.dta , clear

tsset t

r2var y1 y2 , lags(1/1) exog(x1 x2)

r2var y1 y2 in 5/71 , lags(1/1)

r2var y1 y2 in 5/71 , lags(1/2)

r2var y1 y2 in 5/71 , lags(1/3)

return list

. clear all
. sysuse r2var.dta , clear
. tsset t
. r2var y1 y2 in 5/71 , lags(1/1)

Vector autoregression

Sample: 5 - 71 No. of obs = 67
Log likelihood = -566.0542 AIC = 17.07625
FPE = 89376.34 HQIC = 17.15437
Det(Sigma_ml) = 74711.32 SBIC = 17.27368

Equation Parms RMSE R-sq chi2 P>chi2
----------------------------------------------------------------
y1 3 16.6829 0.2878 27.07799 0.0000
y2 3 19.9034 0.1863 15.33891 0.0005
----------------------------------------------------------------

------------------------------------------------------------------------------
| Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
y1 |
y1 |
L1. | -.0903073 .1279538 -0.71 0.480 -.3410921 .1604774
|
y2 |
L1. | .5189002 .114004 4.55 0.000 .2954564 .742344
|
_cons | 7.949964 2.585932 3.07 0.002 2.88163 13.0183
-------------+----------------------------------------------------------------
y2 |
y1 |
L1. | .1970232 .1526549 1.29 0.197 -.1021748 .4962212
|
y2 |
L1. | .297665 .1360122 2.19 0.029 .0310861 .564244
|
_cons | 8.537288 3.085138 2.77 0.006 2.490528 14.58405
------------------------------------------------------------------------------

==============================================================================
* (VAR) Overall System R2 - Adjusted R2 - F Test - Chi2 Test - (Lag = 1)
==============================================================================

+----------------------------------------------------------------------------+
| Name | R2 | Adj_R2 | F | P-Value | Chi2 | P-Value |
|----------+----------+----------+----------+----------+----------+----------|
| Berndt | 0.3369 | 0.3162 | 16.2580 | 0.0000 | 27.5253 | 0.0000 |
| McElroy | 0.1943 | 0.1691 | 7.7171 | 0.0000 | 14.4751 | 0.0059 |
| Judge | 0.2315 | 0.2075 | 9.6397 | 0.0000 | 17.6423 | 0.0014 |
| Dhrymes | 0.2315 | 0.2075 | 9.6397 | 0.0000 | 17.6423 | 0.0014 |
| Greene | 0.0604 | 0.0311 | 2.0580 | 0.0898 | 4.1760 | 0.3827 |
+----------------------------------------------------------------------------+
(VAR) Lag Order = 1
Number of Parameters = 6
Number of Equations = 2
Degrees of Freedom F-Test = (4, 134)
Degrees of Freedom Chi2-Test = 4
Log Determinant of Sigma = 11.2214
Log Likelihood Function = -566.0542
------------------------------------------------------------------------------

Authors

- Emad Abd Elmessih Shehata
Professor (PhD Economics)
Agricultural Research Center - Agricultural Economics Research Institute - Egypt
Email: emadstat@hotmail.com
WebPage at IDEAS: http://ideas.repec.org/f/psh494.html
WebPage at EconPapers: http://econpapers.repec.org/RAS/psh494.htm

- Sahra Khaleel A. Mickaiel
Professor (PhD Economics)
Cairo University - Faculty of Agriculture - Department of Economics - Egypt
Email: sahra_atta@hotmail.com
WebPage at IDEAS: http://ideas.repec.org/f/pmi520.html
WebPage at EconPapers: http://econpapers.repec.org/RAS/pmi520.htm

R2VAR Citation

Shehata, Emad Abd Elmessih & Sahra Khaleel A. Mickaiel (2014)

R2VAR: "Stata Module to Compute (VAR) Overall System R2, F-Test, and Chi2-Test"

Online Help:

* Model Selection Diagnostic Criteria:
diagmle MLE Model Selection Diagnostic Criteria
diagnl NLS Model Selection Diagnostic Criteria
diagnlsur (NL-SUR) Overall System Model Selection Diagnostic Criteria
diagreg OLS Model Selection Diagnostic Criteria
diagreg2 2SLS-IV Model Selection Diagnostic Criteria
diagreg3 (3SLS-SUR) Overall System Model Selection Diagnostic Criteria
diagsem (SEM-FIML) Overall System Model Selection Diagnostic Criteria
diagvar (VAR) Overall System Model Selection Diagnostic Criteria
diagxt Panel Data Model Selection Diagnostic Criteria
---------------------------------------------------------------------------
* Linear vs Log-Linear Functional Form Tests:
lmfmle MLE Linear vs Log-Linear Functional Form Tests
lmfreg OLS Linear vs Log-Linear Functional Form Tests
lmfreg2 2SLS-IV Linear vs Log-Linear Functional Form Tests
---------------------------------------------------------------------------
lmhaus2 2SLS-IV Hausman Specification Test
lmhausxt Panel Data Hausman Specification Test
---------------------------------------------------------------------------
lmiden2 2SLS-IV Over Identification Restrictions Tests
---------------------------------------------------------------------------
lmeg Augmented Engle-Granger Cointegration Test
lmgc 2SLS-IV Granger Causality Test
lmsrd OLS Spurious Regression Diagnostic
---------------------------------------------------------------------------
* REgression Specification Error Tests (RESET):
reset OLS REgression Specification Error Tests (RESET)
reset2 2SLS-IV REgression Specification Error Tests (RESET)
resetmle MLE REgression Specification Error Tests (RESET)
resetxt Panel Data REgression Specification Error Tests (RESET)
---------------------------------------------------------------------------