Announcement

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

  • predictnl after reghdfe

    Hello,

    I am using Stata 17 with predictnl version 1.8.2 and reghdfe version 6.12.2.

    I try to estimate the predicted probability after a regression of the log odds ratio on covariates and many fixed effects.

    I am running the following commands:
    Code:
    reghdfe log_odds_ratio depvar  [pw=weights], absorb(year county_fe) cluster(state) resid
    predictnl pred_prob=exp(predict(xbd))/(1+exp(predict(xbd))) , se(pred_prob_se)
    and I get the following error message:

    expression is a function of possibly stochastic quantities other than e(b)
    r(498);

    Note that if I don't use a non-linear function of the estiamtes and just use predict, things work.
    Code:
    reghdfe log_odds_ratio depvar  [pw=weights], absorb(year county_fe) cluster(state) resid
    predict pred_log_odds_ratio, xbd

    Thanks a lot!
    Nicolas


  • #2
    Hi Nicolas
    The error that you get is more an informative message regarding theproblem.
    So, what you re trying to predict is log_odds_ratio_hat as a function of your dep variables and fixed effects. However, standard errors for fixed effects (year and country) are not estimated.
    Because of that predictnl is telling you there is a problem on doing that, because in addition to the point estimate, you are also requesting standard errors.

    The only way to fix the error is, as far as i know, explicitly add the dummies in your model, rather than try to "absorb" them.
    HTH

    Comment

    Working...
    X