Announcement

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

  • Manual Regression Discontinuity Design

    Dear all,

    I have time-series Data called accidents_day. This is a list of daily numbers of accidents from 2004 until 2014. In order to estimate the effect a traffic-safety campaign had, I would like to run a Regression Discontinuity Design.

    For the campaign, I generated a dummy-variable with values 0 before the campaign date and value 1 afterwards.

    Now: I would like to run two regressions; one before; one after. What confuses me is what I should regress accidents_day on?? It is in fact a trend I am looking for and trying to compare with the trend after the campaign. How can I do that?

    I realise this might be basic, but I haven't found advice in existing posts.

  • #2
    Based on your earlier post here giving the details of your regression discontinuity model that you fit using the rd command, I'm thinking something like

    Code:
    reg accidents_day c.date##i.campaign
    may be a start at what you need, assuming date is the name of the variable giving the date and campaign the name of your indicator variable. If you are unfamiliar with the c.date and i.campaign notation, help factor variables will give you an introduction.

    Perhaps someone will have a better idea, though. Did the rd command not work for you?

    Comment


    • #3
      To me, this actually looks like a time-series analysis with an impulse response function. I haven't run these in Stata, so I don't know the code for this. What William is suggesting can approximate the time-series, but using a time-series approach allows you to deal with temporal dependencies, potential seasonality, the possibility of a (non-linear) decay function after the campaign, etc.
      Stata/MP 14.1 (64-bit x86-64)
      Revision 19 May 2016
      Win 8.1

      Comment


      • #4
        Thank you to both, I really appreciate your help. Date is indeed the variable that gives the date in my case and the suggested code works. I am not sure yet how to interpret the output, but I guess I'll be alright with the help function.

        I will do more research on the suggested impulse response function, but as far as I can see, this is largely a graphical output?

        The problem I actually do have is that my data exhibits strong daily differences, i.e. accidents occur much less on weekends and are more frequent on Mondays. I need to find a way to smoothen this before I run the regression.

        I am thinking of regressing them on their dummy variables and then plot the residuals. However, I cannot figure out how to use the residuals to smoothen my data. Any idea there?

        Comment


        • #5
          Proceeding from where you are now at, you do not want to smooth your data, you want to include indicator variables for the day of the week, starting by using the day() function with your date variable as the argument to create categorical variable indicating the day of the week, for which you can then use i. notation to include indicator variables in the model.

          But more generally, adopting a time series framework as Carole suggests could facilitate handling seasonality in the natural fashion, where in your case seasonality is most obviously day-of-week, but may also have a longer-term second-order effect (month of year).

          Comment


          • #6
            You are right, there is also a longer-term seasonality that I have to take into consideration. I'll try Carole's framework and hopefully come to some conclusions. Thank you for helping me out!

            Comment

            Working...
            X