Announcement

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

  • csdid of Callaway and Sant'anna (2021) framework - how to obtain the propensity scores in the IPW estimator in Stata

    Hello

    I am running the Inverse probability weighting DiD estimator with stabilized weights (Stata option: stdipw) using the csdid command in Stata that is designed to perform various estimators from the Callaway and Sant'anna (2021) framework. I was wondering if there is a way in Stata to obtain the group-specific propensity scores that are internally calculated as part of the IPW estimator.

    Thanks

  • #2
    Not directly
    there could be so many to keep track off I dismiss doing that

    the only option is to run drdid for specific 2x2did and get propensities from there
    thia is what csdid does on the background. Calls on drdid and saves only the important components
    hth
    Fernando

    Comment


    • #3
      Hi Fernando.
      Thank you for your comment.

      I think obtaining the propensity scores is essential to perform some necessary diagnostics, especially the common support assumption.

      I followed your suggested approach.

      However, for every 2x2 did available in my dataset, I am getting a propensity score of 1 for every unit from the treatment group. As for the comparison units, I obtain percentages (0<ps<1).

      I understand that the propensity score in the IPW estimator (multiplied by -1) is used to adjust the difference in outcomes for units from the comparison group, but not for the treatment units. But why I'm getting a propensity score of 1 for the treatment units?
      My aim is to trim the sample to only include observations with propensity scores on an interval that is common between the treatment and comparison groups.
      Click image for larger version

Name:	Graph.jpg
Views:	1
Size:	40.3 KB
ID:	1705938


      Where s1,...,s5, are the propensity scores for my 2x2 designs

      Thanks
      Mohammed

      Comment


      • #4
        Well remember that you are estimating treatment effects on the treated thus treated units will get an ipw=1
        You just need to create the ipw for controls(there is an option like that too)
        try that first

        Comment


        • #5
          Hi Fernando
          Thank you for your explanation.

          "Well remember that you are estimating treatment effects on the treated thus treated units will get an ipw=1"
          I realise that, but I thought the propensities will be estimated for all units anyway.

          This is the general IPW estimator with stabilized weights:

          I thought the propensity score to receive the treatment at specific group date will be estimated using a logit model on pre-treatment covariates for all units, irrespective of whether they will be treated or not.
          Then, if the unit is in treatment group, the estimated parameter collapses to

          And if the unit is never-treated, the estimated parameter collapses to

          So, the negative IPW is used to adjust the difference in outcomes for control units only.


          In this case, to my understanding, whether to calculate propensity score for the treated units depends on the internal mechanics of the csdid command.
          Last edited by Mohammed Omran; 17 Mar 2023, 07:05.

          Comment


          • #6
            Alrighty, so here is the code that you can use for replication

            First comparing csdid with drdid

            Code:
            frause mpdta, clear
            csdid lemp lpop, ivar(county) time(year) gvar(first) long method(dripw)
            drdid lemp lpop if inlist(first,0,2006) & inlist(year,2005,2007), ivar(county) time(year) treat(first) dripw
            drdid_predict ps, pscore
            drdid_predict ipw, weight
            tabstat ps , by(first) stats(min max mean)
            tabstat ipw , by(first) stats(min max mean)
            Now, as example, I'm showing how one would estimate the effects for cohort 2006 in 2007 using never treated as controls
            This also estimates the pscore and the IPW
            You can use this for the formulas you have in mind.
            The estimation of the IPW's here is simpler than the stabilized one used internally, but gives you basically the same results.

            HTH
            F

            Comment


            • #7
              Hi Fernando.
              Thanks for your valuble support.

              I was wondering if there is any practical way to combine the IPW's of different 2x2 DDs into one variable? These and the propensities are important for many purposes, such as assessing the common support and overlap assumptions as well as incorporating the weights in various sensitivity analyses to check the sensitivity of ATT's for the potential impact of time-variant unobserved confounders.

              I appreciate the great effort invested into this command, but some additions would make it even more brilliant.

              Thanks
              ​​​​​​​Mohammed

              Comment


              • #8
                Hi Mohammed
                I see what you are saying. Especially when working with dripw instead of drimp, it is important showing balance after reweighting (even if one also use doubly robust methods)
                Unfortunately, that isn't an easy task, because IPW (or the underlying parameters) may change for each case depending on which ATTGT you are estimating.
                That being said, I ll try to reach out to Pedro and see what he things about alternatives.
                Cheers
                F

                Comment

                Working...
                X