Dear Statalist Community,
I am trying to create a rug plot for my rdplot graph, however, I'm struggling. I can place the two graphs one on top of the other, but I cannot overlay them. I havent found a command that allows me to overlay with rdplot.
If useful, when I run rdplot I get:
Any chance you could kindly help me create a rug plot for my rdplot graph? I was also wondering if the histogram should exclusively include the part of the sample used in the model, and not the overall "running" sample, but maybe I'm wrong.
Thank you so much!
Best,
Cat
I am trying to create a rug plot for my rdplot graph, however, I'm struggling. I can place the two graphs one on top of the other, but I cannot overlay them. I havent found a command that allows me to overlay with rdplot.
Code:
*RD Graph: rdplot dv running if nat==1 & tec==1, c(1990) all /// kernel(tri) covs(c1 c2 c3) weights(w) /// p(1) graph_options(aspectratio(1) legend(off)) *save manually: rdplot_graph *histogram histogram running if nat == 1 & tec == 1, width(1) frequency /// aspectratio(1) saving(histo) gr combine rdplot_graph.gph histo.gph, col(1) iscale(1)
Code:
RD Plot with evenly spaced mimicking variance number of bins using polynomial regression. Cutoff c = 1990 | Left of c Right of c Number of obs = 1960 ----------------------+---------------------- Kernel = Triangular Number of obs | 70 1890 Eff. Number of obs | 70 1890 Order poly. fit (p) | 1 1 BW poly. fit (h) | 20.000 57.000 Number of bins scale | 1.000 1.000 Outcome: dv. Running variable: running. --------------------------------------------- | Left of c Right of c ----------------------+---------------------- Bins selected | 42 35 Average bin length | 0.476 1.629 Median bin length | 0.476 1.629 ----------------------+---------------------- IMSE-optimal bins | 3 4 Mimicking Var. bins | 42 35 ----------------------+---------------------- Rel. to IMSE-optimal: | Implied scale | 14.000 8.750 WIMSE var. weight | 0.000 0.001 WIMSE bias weight | 1.000 0.999 --------------------------------------------- Covariate-adjusted estimates. Additional covariates included: 10 . *save manually: rdplot_graph . end of do-file
Thank you so much!
Best,
Cat
Comment