Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: FW: comparing xtregar coefficients across models
From
Lopa Chakraborti <[email protected]>
To
"[email protected]" <[email protected]>
Subject
st: FW: comparing xtregar coefficients across models
Date
Fri, 25 Feb 2011 14:25:26 -0500
The problem was that I was trying to test the equality of the two t-stats. Instead, I needed to use the coefficients generated by the two models for the test command.
Run model 1.
Save the beta in a scalar as:
. scalar b_lagseaavgwqfoia04avg3=_b[lagseaavgwqfoia04avg3]
Run model 2.
Run test as:
. test _b[pastyearseaavgwq]=b_lagseaavgwqfoia04avg3
________________________________________
From: Lopa Chakraborti
Sent: Friday, February 25, 2011 2:02 PM
To: [email protected]
Subject: FW: comparing xtregar coefficients across models
Not sure how to let statalist know that this error has been resolved.
sincerely
Lopa
________________________________________
From: Lopa Chakraborti
Sent: Friday, February 25, 2011 10:44 AM
To: [email protected]
Subject: comparing xtregar coefficients across models
I need some help on how to compare regression coefficients between models using xtregar. In the results below, I am trying to compare the coefficient on lagseaavgwqfoia04avg3 (first model below) with that of pastyearseaavgwq (second model, further below) by calculating the t statistics. The test seems to fail and gives error message "Constraint 1 dropped".
any advice would be appreciated
model 1:
. xtregar lseaavglcavfoia04avg2 lagseaavgwqfoia04avg3 lagseaavgflowfoia04avg3 elec food mill paper chem petro rubber leather metal transp secu just rnwhite mhhi carpl manuf popt popu MD PA
RE GLS regression with AR(1) disturbances Number of obs = 352
Group variable (i): npid Number of groups = 81
R-sq: within = 0.0679 Obs per group: min = 2
between = 0.3513 avg = 4.3
overall = 0.2204 max = 10
Wald chi2(23) = 63.36
corr(u_i, Xb) = 0 (assumed) Prob > chi2 = 0.0000
------------------- theta --------------------
min 5% median 95% max
0.5865 0.5865 0.6942 0.7785 0.8009
------------------------------------------------------------------------------
lseaavglca~2 | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
lagseaavgw~3 | .0243223 .0049348 4.93 0.000 .0146504 .0339943
lagseaavgf~3 | .0000264 .0002437 0.11 0.914 -.0004511 .000504
elec | .0167549 .2884746 0.06 0.954 -.548645 .5821547
food | .4841683 .4780733 1.01 0.311 -.4528381 1.421175
mill | -.2253284 .3069892 -0.73 0.463 -.8270161 .3763594
paper | .2761943 .2659313 1.04 0.299 -.2450215 .7974102
chem | .416034 .2515593 1.65 0.098 -.0770132 .9090812
petro | .777429 .3445641 2.26 0.024 .1020958 1.452762
rubber | .2154333 .4328246 0.50 0.619 -.6328873 1.063754
leather | 1.157704 .3244032 3.57 0.000 .5218859 1.793523
metal | -.0522007 .4622447 -0.11 0.910 -.9581837 .8537823
transp | .5580452 .4799053 1.16 0.245 -.382552 1.498642
secu | -.3943754 .3002096 -1.31 0.189 -.9827755 .1940247
just | .2919446 .431559 0.68 0.499 -.5538955 1.137785
rnwhite | .0041641 .003601 1.16 0.248 -.0028936 .0112218
mhhi | -.007618 .0064241 -1.19 0.236 -.0202091 .0049731
carpl | .0046771 .0116036 0.40 0.687 -.0180656 .0274198
manuf | .0023217 .005092 0.46 0.648 -.0076585 .0123019
popt | -.0057607 .0042432 -1.36 0.175 -.0140771 .0025557
popu | -.0009174 .0015892 -0.58 0.564 -.0040323 .0021974
MD | .294147 .1364115 2.16 0.031 .0267853 .5615087
PA | .0404563 .2087747 0.19 0.846 -.3687346 .4496472
_cons | 2.964972 .3077018 9.64 0.000 2.361888 3.568056
-------------+----------------------------------------------------------------
rho_ar | .426524 (estimated autocorrelation coefficient)
sigma_u | .37549867
sigma_e | .18262772
rho_fov | .80870389 (fraction of variance due to u_i)
------------------------------------------------------------------------------
. scalar t_lagseaavgwqfoia04avg3=_b[lagseaavgwqfoia04avg3]/_se[lagseaavgwqfoia04avg3]
model 2:
. xtregar lseaavglcavfoia04avg2 pastyearseaavgwq lagseaavgflowfoia04avg3 elec food mill paper chem petro rubber leather metal transp secu just rnwhite mhhi carpl manuf popt popu MD PA
RE GLS regression with AR(1) disturbances Number of obs = 346
Group variable (i): npid Number of groups = 80
R-sq: within = 0.0892 Obs per group: min = 2
between = 0.3846 avg = 4.3
overall = 0.2400 max = 8
Wald chi2(23) = 73.20
corr(u_i, Xb) = 0 (assumed) Prob > chi2 = 0.0000
------------------- theta --------------------
min 5% median 95% max
0.5795 0.5795 0.6885 0.7742 0.7742
------------------------------------------------------------------------------
lseaavglca~2 | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
pastyearse~q | .0262475 .0048356 5.43 0.000 .0167699 .035725
lagseaavgf~3 | .0000391 .0002365 0.17 0.869 -.0004244 .0005026
elec | -.0045798 .2800818 -0.02 0.987 -.5535301 .5443705
food | .2973297 .4741468 0.63 0.531 -.6319809 1.22664
mill | -.2210648 .2980757 -0.74 0.458 -.8052824 .3631529
paper | .5726535 .2985217 1.92 0.055 -.0124382 1.157745
chem | .2940331 .2513263 1.17 0.242 -.1985574 .7866236
petro | .6126716 .3433223 1.78 0.074 -.0602278 1.285571
rubber | .246944 .4207964 0.59 0.557 -.5778019 1.07169
leather | 1.055009 .3183348 3.31 0.001 .4310839 1.678933
metal | .0795689 .4540158 0.18 0.861 -.8102857 .9694236
transp | .3573744 .4766374 0.75 0.453 -.5768177 1.291567
secu | -.3947636 .2912529 -1.36 0.175 -.9656088 .1760816
just | .2870395 .4187941 0.69 0.493 -.5337818 1.107861
rnwhite | .0040544 .0035024 1.16 0.247 -.0028101 .010919
mhhi | -.0049846 .0063327 -0.79 0.431 -.0173965 .0074272
carpl | .0006704 .0114049 0.06 0.953 -.0216828 .0230235
manuf | .0034781 .0049695 0.70 0.484 -.006262 .0132181
popt | -.0047142 .0041523 -1.14 0.256 -.0128526 .0034242
popu | -.0016382 .0015744 -1.04 0.298 -.0047241 .0014476
MD | .3072598 .1324144 2.32 0.020 .0477324 .5667872
PA | .2284754 .2213065 1.03 0.302 -.2052773 .6622282
_cons | 2.910289 .2990276 9.73 0.000 2.324206 3.496372
-------------+----------------------------------------------------------------
rho_ar | .41767391 (estimated autocorrelation coefficient)
sigma_u | .36306501
sigma_e | .18159331
rho_fov | .79989281 (fraction of variance due to u_i)
------------------------------------------------------------------------------
. scalar t_pastyearseaavgwq=_b[pastyearseaavgwq]/_se[pastyearseaavgwq]
. test t_lagseaavgwqfoia04avg3=t_pastyearseaavgwq
( 1) = .4992289
Constraint 1 dropped
chi2( 0) = .
Prob > chi2 = .
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/