Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How can I get return list of estat endogenous after a 2sls?

    Hello,everyone.I want to define results of extat endogenous to be a local.But I find that I can't get return list of estat endogenous,the code "return list" after "estat endogenous " is the return list of ivregress 2sls but not estat endogenous's list?I wonder if you can tell me how to get the return list of estat endogenous.
    as an example:

    ----------------------- copy starting from the next line -----------------------
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    sysuse auto, clear
    ivregress 2sls price i.rep78 (foreign = weight turn trunk),r
    estat endogenous
    return list
    end
    ------------------ copy up to and including the previous line ------------------

  • #2
    I am not able to reproduce your problem using Stata 16.0. In the output shown below, we see that the return list after ivregress is minimal, and the return list after estat endogenous contains precisely the numbers reported in the output of the command.
    Code:
    . sysuse auto, clear
    (1978 Automobile Data)
    
    . ivregress 2sls price i.rep78 (foreign = weight turn trunk), vce(robust)
    
    Instrumental variables (2SLS) regression          Number of obs   =         69
                                                      Wald chi2(5)    =      15.49
                                                      Prob > chi2     =     0.0085
                                                      R-squared       =          .
                                                      Root MSE        =     3865.6
    
    ------------------------------------------------------------------------------
                 |               Robust
           price |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
         foreign |   -7198.86    2574.32    -2.80   0.005    -12244.43   -2153.285
                 |
           rep78 |
              2  |   1403.125   1212.252     1.16   0.247    -972.8455    3779.095
              3  |   2584.619   817.6752     3.16   0.002     982.0055    4187.233
              4  |    5106.43   1588.234     3.22   0.001     1993.548    8219.312
              5  |   7238.476   2562.574     2.82   0.005     2215.923    12261.03
                 |
           _cons |     4564.5    261.276    17.47   0.000     4052.409    5076.591
    ------------------------------------------------------------------------------
    Instrumented:  foreign
    Instruments:   2.rep78 3.rep78 4.rep78 5.rep78 weight turn trunk
    
    . return list
    
    scalars:
                  r(level) =  95
    
    matrices:
                  r(table) :  9 x 7
    
    . estat endogenous
    
      Tests of endogeneity
      Ho: variables are exogenous
    
      Robust score chi2(1)            =  14.4689  (p = 0.0001)
      Robust regression F(1,62)       =  30.9344  (p = 0.0000)
    
    . return list
    
    scalars:
                     r(df) =  1
               r(regFdf_d) =  62
               r(regFdf_n) =  1
                 r(p_regF) =  6.03713001520e-07
                   r(regF) =  30.93441641935869
              r(p_r_score) =  .0001424965823318
                r(r_score) =  14.46885025107886
    
    . about
    
    Stata/SE 16.0 for Mac (64-bit Intel)
    Revision 23 Aug 2019

    Comment


    • #3
      Originally posted by William Lisowski View Post
      I am not able to reproduce your problem using Stata 16.0. In the output shown below, we see that the return list after ivregress is minimal, and the return list after estat endogenous contains precisely the numbers reported in the output of the command.
      Code:
      . sysuse auto, clear
      (1978 Automobile Data)
      
      . ivregress 2sls price i.rep78 (foreign = weight turn trunk), vce(robust)
      
      Instrumental variables (2SLS) regression Number of obs = 69
      Wald chi2(5) = 15.49
      Prob > chi2 = 0.0085
      R-squared = .
      Root MSE = 3865.6
      
      ------------------------------------------------------------------------------
      | Robust
      price | Coef. Std. Err. z P>|z| [95% Conf. Interval]
      -------------+----------------------------------------------------------------
      foreign | -7198.86 2574.32 -2.80 0.005 -12244.43 -2153.285
      |
      rep78 |
      2 | 1403.125 1212.252 1.16 0.247 -972.8455 3779.095
      3 | 2584.619 817.6752 3.16 0.002 982.0055 4187.233
      4 | 5106.43 1588.234 3.22 0.001 1993.548 8219.312
      5 | 7238.476 2562.574 2.82 0.005 2215.923 12261.03
      |
      _cons | 4564.5 261.276 17.47 0.000 4052.409 5076.591
      ------------------------------------------------------------------------------
      Instrumented: foreign
      Instruments: 2.rep78 3.rep78 4.rep78 5.rep78 weight turn trunk
      
      . return list
      
      scalars:
      r(level) = 95
      
      matrices:
      r(table) : 9 x 7
      
      . estat endogenous
      
      Tests of endogeneity
      Ho: variables are exogenous
      
      Robust score chi2(1) = 14.4689 (p = 0.0001)
      Robust regression F(1,62) = 30.9344 (p = 0.0000)
      
      . return list
      
      scalars:
      r(df) = 1
      r(regFdf_d) = 62
      r(regFdf_n) = 1
      r(p_regF) = 6.03713001520e-07
      r(regF) = 30.93441641935869
      r(p_r_score) = .0001424965823318
      r(r_score) = 14.46885025107886
      
      . about
      
      Stata/SE 16.0 for Mac (64-bit Intel)
      Revision 23 Aug 2019
      thank you,sir.I found that I have confused ivregress and ivregress2

      Comment

      Working...
      X