Announcement

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

  • r(2000) missing data in rd

    Dear Stata community

    I am experiencing a problem in the rd command.

    I have a variable called accidents_day that contains information on the number of accidents for every day since 2004. There has been a large road-safety campaign in February 2009 and I am trying to evaluate its effectiveness on the number of accidents.

    Therefore, I generated a dummy variable campaign=0 before feb 09 and campaign=1 after. Using RDD, I would now like to estimate its effect.

    I tried rd accidents_day campaign but I get the error message no observations r(2000).

    Searching for similar inquiries didn't help, the problem there usually seems to be that the data is string. In my case, all variables are numeric.

    What am I doing wrongly?

  • #2
    You are asked to specify where user written commands come from (and what they do). rd is available from SSC and estimates a regression discontinuity model.

    Try the following commands:

    Code:
    sum campaign
    sum accidents_day
    count if !mi(accidents_day) & !mi(campaign)
    If the outcome from count is zero, then something is wrong with your data and you should look at what's going on with browse (perhaps you created campaign incorrectly). If the outcome from count is large, then something may be wrong with the way you specified rd.
    Stata/MP 14.1 (64-bit x86-64)
    Revision 19 May 2016
    Win 8.1

    Comment


    • #3
      That helps, thank you. The count is over 3800, so there should be no problem I guess.

      Any idea what I specified incorrectly? I understand there must be an assignment, treatment and outcome variable. In my case, this seems not straightforward to me though.

      Comment


      • #4
        Reading help rd suggests that the default interpretation of assignmentvar (campaign in your example) is to compare observations with assignmentvar>=0 to those with assignmentvar<0. (I agree, that seems peculiar coding, but may be specific to the regression discontinuity literature.) Since campaign takes on the values 0 and 1, all your observations are in the same group. Either try coding campaign differently, or use the z0 option to change the cutoff from 0 to 1.
        Last edited by William Lisowski; 07 May 2016, 12:21.

        Comment


        • #5
          You man are a hero! That did the trick. I just created values of -1 and 0 so now it seems to work. Thank you very much for the help

          Comment

          Working...
          X