Announcement

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

  • How to calculate hat values in robust regression

    Hi,

    I am running a regression analysis that clusters standard errors (at the classroom level due to nested data). I am checking the regression assumptions, but ran into problems when trying to calculate the leverage values. I ran the command <predict h, hat>, but Stata returned an error message stating "Option hat not allowed after robust estimation."

    Does anyone know why this is the case? Is it appropriate to calculate hat values in my case, and how do I go about doing it?

    Thanks!

  • #2
    "hat" is not an option for -predict-. Assuming you just want a simple predicted value, try
    Code:
    predict yhat
    without any options.

    Also check -help predict-

    Comment


    • #3
      Wrong help command. Try

      Code:
      help regress postestimation##predict
      Leverage and hat are pseudonyms.

      I think this got answered in some other thread, but one strategy is just to not use robust in the estimation.

      -------------------------------------------
      Richard Williams, Notre Dame Dept of Sociology
      StataNow Version: 19.5 MP (2 processor)

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

      Comment

      Working...
      X