Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: ivreg2 & sort


From   "Schaffer, Mark E" <M.E.Schaffer@hw.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: ivreg2 & sort
Date   Sun, 16 Jul 2006 16:11:43 +0100

Dann,

> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu 
> [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of 
> Millimet, Daniel
> Sent: 13 July 2006 22:01
> To: statalist@hsphsun2.harvard.edu
> Subject: st: ivreg2 & sort
> 
> Dear All,
> 
> I'm using XP, version 9.2, and the latest version of ivreg2.  
> As evidenced by the results below, when I change the sort 
> order of my data, I am getting slightly different results.  
> Any explanations?

I wonder if this is a scaling problem?  The coefficients on your
variables are many orders of magnitude apart, from about 0.001 to about
100.  You can try rescaling and see if the problem disappears.  Add 100
to your dep var so that the constant is brought into line, and divide
kl12 by 100.  Also have a look at the first-stage regressions to see if
there are any scaling problems there.

Second thought - compare the results to official ivreg.

If this doesn't work, contact me off list and we'll investigate further.

Cheers,
Mark

Prof. Mark Schaffer
Director, CERT
Department of Economics
School of Management & Languages
Heriot-Watt University, Edinburgh EH14 4AS
tel +44-131-451-3494 / fax +44-131-451-3296
email: m.e.schaffer@hw.ac.uk
web: http://www.sml.hw.ac.uk/ecomes


> 
>  
> 
> Thanks,
> 
> Dann
> 
>  
> 
>  
> 
>  
> 
>  
> 
>  
> 
>        log:  c:\tmp.log
> 
>   log type:  text
> 
>  opened on:  13 Jul 2006, 13:45:07
> 
>  
> 
> . g u=uniform()
> 
>  
> 
> . sort u
> 
>  
> 
> . ivreg2 e3pcl dum97 kl1 kl12 kl1i1 i1 i12 (trade2 tr2kl1 
> tr2kl12 tr2i1
> tr2i12 = trade2h tr2i1h tr2i1h2 tr2kl1h tr2kl1h2) teicd
> 
>  
> 
> Instrumental variables (2SLS) regression
> 
> ----------------------------------------
> 
>  
> 
>                                                       Number of obs =
> 96
> 
>                                                       F( 12,    83) =
> 16.08
> 
>                                                       Prob > F      =
> 0.0000
> 
> Total (centered) SS     =  35.22629964                Centered R2   =
> 0.6941
> 
> Total (uncentered) SS   =  7939.128731                Uncentered R2 =
> 0.9986
> 
> Residual SS             =  10.77670933                Root MSE      =
> .335
> 
>  
> 
> --------------------------------------------------------------
> ----------
> ------
> 
>        e3pcl |      Coef.   Std. Err.      z    P>|z|     [95% Conf.
> Interval]
> 
> -------------+------------------------------------------------
> ----------
> ------
> 
>       trade2 |  -.7432208   .5040607    -1.47   0.140    -1.731162
> .24472
> 
>       tr2kl1 |   -1.19757   1.189741    -1.01   0.314    -3.529419
> 1.134279
> 
>      tr2kl12 |   1.945117   2.778457     0.70   0.484    -3.500559
> 7.390794
> 
>        tr2i1 |   3.487961   5.803636     0.60   0.548    -7.886958
> 14.86288
> 
>       tr2i12 |   3.877568   14.32855     0.27   0.787    -24.20587
> 31.961
> 
>        dum97 |   .1387204   .1369309     1.01   0.311    -.1296593
> .4071
> 
>          kl1 |   .1138578   11.45822     0.01   0.992    -22.34384
> 22.57156
> 
>         kl12 |  -.0042718   .6687348    -0.01   0.995    -1.314968
> 1.306424
> 
>        kl1i1 |   .1161664   1.151198     0.10   0.920    -2.140141
> 2.372474
> 
>           i1 |   19.82222   78.54378     0.25   0.801    -134.1207
> 173.7652
> 
>          i12 |  -1.082534   3.972353    -0.27   0.785    -8.868202
> 6.703135
> 
>        teicd |  -.1607036   .0348189    -4.62   0.000    -.2289474
> -.0924597
> 
>        _cons |  -99.18562   388.1661    -0.26   0.798    -859.9772
> 661.606
> 
> --------------------------------------------------------------
> ----------
> ------
> 
> Anderson canon. corr. LR statistic (identification/IV relevance test):
> 14.211
> 
>                                                    Chi-sq(1) P-val =
> 0.0002
> 
> --------------------------------------------------------------
> ----------
> ------
> 
> Sargan statistic (overidentification test of all instruments):
> 0.000
> 
>                                                  (equation exactly
> identified)
> 
> --------------------------------------------------------------
> ----------
> ------
> 
> Instrumented:         trade2 tr2kl1 tr2kl12 tr2i1 tr2i12
> 
> Included instruments: dum97 kl1 kl12 kl1i1 i1 i12 teicd
> 
> Excluded instruments: trade2h tr2i1h tr2i1h2 tr2kl1h tr2kl1h2
> 
> --------------------------------------------------------------
> ----------
> ------
> 
>  
> 
> . replace u=uniform()
> 
> (1247 real changes made)
> 
>  
> 
> . sort u
> 
>  
> 
> . ivreg2 e3pcl dum97 kl1 kl12 kl1i1 i1 i12 (trade2 tr2kl1 
> tr2kl12 tr2i1
> tr2i12 = trade2h tr2i1h tr2i1h2 tr2kl1h tr2kl1h2) teicd
> 
>  
> 
> Instrumental variables (2SLS) regression
> 
> ----------------------------------------
> 
>  
> 
>                                                       Number of obs =
> 96
> 
>                                                       F( 12,    83) =
> 16.16
> 
>                                                       Prob > F      =
> 0.0000
> 
> Total (centered) SS     =  35.22629964                Centered R2   =
> 0.6955
> 
> Total (uncentered) SS   =  7939.128731                Uncentered R2 =
> 0.9986
> 
> Residual SS             =  10.72499924                Root MSE      =
> .3342
> 
>  
> 
> --------------------------------------------------------------
> ----------
> ------
> 
>        e3pcl |      Coef.   Std. Err.      z    P>|z|     [95% Conf.
> Interval]
> 
> -------------+------------------------------------------------
> ----------
> ------
> 
>       trade2 |   -.733174   .5028499    -1.46   0.145    -1.718742
> .2523937
> 
>       tr2kl1 |  -1.202465   1.186883    -1.01   0.311    -3.528713
> 1.123783
> 
>      tr2kl12 |   1.934048   2.771783     0.70   0.485    -3.498548
> 7.366643
> 
>        tr2i1 |   3.237612   5.789697     0.56   0.576    -8.109985
> 14.58521
> 
>       tr2i12 |   4.601008   14.29413     0.32   0.748    -23.41498
> 32.61699
> 
>        dum97 |   .1339733    .136602     0.98   0.327    -.1337618
> .4017083
> 
>          kl1 |   .1100066    11.4307     0.01   0.992    -22.29375
> 22.51376
> 
>         kl12 |   .0011364   .6671284     0.00   0.999    -1.306411
> 1.308684
> 
>        kl1i1 |   .1157626   1.148433     0.10   0.920    -2.135125
> 2.36665
> 
>           i1 |   24.10078   78.35514     0.31   0.758    -129.4725
> 177.674
> 
>          i12 |  -1.298903   3.962812    -0.33   0.743    -9.065873
> 6.468066
> 
>        teicd |  -.1609192   .0347353    -4.63   0.000    -.2289992
> -.0928393
> 
>        _cons |  -120.3281   387.2339    -0.31   0.756    -879.2925
> 638.6363
> 
> --------------------------------------------------------------
> ----------
> ------
> 
> Anderson canon. corr. LR statistic (identification/IV relevance test):
> 14.198
> 
>                                                    Chi-sq(1) P-val =
> 0.0002
> 
> --------------------------------------------------------------
> ----------
> ------
> 
> Sargan statistic (overidentification test of all instruments):
> 0.000
> 
>                                                  (equation exactly
> identified)
> 
> --------------------------------------------------------------
> ----------
> ------
> 
> Instrumented:         trade2 tr2kl1 tr2kl12 tr2i1 tr2i12
> 
> Included instruments: dum97 kl1 kl12 kl1i1 i1 i12 teicd
> 
> Excluded instruments: trade2h tr2i1h tr2i1h2 tr2kl1h tr2kl1h2
> 
> --------------------------------------------------------------
> ----------
> ------
> 
>  
> 
> 
> ****************************************************
> Daniel L. Millimet, Associate Professor
> Department of Economics
> Box 0496
> SMU
> Dallas, TX USA
> phone: 214.768.3269
> fax: 214.768.1821
> web: http://faculty.smu.edu/millimet
> ****************************************************
> 
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
> 
> 

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index