Announcement

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

  • Dear @FernandoRios,

    I hope this message finds you well. I have a few questions regarding the CSDID command, and I would greatly appreciate your assistance.

    1. Is there a method to access the coefficient of the interaction term in CSDID? Specifically, suppose I execute the following code:

    Code:
     gen interaction=policy*size
    csdid y interaction policy $controls, ivar(id) time(year) gvar(cohort) notyet cluster(clsvar)  agg(simple)
    where the “size” is a time-invariant variable, the “policy” is a dummy variable.

    2. Can I simultaneously estimate the heterogeneity effect (the coefficient of the variable "interaction") and the main effect (the coefficient of the variable "policy")?

    3. I observed an unusual occurrence when running the following code:
    I try to run the following
    Code:

    Code:
    csdid y policy $controls, ivar(id) time(year) gvar(cohort) notyet cluster(clsvar)  agg(simple)
    The coefficient of the variable "policy" is exactly the same as the variable "interaction," even though these two variables are distinct. Could you shed light on why the coefficients are identical? is the consistency between the coefficients of the interaction term and the dummy variable purely coincidental due to the data, or does it stem from the inherent nature of the code?

    Thank you very much in advance for your help!
    Best,
    Jiangyuan

    Comment


    • I would suggest to review the papers by callaway and Sant’Anna 2021 and Sant’Anna and zhao 2020. See helpfile for reference
      you will see that csdid only reports a single number, the attgt. Not coefficients for specific controls
      hth

      Comment


      • Thank you very much for your prompt reply! It helps me a lot!
        As a beginner, my understanding of csdid is still lacking, and I will review the papers by callaway and Sant 'Anna 2021 and Sant 'Anna and zhao 2020 carefully.
        Have a great day!

        Best,
        Jiangyuan


        Comment


        • Hi Fernando,

          Do you have any suggestions on how to adjust the codes to incorporate limited anticipation, specifically anticipating by one period?

          Best,
          Zunyuan

          Comment


          • Only via brute force
            that means modifying gvar to be gvar-1 if different from 0

            Comment


            • Hi Fernando,

              Thank you for the reply!

              I have a follow-up question: If my 'timevar' includes the years 2012, 2013, 2014, and 2015, and the original 'gvar' includes 0, 2013, 2014, and 2015, then by introducing 1-year anticipation, the new 'gvar2' should include 0, 2012, 2013, and 2014. In this scenario, I should remove the units with 'gvar2' = 2012 since they no longer have a pre-treatment period, right?

              Best,
              Zunyuan

              Comment


              • Hi Ferndando,

                I think I can add another question here:

                As described in my last post, my 'timevar' includes the years 2012, 2013, 2014, and 2015, and the original 'gvar' includes 0, 2013, 2014, and 2015.

                Previously, I use both not-yet-treated and never-treated as the control group. This went smoothly. I have event study estimates for tm3, tm2, tp0, tp1 and tp2 (-1 is the reference by using option long2).

                Now I want to check the results with using not-yet-treated only as the control group (this was done by excluding never-treated units from the sample). However, now the result does not provide estimates for g2015, and the ATTGTs for g2013 and g2014 are not using the year 2015 as well. In the end, I only have estimates for tm2, tp0 and tp1. Is this normal?

                Thanks for your always helpful posts. It's really appreciated.

                Best,
                Zunyuan
                Last edited by Zunyuan Zheng; 29 Nov 2023, 05:52.

                Comment


                • That is correct. You would no longer be able to estimate effects for cohort 2013 (now cohort 2012)
                  Regarding the other point. Thats normal
                  1) 2015 will have no comparison groups. You "could" estimate effects under slightly different assumptions (asinr option). I do not like that, but it recreates what DID in R does.
                  2) the last period will not be used as comparison for other periods either, because that unit is already treated
                  F

                  Comment


                  • Hi Fernando,

                    Thank you for the explanation! It has really clarified things for me.

                    Have a great day!

                    Best,
                    Zunyuan

                    Comment


                    • Dear @FernandoRios,

                      I hope this message finds you very well.

                      I have a few questions regarding csdid.

                      1. Can the dependent variable be binary, when using this command (e.g.: periods of autocracy=0; and periods of democracy=1), or should it be strictly continuous (e.g. a democracy index)?

                      2. When I include more control variables, I get an error message saying that: "estimates post: matrix has missing values". Why could that be? Should I use few/no controls?
                      Code:
                      csdid dv v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12 v13 v14 if subs_dummy==0 , ivar(country_id) time(year) gvar(first_treat) method(dripw) wboot rseed(1) agg(event)
                      3. I haven't figured out where to include weights (entropy weights), because if I place them before the comma, I get an error:
                      Code:
                      csdid dv v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12 v13 v14 if subs_dummy==0 [aw=_webal], ivar(country_id) time(year) gvar(first_treat) method(dripw) wboot rseed(1) agg(event)

                      Thank you so much!

                      Kind regards,
                      Cat




                      Comment


                      • Hi Cat
                        1. The dep variable can be binary or continuos. That, however, assumes a linear PTA. for a nonlinear PTA , you can use jwdid.
                        2. You definitely have to use far fewer controls.
                        For instance, seems you have a country level panel . So if you tabulate year and first_year, whatever you see as the smaller nonzero number, that is your "sample size" to consider for modeling.
                        Most likely that is very small (few countries?) so 1/2 variables would be the most you can add
                        3. For weights, you cannot specify "aw" either pw or w are valid. Internally it treated them as weight, because SE are done using robust standard errors.
                        Also, method dripw may not work with so many controls.

                        Hope this helps

                        Comment


                        • Dear @FernandoRios,

                          Thank you so much for your precious help! Good to know that I can have both DVs as long as they are linear. And I will use fewer controls.

                          Best wishes,
                          C

                          Comment


                          • Hello Fernando,
                            Thank you so much for the new CSDID2, which is very fast and efficient. How do you get a table in esttab with also the number of information?
                            Thank you,
                            Tommaso

                            Comment


                            • Just the regular way
                              estat event, estore(m1)
                              esttab m1

                              unfortunately, it does not store number of observations
                              f

                              Comment


                              • Thank you for your reply. Is there a way to understand which observations are used and then add them manually? My dataset is not balanced, and I am using i(var), so the command forces the dataset to be Pair-balanced with units observed between t0 and t1. Which units are removed? Maybe I can use the same algorithm to restrict the dataset before I run csdid2 so I will know the sample size.

                                Comment

                                Working...
                                X