Announcement

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

  • Regression discontinuity in time

    Hi everyone,

    I want to estimate the effect of an insurance policy on the health outcomes of children using the Regression discontinuity in time design. I have data on the month and year of birth of these children as well as other health outcomes. I created the DateTime as shown below, however I am not able to use it as my independent variable when using rdplot or rdrobust. When I include the date the policy was implemented as the cut off, I get this error message: "c() should be set within the range of DATETIME".

    rdplot healthoutcome birthmonth-year, c(1 1992) p(1)

    How can I use the DATETIME variable as a cutoff in this regression? I have included an example of my data and the cut off date is ( 1 1992 ). Thank you.

    month year birthmonth-year healthoutcome
    6 1993 6 1993 .49
    2 1991 2 1991 -.9
    8 1992 8 1992 -1.29
    7 1993 7 1993 -.14
    3 1992 3 1992 -1.8
    4 1992 4 1992 -2.13
    5 1991 5 1991 -3.39
    8 1992 8 1992 -1.09
    8 1993 8 1993 -2.51
    5 1991 5 1991 -4.85
    10 1992 10 1992 -2.25
    9 1991 9 1991 -2.59
    9 1993 9 1993 -.09
    2 1991 2 1991 -2.94
    2 1991 2 1991 -4.14
    10 1992 10 1992 -1.42
    6 1993 6 1993 -1.40
    5 1991 5 1991 -2.47
    2 1992 2 1992 -2.39
    9 1992 9 1992 -2.53
    1 1993 1 1993 .01
    12 1992 12 1992 2.2
    7 1991 7 1991 -.04






  • #2
    you have 2 numbers in the parens after "c" for the cutoff - that is not allowed - you can only use one number (see the help file); it appears that you have not formed a new DATETIME variable (since you neither show it nor show how you defined) and you need to do that using Stata's date functions; see
    Code:
    h datetime

    Comment


    • #3
      It appears that if you want to specify the year-month variable using e.g., one of the convenience functions, you need to force the evaluation of the function. Otherwise, write out the numerical SIF value and include it directly. rdplot is from the Stata Journal (FAQ Advice #12).


      Code:
      * Example generated by -dataex-. For more info, type help dataex
      clear
      input byte month int year double healthoutcome
       6 1993   .49
       2 1991   -.9
       8 1992 -1.29
       7 1993  -.14
       3 1992  -1.8
       4 1992 -2.13
       5 1991 -3.39
       8 1992 -1.09
       8 1993 -2.51
       5 1991 -4.85
      10 1992 -2.25
       9 1991 -2.59
       9 1993  -.09
       2 1991 -2.94
       2 1991 -4.14
      10 1992 -1.42
       6 1993  -1.4
       5 1991 -2.47
       2 1992 -2.39
       9 1992 -2.53
       1 1993   .01
      12 1992   2.2
       7 1991  -.04
      end
      
      g mdate= ym(year, month)
      format mdate %tm
      rdplot healthoutcome mdate, c(`=tm(1992m1)') p(1) graph_options(xlab(371 377 384 389(6)406, format(%tm)))
      Res.:
      Click image for larger version

Name:	Graph.png
Views:	1
Size:	25.0 KB
ID:	1674725

      Last edited by Andrew Musau; 22 Jul 2022, 17:26.

      Comment


      • #4
        Thank you so much. It works!

        Comment

        Working...
        X