Announcement

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

  • #91
    Hi FernandoRios,

    Thanks a ton for having developed the csdid command and for being so responsive about questions on this forum. This is such a great service to the community!

    I have a question regarding "estat event" after successfully running csdid. Is there any way to group two years together to one bin? With "years" I am referring to years relative to the event, i.e. I would like to group Tm1 and Tm2 to one bin, group Tp0 and Tp1 to the next bin, etc., and show the event-study graph for these bins. The reason is that the number of observations differs heavily across the single pre- and post reform years in my setting, and grouping single years together to bins of multiple years would smooth the number of observations.


    Many thanks!

    All the best,
    Ben

    Comment


    • #92
      Hi Ben,
      There is a rather complicated way of doing this.
      1) you cannot do it for all the years at once.
      2) but you can ask estat cevent to produce those bin years one by one

      for example, say that you have the following relative years - 5 -4 -3 -2 -1 0 1 2 3 4 5
      You can call on estat cevent to bind then as follows:
      estat cevent, window(-5 -3)
      estat cevent, window(-2 -1)
      estat cevent, window(0 1)
      estat cevent, window(2 3)
      estat cevent, window(4 5)

      this could help you bulding your summary table of the effects, but it wont produce a single table to make the graphs.
      HTH
      Fernando

      Comment


      • #93
        Hi Fernando,

        Thanks a ton for the quick and reply, your approach this works perfectly fine. I can produce the graph manually from the respective bins.

        Thanks again!
        Ben

        Comment


        • #94
          Dear FernandoRios .
          In my sample, when I use not-yet treated units as a comparison group for units treated first at period 'g', I mostly get the significant results of group-time, event-time and calendar-time effects. My STATA command is
          Code:
          csdid log(Y) if first_treated !=0, cluster(state) time(year) gvar(first_treated) notyet method(dripw)
          I put gvar!=0 and specify notyet in the command line, so that it use only not-yet-treated units by 'g' as comparison for units already treated at 'g'. Is this correct ?

          I also have never treated units in my sample (units that never received treatment) . I also calculate all the group-time, event-time and calendar-time ATT's now using never treated as a pure comparison for units treated in each cohort respectively. I write the following command to execute that:

          Code:
          csdid log(Y)  , cluster(iso) time(year) gvar(first_treated) method (dripw)
          Here i loose the significance. Almost all the earlier dynamic effects (group, event and calendar time) becomes insignificant once using NEVER TREATED as a comparison.

          Why is this a case, that you get significant results by using NO-YET-TREATED as comparison but Insignificant once NEVER TREATED are used as a comparison.

          Comment


          • #95
            Hi Ridwan
            Difficult to say without knowing the data, or the topic.
            But some hints
            My first impression would be a matter of sample size (how many never treated you have compared to the not yet treated).
            How different are the outcomes of never treated and not yet treated before treatment? (perhaps comparing means ?)

            Is this unique to csdid? or did you see similar results using the alternative methods (did_estimate did2s etc)

            F

            Comment


            • #96
              Thank FernandoRios for getting back to me
              1) My unit is state and i have 137 states, 27 states are Never-complied (pure comparison) to the law and rest 110 states signed the legislation at different dates which defines my cohort/group at the particular date 'g'.
              using notyet as a comparison calculates the ATT for particular group first treated at 'g' using states that have not complied to the said legislation at 'g' , but are complied later . Obviously, as i move along and calculate ATT for other groups , the comparison group shrinks as other states become complied and can no longer be used as comparison. I think that is the standard way in Callaway and Santa'anna (2021). I hope, i have made it clear. I get significant results here

              When i use never-complied as comparison it calculates ATT for each group using states that are never complied to the legislation (27 states) as a pure comparison and this group in principle is fixed. However, i do not get significant results here.

              2) Once using notyet as comparison, it does not seem to me that i have significant pre-trends, same is true once never-treated is used as a comparison. I can send you the event-study plots in both the cases and if you could please have a look . (Please send your email-id here)

              3) This is unique to csdid, i have not tried any other estimator.

              Thanks,

              Comment


              • #97
                Dear FernandoRios,

                thank you very much for the command you built! I have one silly question: is there a way to get access to the covariate's coefficient or is it not possible because csdid computes a weighted average of all possible 2x2 did?

                Specifically, for example, if I run the following
                Code:
                 csdid y size, ivar(id) time(year) gvar(cohort) notyet cluster(clsvar)  agg(simple)
                Is there a way to get access to the estimated coefficient of the variable "size"?

                Finally, is now available the option for choosing between universal vs varying base events when plotting event studies?
                Thank you very much in advance for your help!
                Best,
                Samuel

                Comment


                • #98
                  Hi Samuel
                  so.
                  1) No there isnt a way to get those coefficients. The reason is that when you run CSDID you are estimating approximately Year X cohort models (x2 because of logits and Linear regressions if using Doubly robust)
                  The only way you could get Some of those coefficients is to run drdid for each particular 2x2 DID. And save the outcomes from that command.

                  2) Yes its possible, but with a slightly different procedure (since we started to make small differences in the programming)
                  The default option is to produce varying base estimates.
                  For the universal base, I added the option long and long2.
                  long is my original interpretation of how the Pretrend should be obtained (namely estimating a treatment effect compared to the earlier periods.
                  For example ATTGT(G=20, T=10) = E(Y_19-Y_10|D==1) - E(Y_19-Y_10|D==0)
                  Because you are looking at how much the outcome change since T=10 to the period before treatment took place. (usually this is the T-1 period)

                  Now, base universal (As defined in DID) is more similar to what you get with other DID approaches. I do this using the option long2
                  Here the ATTGT(G=20, T=10) = E(Y_10-Y_19|D==1) - E(Y_10-Y_19|D==0)
                  ATTGT(G=20, T=30) = E(Y_30-Y_19|D==1) - E(Y_30-Y_19|D==0)

                  So ALL ATTGT's are produced using the same outcome as "base" (universal base).

                  estat event will produce the appropriate graph depending if you use the default, long or long2.

                  Hope this helps
                  F

                  Comment


                  • #99
                    Dear Fernando,

                    thank you very much for your reply and the explanations. I updated the command and I used option long2 as you suggested, it works thanks.
                    Best,
                    Samuel

                    Comment


                    • Dear Fernando,

                      I'm using Barro&Lee(2021) dataset and I'm trying to run the following specification:
                      csdid yr_sch pop, ivar(BLcode) time(year) gvar(year_First_FDL) method(reg)

                      For some reason it does not take any observation and all coefficients are "omitted". Also full of X's appear when running the command. Based on your previous answers I suspect it may be due to the small sample size of my gvar. I have many groups but only a few obs per each group. If that is the problem, is there any way I can estimate it? Maybe using some other estimators? With xtreg models, for example, it worked well.

                      Thank you very much in advance and for the nice discussion of this forum.

                      Alex

                      Comment


                      • Not sure about the dataset
                        but just to check
                        do you have the latest drdid and csdid files?

                        Comment


                        • Yes. I updated all the files this week.

                          The dataset is a panel consisting on countries x year. However, there are obs only every 5 years (1995, 2000, 2005..). I already account for that year's structure by setting xtset BLcode year, delta(5).

                          Thanks!

                          Comment


                          • Two other questions
                            do the examples run fine? And can you share the data?
                            fyi csdid doesn’t use xtset info except for checking if panel exist

                            Comment


                            • The examples with other datasets (e.g. csdid lemp lpop , ivar(countyreal) time(year) gvar(first_treat) method(dripw) ) work fine.

                              That dataset is taken from here: https://github.com/barrolee/BarroLee...master/BLv3.md --> Education Attainment by Age Group: Female population
                              I only take one group age (from 15 y/o to 24 y/o) to allow country x year uniquely identify observations.

                              Thanks for the clarification regarding xtset and csdid. Then, should I specify that I only have obs every 5 years?

                              Thank you!

                              Comment


                              • The gvar is created by myself, so it is not in the original dataset. It has the same form/structure as the first_treat variable used in the example.
                                As I said, the problem may be that I have too few obs per treated cohort; ranging from 1 to 20 obs per cohort.

                                Comment

                                Working...
                                X