Announcement

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

  • Rdplot and Discrete Running Variable

    Hello everyone! I'm working on plotting a regression discontinuity with a discrete running variable (the year an individual graduates high school). I've run into a problem where the points plotted are not lining up correctly with the x-axis values. I want to say this stems from individual years of education not being binned correctly by cohort, but I'm not entirely sure how to go about this correctly.

    The code I use to get the graph is below:
    rdplot years_educ cohort, c(2004) p(1) ci(95) nbins(6 6) shade vce(cluster birth_ym) graph_options(xlabel(#10))


    I've included a picture of the graph I get using this code (rdplot_issue.PNG) as well as a picture of what it should look like (2004_years_educ_men.PNG) when I run the two regression lines and plot the scatter plot manually (the point with the average years of education for the 2004 cohort should be on the 2004 line, not to the right of it).
    I've also included a dta file ( rdplot_issue.dta ) with the relevant variables needed to recreate the plot (please let me know if this format doesn't work and I'll see about including the data some other way). Hopefully someone has an idea of why I'm seeing this / how to get the points to line up with the x-axis values correctly! I'd appreciate any insight anyone might have!
    Click image for larger version

Name:	rdplot_issue.PNG
Views:	1
Size:	15.6 KB
ID:	1737048

    Click image for larger version

Name:	2004_years_educ_men.PNG
Views:	1
Size:	18.5 KB
ID:	1737049





Working...
X