Announcement

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

  • #16
    I see the problem
    If this is a national program, then you cannot use DID as an approach to estimate the treatment effect
    For DID to work you need to have one of two cases:
    - One group was never affected by the treatment. Thus they can be used as controls and to see how outcome "could have changed" in absence of treatmetn
    - Treatment occurred at different points in time. So the NOTYET treated could be used as controls for the early treated.

    Comment


    • #17
      Hi Fernando, there is one group that was never affected by the programme. It is the control group (treat==0). I guess I just can't set up the data.

      Comment


      • #18
        Sandra, I think that is a missunderstanding.
        The best case scenario is that "control" group is never treated. But you said the program was implemented at the national level. So all observations were potentially treated at the same time.
        That is why i think you cannot use DID. (perhaps I missed something?)

        Comment


        • #19
          If I were using TWFE I would simply use

          Code:
          . reghdfe scores i.treat##i.policy , abs(stateid) cluster(stateid)
          (MWFE estimator converged in 1 iterations)
          
          HDFE Linear regression Number of obs = 10,493,003
          Absorbing 1 HDFE group F( 3, 26) = 389.62
          Statistics robust to heteroskedasticity Prob > F = 0.0000
          R-squared = 0.2352
          Adj R-squared = 0.2352
          Within R-sq. = 0.2020
          Number of clusters (stateid) = 27 Root MSE = 0.8745
          
          (Std. err. adjusted for 27 clusters in stateid)
          -------------------------------------------------------------------------------
          | Robust
          scores | Coefficient std. err. t P>|t| [95% conf. interval]
          --------------+----------------------------------------------------------------
          1.treat | -1.024237 .0334683 -30.60 0.000 -1.093032 -.9554424
          1.policy2 | .0115421 .0219972 0.52 0.604 -.0336739 .0567581
          |
          treat#policy2 |
          1 1 | -.0033288 .0203706 -0.16 0.871 -.0452012 .0385436
          |
          _cons | .7612002 .022866 33.29 0.000 .7141984 .8082019
          -------------------------------------------------------------------------------
          
          Absorbed degrees of freedom:
          -----------------------------------------------------+
          Absorbed FE | Categories - Redundant = Num. Coefs |
          -------------+---------------------------------------|
          stateid | 27 27 0 *|
          -----------------------------------------------------+
          * = FE nested within cluster; treated as redundant for DoF computation
          I think I could apply DID, I have two groups before (one treated and one not treated) and two groups after the treatment (treated and not treated).
          Last edited by Sandra Macedo; 15 Apr 2022, 09:03. Reason: delimiter for code was wrong

          Comment


          • #20
            Hi Fernando. I have almost a similar question to the one posted by Sandra. I have repeated cross-section data at the individual level and my treatment took place at the county level in 2013. There are 4 pre-treatment periods (2003,2005,2008 and 2011) and 3 post-treatment periods (2015, 2016 and 2019). I have some untreated counties and some treated.

            Can i use csdid to generate event study plots even though my treatment is not staggered?




            Comment


            • #21
              It’s valid and feasible. However make sure your years are coded so regular gaps are observed
              say 2years. Instead of a 2/3 year mix

              Comment


              • #22
                FernandoRios

                Hi Fernando,

                I am using drdid ipw command. According to the construction, it provides an estimate as proposed in Abadie (2005). You know another code in Stata absdid for Abadie (2005) exists. When I run both packages, I obtain different results. Specifically, I use the following commands:

                Code:
                drdid $ylist $xlist statedum* i.year, time( afterdaca ) tr( dacaelignow ) ipw
                Code:
                absdid $ylist, tvar(intafterelignow) xvar($xlist )
                where intafterelignow = afterdaca x dacaelignow

                Am I committing any mistake? Please let me know. I appreciate any help you can provide.



                Kind Regards,
                Woahid
                Last edited by S. M. Woahid Murad; 30 Aug 2024, 10:20.

                Comment


                • #23
                  Originally posted by S. M. Woahid Murad View Post
                  FernandoRios

                  Hi Fernando,

                  I am using drdid ipw command. According to the construction, it provides an estimate as proposed in Abadie (2005). You know another code in Stata absdid for Abadie (2005) exists. When I run both packages, I obtain different results. Specifically, I use the following commands:

                  Code:
                  drdid $ylist $xlist statedum* i.year, time( afterdaca ) tr( dacaelignow ) ipw
                  Code:
                  absdid $ylist, tvar(intafterelignow) xvar($xlist )
                  where intafterelignow = afterdaca x dacaelignow

                  Am I committing any mistake? Please let me know. I appreciate any help you can provide.



                  Kind Regards,
                  Woahid
                  The second command is

                  Code:
                  absdid $ylist, tvar(intafterelignow) xvar($xlist statedum* i.year)
                  instead of

                  Code:
                  absdid $ylist, tvar(intafterelignow) xvar($xlist)
                  Am I committing any mistake? Please let me know. I appreciate any help you can provide.



                  Kind Regards,
                  Woahid

                  Comment


                  • #24
                    I have to try
                    however I would suggest to go through the command paper for absdid and my presentation few years back for drdid

                    if the math doesn’t coincide, that would be the main isur
                    id the math is the same , then we can look into implementation

                    Comment


                    • #25
                      Woahid: There could be several things happening. First, the default Abadie propensity score estimator is a linear probability model that includes polynomials of the control variables. For drdid, the PS model is a logit. Now, you can use the "sle" option with absdid to force it to estimate a logit. I did that, and still got very different answers on a data set.

                      Assuming both approaches use a logit model with the x vars appearing linearly inside, the difference may arise from whether one uses normalized or unnormalized IPW estimator. I believe drdid uses normalized weights, which is now generally agreed is the right thing to do. I can't easily tell from Abadie's paper whether the weights are normalized, and there's no indication in the absdid help file.

                      But I'll mention something else. Both absdid and drdid are intended for T = 2 periods. Why are you including i.year among your x variables? There are other, more appropriate methods if you have more than two time periods. And if you have T = 2, then i.year is redundant.

                      Comment


                      • #26
                        Hi Professor Jeff, Thank you for your response. I am using the American Community Surveys (ACS) database. As you know, it is not panel data. By the timevar "afterdaca", I separated pre- and post-DACA declaration year (2012). However, my data is from 2005 to 2022. To control the time-variant fixed effect, I kept i.year in the command. Do you think that it has been misspecified?

                        Comment


                        • #27
                          You have many more than T = 2 periods. You should be using csdid, probably with the default doubly robust estimator. With Stata 18, hdidregress is another option.

                          Comment

                          Working...
                          X