Announcement

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

  • So, usng cluster and ivar will give you the same results only if covariates are fixed across time.
    If that isn't the case, the estimates will change because as panel, only pre-treatment variables are used, but as repeated crossection, both pre and post values are used.
    my suggestion is to use panel estimators if possible
    F

    Comment


    • Originally posted by FernandoRios View Post
      So, usng cluster and ivar will give you the same results only if covariates are fixed across time.
      If that isn't the case, the estimates will change because as panel, only pre-treatment variables are used, but as repeated crossection, both pre and post values are used.
      my suggestion is to use panel estimators if possible
      F
      Many thanks, Fernando. Your answers are greatly appreciated!

      I take it that your suggestion is to use the ivar command.

      How does one describe the way standard errors are estimated when using the ivar command?

      Comment


      • Just as you said
        they are clustered standard errors (default) or wild bootstrapping standard errors clustered at state level

        Comment


        • Originally posted by FernandoRios View Post
          So, usng cluster and ivar will give you the same results only if covariates are fixed across time.
          If that isn't the case, the estimates will change because as panel, only pre-treatment variables are used, but as repeated crossection, both pre and post values are used.
          my suggestion is to use panel estimators if possible
          F
          Hi FernandoRios many thanks for helping us out! ) I read your post above and got confused about calculation of the weights when using repeated cross-section data. I wonder if you can clarify. I'm been using logit with baseline covariates to calculate the weights and saw you mentioning that csdid uses both periods. I looked in the ado but couldn't find the first step calculations (sorry that's too. above my knowledge).

          Code:
          csdid scores $X i.stateid , time(year) gvar(cohort)  cluster(schoolid) method (dripw) rc1
          csdid scores $X i.stateid , time(year) gvar(cohort)  cluster(schoolid) method (stdipw) rc1
          That explains why results are so different also between methods, besides the fact it is using a 2x2 for each time period and groups (in my case it is only one group but t >2).
          By the way, I've seen csdid2 on your github, but couldn't install it (any tips?). Looking forward to it. Is there a help file yet?
          Well many many thanks!!

          Comment


          • Hi Sandra
            No, the reason why this two give you different results is because dripw uses not only reweighting but also outcome regression to estimate the results.
            ok so. a step back
            When using panel data crossection, the following steps are used for each individual 2x2

            s1. Obtain the first difference of outcomes (so you need a balanced panel): DY = Y_t1 - Y_t0
            s2a. Estimate Probability of treatment
            S2b. Estimate model of DY as a function of X_t0 fo the controls:
            DY = X_t0*Beta + e Controls only (and possibly reweighted)
            (s2a and s2b make your model DR)
            s3. Predict DY for treated units. and get 2nd difference (possibly correct for reweighting)
            DY - hat_DY for Treated
            S4. Take average, and done. that is your 2x2 ATT

            for RC, is far more involved
            s1. Estimate probability of treatment
            s2. estimate outcomes for all 4 cases (Treated T0 treated T1, control T0 control T1) <-multiple models
            s3. Reweight if necessary. And obtain ATTs

            DR uses S2, stipw only S3 to obtain ATTs. But because you can t follow individuals across time. All data (t0 and t1) is used for the ATT estimation


            Comment


            • Hi Fernando, thank you so much for the clarifications! Yes, I understand DR uses OR + (st)IPW. I wasn't sure about RC-s1 involving all data. Thanks! Really appreciate it. Also seen the drdid ado file.
              Last edited by Sandra Macedo; 28 Mar 2023, 12:58.

              Comment


              • for details on RC1 and without RC1 check Sant'Anna and Zhao (2020) regarding efficient estimators for DR.
                Bottom line, you do not need it. I added that for completeness

                Comment


                • Hi,

                  I had the following question for you Mr. FernandoRios:

                  Originally posted by Devon Smith View Post
                  Hi:

                  I am trying to estimate the effect of a policy using the dynamic DID model by Callaway and Sant'Anna using the CSDID package. I have individual-level cross-sectional data. The policy I am investigating affects individuals living in urban areas (I have an indicator for urban) who were born after the year 1990 (sample contains individuals born between 1975 and 2000). I have tried the following code:
                  Code:
                  csdid years_schooling, ivar(urban_rural) time(YOB) gvar(first_treat) method(ipw)
                  . where first_treat=1 if living in urban area and born after 1990. However, I have realized that this code would only work with proper panel data setup, with only one observation per ID per period. Does anybody know how I can modify the above code for individual level data with many observations per urban/rural id per year of birth?

                  Comment


                  • I dont have enough information to say how to construct your gvar here
                    However, gvar and time should be on the same scale (not a 0 1 but a 0 and the year a unit was potentially treated for the first time)
                    You will need to say more about the problem the treatment, etc

                    Comment


                    • Dear FernandoRios,


                      I would like to express my gratitude for providing me with the Stata tool package and the related explanations. It has been very helpful in my project. However, I have a question regarding the outcome regression in the double-robust estimator when using the "drimp" or "dripw" commands.

                      Specifically, I would like to know what model is used in the outcome regression of the double-robust estimator when using these commands. Is it a simple linear DID model of the form Y = Xbeta + Dgamma + theta, where X represents the control variables I input in the "indepvar" and D represents the treatment dummy variable ?

                      Thank you very much for your assistance in this matter.

                      Sincerely,


                      Kong

                      Comment


                      • Neither
                        for details I suggest you read callaway and Sant’Anna 21 paper a long with my notes here
                        https://friosavila.github.io/app_met..._metrics2.html
                        hth

                        Comment


                        • Dear Fernando,
                          thank you so much for having programmed the csdid command. It’s very useful! However, I keep running into a problem that I do not seem to be able to solve:
                          I use the csdid command for a while and sometimes, after having made a few minor adjustments in the data (like creating a new variable with egen z = group(…); nothing that should affect any of the relevant variables), suddenly the csdid command starts making weird 2x2 comparisons (1999 – 2006 – 2013, instead of 1999 – 2005 - 2013) and most coefficients cannot be estimated as you can see in the csdid screenshot. I’m also attaching screenshots of tab gvar (EMR year) tvar (surveyyear) as well as of tab gvar regions and the output after the ereturn command.
                          The reform was implemented at the regional level in a staggered manner (two never-treated regions) and I use repeated cross-sections (individual level). I want to estimate how short-term outcomes were affected by the reform (thus tvar = survey year).
                          Do you have any idea what could be the problem?
                          Kind regards,
                          Anne
                          Click image for larger version

Name:	treatmentyear_by_region.png
Views:	1
Size:	21.5 KB
ID:	1712667

                          Click image for larger version

Name:	gvar_tvar_table.png
Views:	1
Size:	19.1 KB
ID:	1712666

                          Click image for larger version

Name:	csdid_output.png
Views:	1
Size:	39.1 KB
ID:	1712664

                          Click image for larger version

Name:	csdid_ereturnlist.png
Views:	1
Size:	35.8 KB
ID:	1712665

                          Last edited by Anne Simon; 08 May 2023, 02:52.

                          Comment


                          • Can you confirm if you are using the latest version of csdid?

                            Comment


                            • Yes, I'm using the latest version of csdid, I just checked (and I work with Stata 18).

                              Comment


                              • Version 1.71?
                                ok
                                just for checking
                                tab surveyyear reformyear, nolab
                                Other than verifying this I may need to a reproducible example to check this out on my end
                                Fernando

                                Comment

                                Working...
                                X