Announcement

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

  • Difference in Differences with cross sectional data - continuous treatment (didregress)

    Hello Members,

    I have a pressing doubt in implementing the diff in diff in Stata 17. - didregress command.

    My research question explores the impact of mobile phone usage on the crop yield of farmers. In this model, I have a continuous outcome (crop yield of farmers), treatment variable (usage of phones), few covariates (farm level variables), Time variable (crop season A and crop season B) and group variable - ??

    The didregress requires the following command for cross sectional - repeated measures data -
    "didregress (y1 x1 x2) (treat1), group(grpvar1) time(tvar)"

    In the current case, I have crop yield data (outcome variable) of 1000 farmers in two crop seasons (time-variable), whereas the treatment is the usage of phones (measured in number of minutes over the study period). Given the above command, my research question, and the data available, I have two doubts -

    1. What is the group variable for the didregress model in this case? As you see, I am not giving intervention based on any groups. I thought each farmer was his/her own group. But I got errors while executing this
    2. How do I implement continuous treatment variable in didregress? I know that we need to specify "(treatment_variable, continuous)" but that doesn't seem to work and throws errors.

    Can someone please help me in this?
    Regards

  • #2
    Dear Shiva,

    In the traditional setup (2 by 2) people would think about a treatment group, a period before the intervention and a period after the intervention, and an interaction of the two. You would fit something like:

    Code:
    regress outcome i.treatment_group i.post_period i.postperiod#i.treatment_group
    Here some individuals belong to the treatment group and some do not. A typical example would be a repeated cross section of states where individuals in some states receive the treatment and some do not. Individuals in your sample should belong to a treatment or a control group.

    -didregress- needs a time variable, which you have in your crop season variable, a group variable, perhaps farmers in certain regions are treated, and an indicator for observations that are treated. This indicator usually correspond to the interaction of post_period and belonging to the treatment_group, something like treated = 1.postperiod*1.treatment_group. You would estimate something like:

    Code:
    didregress (outcome x1 x2 x3) (treated), group(region) time(crop_period)
    If treatment is continuous, you would type

    Code:
    didregress (outcome x1 x2 x3) (treated, continuous), group(region) time(crop_period)

    Comment


    • #3
      Originally posted by Enrique Pinzon (StataCorp) View Post
      Dear Shiva,

      In the traditional setup (2 by 2) people would think about a treatment group, a period before the intervention and a period after the intervention, and an interaction of the two. You would fit something like:

      Code:
      regress outcome i.treatment_group i.post_period i.postperiod#i.treatment_group
      Here some individuals belong to the treatment group and some do not. A typical example would be a repeated cross section of states where individuals in some states receive the treatment and some do not. Individuals in your sample should belong to a treatment or a control group.

      -didregress- needs a time variable, which you have in your crop season variable, a group variable, perhaps farmers in certain regions are treated, and an indicator for observations that are treated. This indicator usually correspond to the interaction of post_period and belonging to the treatment_group, something like treated = 1.postperiod*1.treatment_group. You would estimate something like:

      Code:
      didregress (outcome x1 x2 x3) (treated), group(region) time(crop_period)
      If treatment is continuous, you would type

      Code:
      didregress (outcome x1 x2 x3) (treated, continuous), group(region) time(crop_period)
      Dear Enrique,

      Can you please give the underlying principle of what basically does
      Code:
      didregress
      do? Like writing the maths formula or providing a traditional
      Code:
      regress
      code line that's equivalent to the new
      Code:
      didregress
      command.

      Thanks.

      Comment


      • #4
        Hi Mat,

        Please take a look at the first section of the Methods and Formulas in https://www.stata.com/manuals/tedidregress.pdf . We provide a discussion of how -areg- maps to -didregress-

        Comment


        • #5
          Originally posted by Enrique Pinzon (StataCorp) View Post
          If treatment is continuous, you would type

          Code:
          didregress (outcome x1 x2 x3) (treated, continuous), group(region) time(crop_period)
          @ Enrique Pinzon, I looked the didregress help manual, the description is not very detailed about how to understand the treatment effect of a continuous treatment variable.
          I was hoping to have a paper to read to understand it more, and it looks like the papers that the manual cited are predominately binary treatment.

          So my question is: what does the treatment coefficient measure? if the continuous treatment is a percentage, does it measure the effect of a one percent increase in treatment intensity on the outcome variables, compared to never treated individual or (never treated individuals + individual with a lower treated intensity)?
          Can I find a paper that this the continuous treatment method this manual is based on?

          Thank you so much for your help,
          Alex

          Comment


          • #6
            Continous DD is a rapidly advancing topic. Whatever paper you find about it will likely be written by and for econometricians. If that's cool with you, read this. Alex Wang

            Comment

            Working...
            X