Announcement

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

  • rdplot, cmogram and RDD design

    Dear all, I am a freshman and learning Regression Discontinuity Design in recent days. Command rdplot is a newly developed code by very renowned scholars in this field. Now I have several questions concerning this:
    1. The confidence intervals. Use the classic data from: https://sites.google.com/site/rdpackages/rdrobust. With the code as below, we can get the picture afterwards:
    rdplot demvoteshfor2 demmv,nbins(15 35) graph_options(xlabel(-100(25)100) legend(off) xtitle("demmv") ytitle("demvoteshfor2")) ci(95) shade genvars p(2)

    Click image for larger version

Name:	Graph.png
Views:	1
Size:	58.9 KB
ID:	1456176

    According to the papers of my interest like https://www.sciencedirect.com/scienc...04387815001327 and the cmogram command, I can also draw this picture using collapsed data with tw scatter and the original data with qfitci command:
    tw (scatter rdplot_mean_y rdplot_mean_x) ///
    (qfitci demvoteshfor2 demmv if demmv<0,fcolor(none)) ///
    (qfitci demvoteshfor2 demmv if demmv>=0,fcolor(none)),xline(0) legend(off)


    Click image for larger version

Name:	Graph2.png
Views:	1
Size:	58.7 KB
ID:	1456177

    Apparently, the confidence intervals are different. Now I wonder why there exists the difference and which one should be favored? or any one of them is wrong? I guess it's related to the way in which Stata draws the line like the difference between lowess and connected scatter but not pretty sure.
    2. I occasionally found this command cmogram developed by Christopher Robert, with whose code I can quickly get a same picture:
    cmogram demvoteshfor2 demmv, cut(0) scatter lineat(0) qfitci

    Click image for larger version

Name:	graph3.png
Views:	1
Size:	64.6 KB
ID:	1456178
    It seems that the second and the third method to draw the confidence intervals would be more welcome. But cmogram has a defect. It does not have a weight option like kernal or triangle which is widely applied in an RDD research. Anyone knows how to improve it?
    3. It seems thata rdplot cannot be used together with a tw type graph commands. Anyone knows how to reach this goal?
    Any statalister interested in this method is welcome. appreciate any comments on related work in advance.
    Last edited by Liu Qiang; 01 Aug 2018, 15:32.
    2B or not 2B, that's a question!

  • #2
    The qfitci figures are the standard CIs for a quadratic least squares fit. They assume a constant standard deviation on each side of the cutoff.

    In contrast, rdplot assumes neither a quadratic model nor constant standard deviations. The data are binned. A different standard deviation is estimated in each bin and the CI based on that SD is centered on the bin mean (Colonico et al., 2017, p.382, 391). I would personally prefer these CIs.

    Two-way options can be used: they go inside the graph_options option.


    Reference:
    Calonico, S., Cattaneo, M. D., Farrell, M. H., and Titiunik, R. (2017). rdrobust: Software for regression-discontinuity designs. Stata Journal, 17(2), 372-404.
    Last edited by Steve Samuels; 02 Aug 2018, 09:13.
    Steve Samuels
    Statistical Consulting
    [email protected]

    Stata 14.2

    Comment


    • #3
      Originally posted by Steve Samuels View Post
      The qfitci figures are the standard CIs for a quadratic least squares fit. They assume a constant standard deviation on each side of the cutoff.

      In contrast, rdplot assumes neither a quadratic model nor constant standard deviations. The data are binned. A different standard deviation is estimated in each bin and the CI based on that SD is centered on the bin mean (Colonico et al., 2017, p.382, 391). I would personally prefer these CIs.

      Two-way options can be used: they go inside the graph_options option.


      Reference:
      Calonico, S., Cattaneo, M. D., Farrell, M. H., and Titiunik, R. (2017). rdrobust: Software for regression-discontinuity designs. Stata Journal, 17(2), 372-404.
      Really grateful to your clear answer. I have learnt where the difference is.
      For the last question, I mean is it possible to absorb rdplot into tw so that we can draw graphs like tw rdplot y x || scatter y x. I do not suppose it's possible for now.
      2B or not 2B, that's a question!

      Comment


      • #4
        Maybe graph_options accepts addplot as an option. If so, rdplot will subsume twoway, rather than the other way around.
        Steve Samuels
        Statistical Consulting
        [email protected]

        Stata 14.2

        Comment


        • #5
          You could try using gr line instead of qfitci and use some variables generated using the rdplot option 'genvars'.

          Comment


          • #6
            For those visitors interested, the link to the data mentioned at #1 is broken.
            However, all packages and data are available at this Github page.
            Note that this page is mentioned at #2 in this Statalist post.
            Last edited by ericmelse; 03 Oct 2023, 21:07.
            http://publicationslist.org/eric.melse

            Comment

            Working...
            X