Announcement

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

  • Ivregress 2sls error "r(301)" last estimates not found.

    Hi everyone,

    I am using portable Stata 16. I need to run 2sls regression of y on x with instrument z. With the command

    ivregress 2sls y (x=z)

    I get the error that "last estimates not found" r(301). I am not sure how to resolve this error. Any help would be much appreciated.

  • #2
    That suggests that something went wrong in the first-stage regression, perhaps. But you don't show us the exact command you used or the output provided by ivregress. So I will show you my example, including the command and its output, which doesn't have this problem. If you present similar output (including using the first option) from your ivregress, perhaps someone can figure out what went wrong.
    Code:
    . sysuse auto, clear
    (1978 automobile data)
    
    . ivregress 2sls price (mpg=weight), first
    
    First-stage regressions
    -----------------------
    
                                                            Number of obs =     74
                                                            F(1, 72)      = 134.62
                                                            Prob > F      = 0.0000
                                                            R-squared     = 0.6515
                                                            Adj R-squared = 0.6467
                                                            Root MSE      = 3.4389
    
    ------------------------------------------------------------------------------
             mpg | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
    -------------+----------------------------------------------------------------
          weight |  -.0060087   .0005179   -11.60   0.000    -.0070411   -.0049763
           _cons |   39.44028   1.614003    24.44   0.000     36.22283    42.65774
    ------------------------------------------------------------------------------
    
    
    Instrumental variables 2SLS regression            Number of obs   =         74
                                                      Wald chi2(1)    =      26.18
                                                      Prob > chi2     =     0.0000
                                                      R-squared       =     0.1801
                                                      Root MSE        =     2652.6
    
    ------------------------------------------------------------------------------
           price | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
             mpg |  -340.1846   66.48161    -5.12   0.000    -470.4861    -209.883
           _cons |   13410.27   1449.068     9.25   0.000     10570.15    16250.39
    ------------------------------------------------------------------------------
    Instrumented: mpg
     Instruments: weight
    
    .
    Also, let me add that to assure maximum readability of results that you post, please copy the command and its output from the Results window into a code block in the Forum editor using code delimiters [CODE] and [/CODE], as explained in section 12 of the Statalist FAQ linked to at the top of the page. For example, the following:

    [CODE]
    . sysuse auto, clear
    (1978 Automobile Data)

    . describe make price

    storage display value
    variable name type format label variable label
    -----------------------------------------------------------------
    make str18 %-18s Make and Model
    price int %8.0gc Price
    [/CODE]

    will be presented in the post as the following:
    Code:
    . sysuse auto, clear
    (1978 Automobile Data)
    
    . describe make price
    
                  storage   display    value
    variable name   type    format     label      variable label
    -----------------------------------------------------------------
    make            str18   %-18s                 Make and Model
    price           int     %8.0gc                Price

    Comment


    • #3
      Code:
      sysuse auto, clear
      ivregress 2sls price (mpg=weight), first
      Thank you so much William for guiding me to write the code in a better way. I have now attached the code as requested. Still, I am getting the same error.

      last estimates not found
      r(301);

      I am not sure what went wrong here. It is the same code as you shared.

      Comment


      • #4
        I see now from post #1 that you are using "portable Stata 16" which is not a version I have heard of before. Searching for "portable Stata 16" on the web suggests that it is not a copy of Stata licensed to you or your institution. It appears to me you have been led to install unpurchased unlicensed software.

        Your problem almost certainly arises from your copy of Stata, as you cannot reproduce my working example, which was run on a licensed copy of Stata/SE 17.

        Comment


        • #5
          Thank you William for your reply. I later used eststo clear, and then restarted Stata. Now, ivregress 2sls command works fine.

          Comment

          Working...
          X