Announcement

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

  • Counterfactual after fixed effect estimation (pb with xbu option)

    Hi,

    I can't find my way around the behaviour of the xbu option when trying to compute a counterfactual.

    I run an estimation with fixed effects like this
    xi: xtreg lexports $regressors fe1 fe2, fe cluster(pairid)
    then computed the prediction of the model, fixed effects included
    predict lexportmodel, xbu
    then I modify some regressors but only for years after a cut off date
    and finally I use predict again to built a counterfactual.
    predict lcounterfactual, xbu
    My problem is; with the option xbu, the counterfactual is different from the first prediction of the model before the cut off year. Without this option it's ok (both the prediction and counterfactual are equal before the cut off date).
    So it seems to me there is something peculiar with xbu.

    Does anyone know why there is this issue with the xbu option ?
    And do you have a solution ?

    best,
    Aurélien

  • #2
    I am not certain of this explanation, but I think it's correct.

    When you use -predict, xbu-, Stata does not have original estimates of u lying around. Rather, I believe it re-estimates the u's on the fly, basically by looking at the difference between the panel mean and the grand mean. If you make changes to one of the regressors during certain time periods, but some or all panels have observations in both time periods, the u's will change, and that will show up in the predicted u (and therefore also xbu) values for any observation in any panel that has had regressor values changed for any of its observations.

    I think to do what you want to do, you need to first -predict, u- separately with the actual data. Then create your actual and counterfactual estimates with -predict, xb- and add the values of u from the actual data to both of those.

    If this does not work out for you, please use -dataex- (-ssc install dataex-, -help dataex- if you are not already familiar with it) to show some data that illustrates the problem and I'll try to explore it further.

    Comment


    • #3
      Thank you so much for this ! It works perfectly !

      Comment

      Working...
      X