XTIVREG2unrecognized command: XTIVREG2 not defined by XTIVREG2.ado
r(199);
. ssc install XTIVREG2
checking xtivreg2 consistency and verifying not already installed...
installing into c:\ado\plus\...
installation complete.
. help xtivreg2
. use
http://fmwww.bc.edu/ec-p/data/macro/abdata.dta
(Layard & Nickell, Unemployment in Britain, Economica 53, 1986 from Ox dist)
. tsset id year
panel variable: id, 1 to 140
time variable: year, 1976 to 1984
. xtivreg2 ys k (n=l2.n l3.n), fe small
Error - must have ivreg2 version 2.1.15 or greater installed
r(601);
. ssc install IVREG2
checking ivreg2 consistency and verifying not already installed...
installing into c:\ado\plus\...
installation complete.
. xtivreg2 ys k (n=l2.n l3.n), fe small
FIXED EFFECTS ESTIMATION
------------------------
Number of groups = 140 Obs per group: min = 4
avg = 4.4
max = 6
Instrumental variables (2SLS) regression
----------------------------------------
Number of obs = 611
F( 2, 469) = 117.48
Prob > F = 0.0000
Total (centered) SS = 2.817151731 Centered R2 = 0.3569
Total (uncentered) SS = 2.817151731 Uncentered R2 = 0.3569
Residual SS = 1.811578915 Root MSE = .06215
------------------------------------------------------------------------------
ys | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
n | .105914 .0865132 1.22 0.221 -.0640873 .2759154
k | .1352526 .0638731 2.12 0.035 .0097397 .2607655
------------------------------------------------------------------------------
Anderson canon. corr. LR statistic (identification/IV relevance test): 31.692
Chi-sq(2) P-val = 0.0000
------------------------------------------------------------------------------
Sargan statistic (overidentification test of all instruments): 6.089
Chi-sq(1) P-val = 0.0136
------------------------------------------------------------------------------
Instrumented: n
Included instruments: k
Excluded instruments: L2.n L3.n
------------------------------------------------------------------------------
. xtivreg ys k (n=l2.n l3.n), fe small
Fixed-effects (within) IV regression Number of obs = 611
Group variable: id Number of groups = 140
R-sq: within = 0.3569 Obs per group: min = 4
between = 0.0020 avg = 4.4
overall = 0.0082 max = 6
F(142,469) = 117.48
corr(u_i, Xb) = -0.9897 Prob > F = 0.0000
------------------------------------------------------------------------------
ys | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
n | .105914 .0865132 1.22 0.221 -.0640873 .2759154
k | .1352526 .0638731 2.12 0.035 .0097397 .2607655
_cons | 4.558421 .1159595 39.31 0.000 4.330556 4.786285
-------------+----------------------------------------------------------------
sigma_u | .34516869
sigma_e | .06215015
rho | .96859745 (fraction of variance due to u_i)
------------------------------------------------------------------------------
F test that all u_i=0: F(139,469) = 2.48 Prob > F = 0.0000
------------------------------------------------------------------------------
Instrumented: n
Instruments: k L2.n L3.n
. xtivreg2 ys k (n=l.n l2.n), fd small first
FIRST DIFFERENCES ESTIMATION
----------------------------
Number of groups = 140 Obs per group: min = 4
avg = 4.4
max = 6
First-stage regressions
-----------------------
First-stage regression of D.n:
Ordinary Least Squares (OLS) regression
---------------------------------------
Number of obs = 611
F( 3, 607) = 73.78
Prob > F = 0.0000
Total (centered) SS = 12.59997848 Centered R2 = 0.2672
Total (uncentered) SS = 15.45414725 Uncentered R2 = 0.4026
Residual SS = 9.233071905 Root MSE = .1233
------------------------------------------------------------------------------
D.n | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
k |
D1. | .450355 .0331934 13.57 0.000 .3851672 .5155429
n |
L2D. | -.0269218 .0402855 -0.67 0.504 -.1060376 .052194
LD. | .1077116 .0380126 2.83 0.005 .0330595 .1823637
_cons | -.0304262 .0056794 -5.36 0.000 -.0415798 -.0192725
------------------------------------------------------------------------------
Partial R-squared of excluded instruments: 0.0131
Test of excluded instruments:
F( 2, 607) = 4.02
Prob > F = 0.0185
Summary results for first-stage regressions
-------------------------------------------
Shea
Variable | Partial R2 | Partial R2 F( 2, 607) P-value
D.n | 0.0131 | 0.0131 4.02 0.0185
Underidentification tests:
Chi-sq(2) P-value
Anderson canon. corr. likelihood ratio stat. 8.03 0.0180
Cragg-Donald N*minEval stat. 8.09 0.0175
Ho: matrix of reduced form coefficients has rank=K-1 (underidentified)
Ha: matrix has rank>=K (identified)
Weak identification statistics:
Cragg-Donald (N-L)*minEval/L2 F-stat 4.02
Anderson-Rubin test of joint significance of
endogenous regressors B1 in main equation, Ho:B1=0
F(2,607)= 7.58 P-val=0.0006
Chi-sq(2)= 15.26 P-val=0.0005
Number of observations N = 611
Number of regressors K = 3
Number of instruments L = 4
Number of excluded instruments L2 = 2
Instrumental variables (2SLS) regression
----------------------------------------
Number of obs = 611
F( 2, 608) = 3.32
Prob > F = 0.0369
Total (centered) SS = 1.866255328 Centered R2 = -1.0071
Total (uncentered) SS = 2.621579375 Uncentered R2 = -0.4288
Residual SS = 3.745785431 Root MSE = .07849
------------------------------------------------------------------------------
D.ys | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
n |
D1. | -.388672 .2245474 -1.73 0.084 -.8296547 .0523107
k |
D1. | .2215772 .1074186 2.06 0.040 .0106207 .4325337
_cons | -.0455629 .0084215 -5.41 0.000 -.0621016 -.0290243
------------------------------------------------------------------------------
Anderson canon. corr. LR statistic (identification/IV relevance test): 8.033
Chi-sq(2) P-val = 0.0180
------------------------------------------------------------------------------
Sargan statistic (overidentification test of all instruments): 4.319
Chi-sq(1) P-val = 0.0377
------------------------------------------------------------------------------
Instrumented: D.n
Included instruments: D.k
Excluded instruments: L2D.n LD.n
------------------------------------------------------------------------------
.
. ivreg2 d.ys d.k (d.n=ld.n ld2.n), small first
First-stage regressions
-----------------------
First-stage regression of D.n:
Ordinary Least Squares (OLS) regression
---------------------------------------
Number of obs = 611
F( 3, 607) = 73.78
Prob > F = 0.0000
Total (centered) SS = 12.59997848 Centered R2 = 0.2672
Total (uncentered) SS = 15.45414725 Uncentered R2 = 0.4026
Residual SS = 9.233071905 Root MSE = .1233
------------------------------------------------------------------------------
D.n | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
k |
D1. | .450355 .0331934 13.57 0.000 .3851672 .5155429
n |
LD. | .0807898 .049081 1.65 0.100 -.0155993 .177179
LD2. | .0269218 .0402855 0.67 0.504 -.052194 .1060376
_cons | -.0304262 .0056794 -5.36 0.000 -.0415798 -.0192725
------------------------------------------------------------------------------
Partial R-squared of excluded instruments: 0.0131
Test of excluded instruments:
F( 2, 607) = 4.02
Prob > F = 0.0185
Summary results for first-stage regressions
-------------------------------------------
Shea
Variable | Partial R2 | Partial R2 F( 2, 607) P-value
D.n | 0.0131 | 0.0131 4.02 0.0185
Underidentification tests:
Chi-sq(2) P-value
Anderson canon. corr. likelihood ratio stat. 8.03 0.0180
Cragg-Donald N*minEval stat. 8.09 0.0175
Ho: matrix of reduced form coefficients has rank=K-1 (underidentified)
Ha: matrix has rank>=K (identified)
Weak identification statistics:
Cragg-Donald (N-L)*minEval/L2 F-stat 4.02
Anderson-Rubin test of joint significance of
endogenous regressors B1 in main equation, Ho:B1=0
F(2,607)= 7.58 P-val=0.0006
Chi-sq(2)= 15.26 P-val=0.0005
Number of observations N = 611
Number of regressors K = 3
Number of instruments L = 4
Number of excluded instruments L2 = 2
Instrumental variables (2SLS) regression
----------------------------------------
Number of obs = 611
F( 2, 608) = 3.32
Prob > F = 0.0369
Total (centered) SS = 1.866255328 Centered R2 = -1.0071
Total (uncentered) SS = 2.621579375 Uncentered R2 = -0.4288
Residual SS = 3.7457855 Root MSE = .07849
------------------------------------------------------------------------------
D.ys | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
n |
D1. | -.388672 .2245474 -1.73 0.084 -.8296547 .0523107
k |
D1. | .2215772 .1074186 2.06 0.040 .0106207 .4325337
_cons | -.0455629 .0084215 -5.41 0.000 -.0621016 -.0290243
------------------------------------------------------------------------------
Anderson canon. corr. LR statistic (identification/IV relevance test): 8.033
Chi-sq(2) P-val = 0.0180
------------------------------------------------------------------------------
Sargan statistic (overidentification test of all instruments): 4.319
Chi-sq(1) P-val = 0.0377
------------------------------------------------------------------------------
Instrumented: D.n
Included instruments: D.k
Excluded instruments: LD.n LD2.n
------------------------------------------------------------------------------
.
. xtivreg ys k (n=l.n l2.n), fd small
First-differenced IV regression Number of obs = 611
Group variable: id Number of groups = 140
R-sq: within = 0.1020 Obs per group: min = 4
between = 0.4446 avg = 4.4
overall = 0.0001 max = 6
F(2,608) = 3.32
corr(u_i, Xb) = -0.9771 Prob > F = 0.0369
------------------------------------------------------------------------------
d.ys | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
n |
D1. | -.388672 .2245474 -1.73 0.084 -.8296547 .0523107
k |
D1. | .2215772 .1074186 2.06 0.040 .0106207 .4325337
_cons | -.0455629 .0084215 -5.41 0.000 -.0621016 -.0290243
-------------+----------------------------------------------------------------
sigma_u | .24620855
sigma_e | .07849096
rho | .90774365 (fraction of variance due to u_i)
------------------------------------------------------------------------------
Instrumented: n
Instruments: k L.n L2.n
.