Announcement

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

  • Hello! I am writing because I would like to plot just a specific number of pre/post periods, but csdid_plot does not allow me. This is my code:

    csdid centers_child gdp_pc edu pop nat, ivar(code) time(year) gvar(treatment) agg(event) long2 method(reg)
    matrix att = e(b)
    matrix V = e(V)
    eststo att
    esttab att using "$outputpath/figures/CHECKS/centers_child_cs.tex", tex replace
    estat event, window(-8,8) plot
    csdid_plot, style(rcap) pstyle(p1) graphregion(fcolor(white)) plotregion(fcolor(white)) title("ATT on Centers per Child", color(black))

    Comment


    • try
      csdid centers_child gdp_pc edu pop nat, ivar(code) time(year) gvar(treatment) agg(event) long2 method(reg)
      estat event, window(-8 8)
      estat plot

      Comment


      • Thank you Fernando! I have another question: in the command, the option agg(event) is what I should use if I want to aggregate my ATTs as the average effect of participating in the treatment for the group of units that have been exposed to the treatment for exactly e number of periods? Click image for larger version

Name:	Screenshot 2024-10-18 at 16.18.10.png
Views:	1
Size:	150.0 KB
ID:	1766000
        Thank you so much!

        Comment


        • exactly

          Comment


          • Good morning FernandoRios

            I tried to include in csdid command lagged variables but It came out a message saying that lagged variables cannot be used. Is this related to the fact that csdid uses 2X2 DiD design?

            Thanks a lot in advance...
            Tiziana

            Comment


            • No
              its related to the fact that factor notation was not programmed into
              alrhough I would suggest to consider what it means to add a lagged variable when estimating attgts

              Comment


              • Originally posted by FernandoRios View Post

                CSDID assume a unit is treated only once. then it remains treated.
                You can probably analyze the event's to say something about subsequent treatments
                Thank you ! In regard to my question and the code then, isnĀ“t it quite easy to adapt the formula for the code in order to handle not just one but also multiple treatments at different times for units? So that the csdid package would be able to handle such matters which would be beneficial. Best, J

                Comment


                • Originally posted by FernandoRios View Post
                  No
                  its related to the fact that factor notation was not programmed into
                  alrhough I would suggest to consider what it means to add a lagged variable when estimating attgts
                  Thank you FernandoRios , I was just wondering whether it could help to increase credibility of the unconfoundness assumption...but may be I am wrong...

                  Tiziana

                  Comment


                  • Please anyone tell me why this kind of results come applying csdid? Thank you



                    csdid imr, ivar(cid) time (year) gvar (first_year)
                    Panel is not balanced
                    Will use observations with Pair balanced (observed at t0 and t1)
                    xxxxxxxxxxxxxxxxxxxxxxxxxxxx
                    Difference-in-difference with Multiple Time Periods

                    Number of obs = 0
                    Outcome model : regression adjustment
                    Treatment model: none
                    -------------------------------------------------------------------------------------
                    | Coefficient Std. err. z P>|z| [95% conf. interval]
                    --------------------+----------------------------------------------------------------
                    g2011 |
                    t_2000_2003.143 | 0 (omitted)
                    t_2003.143_2006.286 | 0 (omitted)
                    t_2006.286_2009.429 | 0 (omitted)
                    t_2009.429_2012.571 | 0 (omitted)
                    t_2009.429_2015.714 | 0 (omitted)
                    t_2009.429_2018.857 | 0 (omitted)
                    t_2009.429_2022 | 0 (omitted)
                    --------------------+----------------------------------------------------------------
                    g2014 |
                    t_2000_2003.143 | 0 (omitted)
                    t_2003.143_2006.286 | 0 (omitted)
                    t_2006.286_2009.429 | 0 (omitted)
                    t_2009.429_2012.571 | 0 (omitted)
                    t_2012.571_2015.714 | 0 (omitted)
                    t_2012.571_2018.857 | 0 (omitted)
                    t_2012.571_2022 | 0 (omitted)
                    --------------------+----------------------------------------------------------------
                    g2018 |
                    t_2000_2003.143 | 0 (omitted)
                    t_2003.143_2006.286 | 0 (omitted)
                    t_2006.286_2009.429 | 0 (omitted)
                    t_2009.429_2012.571 | 0 (omitted)
                    t_2012.571_2015.714 | 0 (omitted)
                    t_2015.714_2018.857 | 0 (omitted)
                    t_2015.714_2022 | 0 (omitted)
                    --------------------+----------------------------------------------------------------
                    g2022 |
                    t_2000_2003.143 | 0 (omitted)
                    t_2003.143_2006.286 | 0 (omitted)
                    t_2006.286_2009.429 | 0 (omitted)
                    t_2009.429_2012.571 | 0 (omitted)
                    t_2012.571_2015.714 | 0 (omitted)
                    t_2015.714_2018.857 | 0 (omitted)
                    t_2018.857_2022 | 0 (omitted)
                    -------------------------------------------------------------------------------------
                    Control: Never Treated

                    See Callaway and Sant'Anna (2021) for details

                    Comment


                    • Few things to try
                      a) check you have latest versions of csdid and drdid installed in your computer.
                      b) check gaps in data (tab year gvar)
                      this will tell me what could be explaining this

                      Comment


                      • FernandoRios I am hoping you can help. Apologies if you have gotten this question before.

                        I have an unbalanced panel of house sales. They are organised by transaction. I have created treatment through spatial matching (e.g. 10km radius). I have created first_treat but when I do: tab year first_treat it looks like this. How do I correct this?

                        Year first_treat
                        0 1993 1994 1995
                        1991 10913 0 0 0
                        1992 13663 0 0 0
                        1993 8862 2980 0 0
                        1994 6328 0 5616 0
                        1995 4191 0 0 4473
                        Second, for ivar in the formula, I can either use the house identifier or transaction sale identifier(first column). If I use the house identifier, they are typically traded infrequently. I would love to use the suburb identifier but there are too many of those transactions per year and the formula does not allow for that.

                        Would you suggest I use any other model?

                        Sample of the data
                        Listed 3 out of 371370 observations
                        uniqueidentifier saleprice year houseid treated_5km first_treat
                        26306 860000 2021 106938 1 2021
                        3215 1700000 2015 255824 0 0
                        3679 1635000 2024 153978 1 2024

                        Comment

                        Working...
                        X