Announcement

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

  • Generalized Diff in Diff

    Hi all,

    I have a question regarding the correct process for a generalized diff in diff. I am looking at state-level policies that were implemented in various years in various states across a 13-year period (2008-2020). The policies in question (variable: policy) have been grouped into three categories (1 (neutral), 2 (restrictive), 3 (protective)) for levels of impact. I am most interested in policy level 2. Each state fits one of these three categories each year; however, their policy "categories" or levels of restriction change over time. Some states increased restrictions over the 13-year period, others decreased them, some remained the same, all at different time points. My sample includes all 50 states (variable: state2).

    I am attempting a diff in diff with state and year fixed effects to assess the impact of the degree of policy restrictions on a continuous variable (variable: mcaid_total). I would love some guidance to ensure I'm on the right track with my approach.

    Here is a sample of my data:

    Code:
    input int year long state2 float(policy mcaid_total)
    2008 1 2      4400
    2009 1 2      5048
    2010 1 2      5394
    2011 1 2      5244
    2012 1 2      5627
    2013 1 2      5586
    2014 1 2      5811
    2015 1 2      6083
    2016 1 2      6354
    2017 1 2      6490
    2018 1 2      6580
    2019 1 2      6977
    2020 1 2      7404
    2008 2 1       971
    2009 2 1      1018
    2010 2 1      1171
    2011 2 1      1361
    2012 2 1      1369
    2013 2 1      1388
    2014 2 1 1422.9962
    2015 2 1 1554.8275
    2009 5 3     40235
    2010 5 3     39151
    2011 5 3     51503
    2012 5 3     43052
    2013 5 3     46399
    label values state2 state2
    label def state2 1 "Alabama", modify
    label def state2 2 "Alaska",
    label def state2 5 "California", modify
    label values policy policy
    label def policy 1 "Neutral", modify
    label def policy 2 "Restrictive", modify
    label def policy 3 "Protective", modify
    Currently, I am doing the following in stata:

    Code:
    xtset state2 year
    
    xtreg mcaid_total mcaid_expansion i.policy i.year, fe
    mcaid_total is my outcome, mcaid_expansion is a covariate, and policy is my independent variable.

    Is this correct for this test? Am I missing something to measure validity?

    Also, is there a way to create a visual for the parallel trend assumption, such as a chart with years before and after policy implementation on the x axis and change in medicaid expenditures (my outcome of interest) on the y axis?

    Thank you so much for your help!

  • #2
    No state has a change in policy (in this sample). You cannot do DD.

    Comment


    • #3
      Oh you're right. I did not share a very useful sample of my data. Let's try this again (note I greatly shortened the sample for brevity, the state labels do not match the sample here, but you get the idea). Thanks!
      Code:
      input int year long state2 float(policy mcaid_total)
      2008 34 2       544
      2008 25 2      6667
      2008  5 3     38291
      2008  1 2      4400
      2008 33 1     10994
      2009 11 3      1331
      2009 10 1      7619
      2009  2 1      1018
      2009 26 3     841.3
      2009 47 3      7223
      2009 48 1      2433
      2009 20 3  6161.297
      2009 30 3      9386
      2009 43 1     21016
      end
      label values state2 state2
      label def state2 1 "Alabama", modify
      label def state2 2 "Alaska", modify
      label def state2 3 "Arizona", modify
      label values policy policy
      label def policy 1 "Neutral", modify
      label def policy 2 "Restrictive", modify
      label def policy 3 "Protective", modify

      Comment


      • #4
        Is there any period for which all states have policy==1? That seems to comport with an "untreated" state.

        If not, then you've got a tricky problem. And, if the treatments occur at different times, then you've got to think about the timing.

        Might look at:
        Code:
        ssc install csdid
        ssc install drdid






        Comment


        • #5
          There isn't a period where all states have policy==1. I'm not familiar with these two options. I will look into them!

          Comment


          • #6
            This is a very difficult problem.

            Comment


            • #7
              George Ford Samantha Strong another command you might consider is one called flexpaneldid. It's a matching based estimator which allows you to have multiple interventions across time for multiple durations of treatment.

              Comment

              Working...
              X