use "accupunture.dta", clear **Lecture 7: Visualizing data *Figure 1_Answers twoway /// scatter posths acuptreatments if migraine==0 /// , msize(tiny) mcolor(orange) || /// lfit posths acuptreatments if migraine==0 /// , lcolor(orange) || /// scatter posths acuptreatments if migraine==1 /// , msize(tiny) mcolor(green) || /// lfit posths acuptreatments if migraine==1 /// , lcolor(green) || /// , title (Figure 1:Acupuncture treatments and headache score) /// note (Lecture 7 practice) /// scheme(s1mono) /// ytitle(Post-study headache score) /// xtitle(Number of acupuncture treatments) /// legend(order(2 "No migraine" 4 "Migraine")) /// saving("figure1.gph", replace) *Figure 2_answers twoway /// kdensity posths if no_acu==0 /// , lcolor(gray) || /// kdensity posths if no_acu==1 /// , lcolor(black) || /// , yscale(off) /// graphregion(fcolor(white) lcolor(none)) /// legend(order(1 "1 or more acupuncture treatments" 2 "No acupuncture treatments")size(small)) /// ytitle("Density") /// xtitle("Post-study headache score") /// title(Figure 2: Distribution of headache score) /// saving("figure2.gph", replace)