Announcement

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

  • Stata internal command to obtain only least squares coefficients; quick/stripped version of the regress command

    Dear all,
    could you please tell me the name of the Stata internal command that only estimates coefficients of the LS regression excluding all diagnostics such as R-squared etc. It is a quick/stripped version of the regress. It is not documented and is typically used for programmers in simulation studies where interest lies only in estimating coefficients.
    I know if exists as it was mentioned in one of the Stata meetings, but unfortunately, I cannot remember what it was.
    If your memory or experience serves you better than me, I'd greatly appreciate your help.
    Many thanks
    Oleg

  • #2
    Perhaps you are referring to "_regress"?

    Comment


    • #3
      I can't see any visible difference between -_regress- and -regress- in terms of visual output and what gets stored in -eretrun- and -return-. To be honest, I don't see the advantage to having this "backdoor" command in the first place, since all you need to do is run the regression quietly, if you prefer, then extract the necessary parameters from the relevant macro or matrix.

      For example,
      Code:
      sysuse auto
      quietly regress price mpg
      di "Intercept: " _b[_cons]
      di "Coef. for mpg: " _b[mpg]
      di "Unadjusted R^2: " e(r2)

      Comment


      • #4
        If the aim is to speed up simulations, you might directly use the Mata function _lsfitqr():
        Code:
        help mata _lsfitqr()
        https://twitter.com/Kripfganz

        Comment


        • #5
          Many thanks to all.

          Comment

          Working...
          X