Announcement

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

  • Collecting residuals (statsby command)

    Hello all,

    I'm trying to collect the residuals for a series of regressions. Using the statsby command, I can collect coefficients, constants, etc, but no residuals.

    statsby _b _const, by(group): reg y x1 x2 x3

    Any suggestions?

  • #2
    Code:
    reg y x1 x2 x3
    predict resid, residuals

    Comment


    • #3
      I'm unclear what you want. There is a residual for every case; it isn't just a single model parameter. Do you want the mean square residual or something like that? You can do things like

      Code:
      sysuse auto, clear
      statsby ssr = e(rss) dfr = e(df_r) _b _se, by(foreign): reg price mpg
      -------------------------------------------
      Richard Williams, Notre Dame Dept of Sociology
      StataNow Version: 19.5 MP (2 processor)

      EMAIL: [email protected]
      WWW: https://www3.nd.edu/~rwilliam

      Comment


      • #4
        Thanks Richard,

        I believe that it what I'm looking for!

        Comment

        Working...
        X