use "accupunture.dta", clear **Lecture 7: Visualizing data **************************************************************************** *Figure 1 twoway /// scatter posths acuptreatments if migraine==0 /// , msize(small) mcolor(orange) || /// lfit posths acuptreatments if migraine==0 /// , lcolor(purple) || /// scatter posths acuptreatments if migraine==1 /// , msize(small) mcolor(blue) || /// lfit posths acuptreatments if migraine==1 /// , lcolor(green) || /// , title (Figure 1) /// note (note) /// ytitle(PSH) /// xtitle(# acu) /// scheme(s2color) /// legend(order(2 "No migraine" 4 "Migraine")) /// saving("figure1.gph", replace) **************************************************************************** *Figure 2 twoway /// kdensity posths if no_acu==0 /// , lcolor(black) || /// kdensity posths if no_acu==1 /// , lcolor(black) || /// , yscale(on) /// graphregion(fcolor(stone) lcolor(none)) /// legend(order(1 "1 or more acupuncture treatments" 2 "No acupuncture treatments")size(medium)) /// ytitle("Density") /// xtitle("Post-study headache score") /// title(Figure 2: Distribution of headache score) /// saving("figure2.gph", replace)