Announcement

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

  • xtreg postestimation, what is xb doing ?

    Dear all,

    i am estimation an FE panel estimation xtreg y x, fe.
    When predicting my fitted values: predict yhat, xb does NOT give me the same results than gen yhat2= _cons + _b[x]*x, nor gen yhat2= _b[x]*x
    can you explain me why ?
    thanks in advance
    ac

    (nb: i also checked , predict yhatu, xbu, predict u, u)

  • #2
    Originally posted by anne claire View Post
    When predicting my fitted values: predict yhat, xb does NOT give me the same results than gen yhat2= _cons + _b[x]*x
    The system variable _cons when used directly is equal to the number 1, which is not what you want here; instead, you want the value of the intercept from the fitted model. Try
    gen yhat2= _b[_cons] + _b[x]*x
    instead.

    Comment

    Working...
    X