Announcement

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

  • csdid

    It it possible to have Stata show the predicted outcome of the DV in a csdid setup. It shows the ATT, but I would like to see the predicted outcome. i.e. one step before calculating the ATT. My model looks like: "csdid DV_pct IV_pop_pct, ivar(CountryID) time(year) gvar(first_treat)". It works, but you like to see the predicted outcome for each year for control and treatment. Maybe @FernandoRios can help. Many thanks

  • #2
    No directly. You would have to run the whole model yourself. (by hand)

    Comment


    • #3
      Can you be more specific? Do you mean an estimate of the mean outcome in the untreated state? Or do you really mean a different predicted outcome for each unit in the untreated state? (That would be a lot of information.) Are you thinking you want to see the predicted values like you do in a regression-based imputation procedure?

      As Fernando says, you can always do the regression "by hand." I actually discuss the regression version in my recent paper in Empirical Economics on the Two-Way Mundlak regression. But I'm not sure this is what you mean.

      Comment


      • #4
        My best guess is that he wants to predict the counterfactual
        if that is the case, jwdid with predict can do that for you

        Comment


        • #5
          Many thanks! It helped me a step further. Predict works fine as long as I don't add covariate

          frause mpdta.dta, clear
          jwdid lemp, ivar(countyreal) tvar(year) gvar(first_treat) never group
          predict yhat // the predicted outcomes (counterfactuals) for each year for each treatment group (0/1), This can be used to calculate the Diff-in-Diff estimates which correspond to csdid below

          csdid lemp, ivar(countyreal) time(year) gvar(first_treat) never group

          *If I add a covariate

          frause mpdta.dta, clear
          jwdid lemp lpop, ivar(countyreal) tvar(year) gvar(first_treat) group never
          predict yhat // the outcomes for each year for each treatment group (0/1)
          collapse yhat, by(year treat) // as yhat is different across the covariate (lpop) I calculate the mean across year and treat

          *However, I fail to reproduce the ATT from the mean yhat with the csdid.
          csdid lemp lpop, ivar(countyreal) time(year) gvar(first_treat) never group

          Comment


          • #6
            you are right. csdid doesnt have that option because it produces many small regressions for each ATTGT
            JWDID estimates all at once, which is why you could estimate the counterfactuals:

            clone first_treat2=first_treat
            replace first_treat =0
            predict yhat_t0 ,
            replace first_treat=first_treat2
            predict yhat_t1 ,


            Comment

            Working...
            X