Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: Graphical part of RD analysis
From
Jen Zhen <[email protected]>
To
[email protected]
Subject
st: Graphical part of RD analysis
Date
Wed, 3 Nov 2010 18:08:53 +0100
Hi,
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),
p.17.
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)
preserve
keep age_bins mean_outcome
bysort age_bins (mean_outcome): keep if _n==1
browse
restore
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
averages?
Many thanks,
JZ
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/