Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Graphical part of RD analysis

From   Jen Zhen <>
Subject   st: Graphical part of RD analysis
Date   Wed, 3 Nov 2010 18:08:53 +0100


for a RD analysis, I would like to assign my observations into bins of
the running variable (age), and then plot the mean outcome value for
each bin, along with 2 separate fitted lines, one on the left and one
on the right side of the threshold, as recommended for instance in
Austin Nichols' "Causal Inference with Observational Data" (2007),

I am currently doing this with the following code to get these means
into the browsing window, then I paste them into Excel, where I plot
them and add the fitted lines:

egen age_bins = cut(age), at(45(0.5)56)
bysort age_bins: egen mean_outcome = mean (outcome)
keep age_bins mean_outcome
bysort age_bins (mean_outcome): keep if _n==1

I'm wondering though whether there is some more straightforward
procedure for this in Stata?
Austin's - rd ..., gr - will plot the two fitted lines together with
dots for all observations, but how can I plot only the age bin

Many thanks,
*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index