Dear friends,

Hi. As in the previous post,

Hi All,

In case anyone viewing this thread is interested, here's the code to do what Navid with a few additions to display both graphs side-by-side with the y- axes having common scales.

sysuse auto, clear
psmatch2 foreign mpg, out(price)

// compare _pscores before matching & save graph to disk
twoway (kdensity _pscore if _treated==1) (kdensity _pscore if _treated==0, ///
lpattern(dash)), legend( label( 1 "treated") label( 2 "control" ) ) ///
xtitle("propensity scores BEFORE matching") saving(before, replace)

// compare _pscores *after* matching & save graph to disk
gen match=_n1
replace match=_id if match==.
duplicates tag match, gen(dup)
twoway (kdensity _pscore if _treated==1) (kdensity _pscore if _treated==0 ///
& dup>0, lpattern(dash)), legend( label( 1 "treated") label( 2 "control" )) ///
xtitle("propensity scores AFTER matching") saving(after, replace)

// combine these two graphs that were saved to disk
// put both graphs on y axes with common scales
graph combine before.gph after.gph, ycommon


Richard
I wondered if the dummy variable for treatment/control groups after PSM was now changed as below,

Code:
 
 replace _treat =1 if  _treat ==1 & _weight != .  
 replace _treat =0 if  _treat ==0 & dup >0
I wanted to do regressions after PSM. Did I need to update the dummy variable for treatment/control groups?

Thank you in advance.