按照连老师的代码做出来了匹配前后对比图,但是纵坐标单位不同,最终显示的效果不理想,我想调整匹配前的图,纵坐标统一到15的范围内,请问大家知道如何操作吗?
连老师的代码如下:
*-(a)before matching: 匹配前的密度函数图
twoway (kdensity _pscore if _treat==1,lp(solid) lw(*2.5)) ///
(kdensity _pscore if _treat==0,lp(dash) lw(*2.5)), ///
ytitle("Density") ///
ylabel(,angle(0)) ///
xtitle("Propensity Score") ///
xscale(titlegap(2)) ///
xlabel(0(0.2)0.8, format(%2.1f)) ///
legend(label(1 "购买") label(2 "未购买") row(2) ///
position(3) ring(0)) ///
scheme(s1mono)
graph export "Figs\kn01.wmf", replace fontface("Times New Roman")
*-(b)after matching: 匹配后的密度函数图
twoway (kdensity _pscore if _treat==1,lp(solid) lw(*2.5)) ///
(kdensity _pscore if _treat==0&_wei!=.,lp(dash) lw(*2.5)), ///
ytitle("Density") ylabel(,angle(0)) ///
xtitle("Propensity Score") xscale(titlegap(2)) ///
xlabel(0(0.2)0.8, format(%2.1f)) ///
legend(label(1 "购买") label(2 "未购买") row(2) ///
position(3) ring(0)) ///
scheme(s1mono)
graph export "Figs\kn02.wmf", replace fontface("Times New Roman")