Hi. Always thanks to statalist.
I have binary variable ; outcome (1: positive, 0: negative) and categorical variable grBMI
First I draw frequency graph & proportion graph seperately.
drop if outcome==0
histogram grBMI, frequency discrete xsize(7) ysize(4) scale(1.4) ylabel(0 (100) 600,labsize(small)) xlabel(15 18.5 23 25 30 40 50, labsize(small)) color(navy) fintensity(inten40) lcolor(gr1) lwidth(vvthin) ytitle("Frequency of Outcome(n)") b1title("BMI")
use "C:\Users\heebyung\data.dta", clear
egen mean=mean(outcome),by(grBMI)
gen mean100=100*mean
twoway bar mean100 grBMI if grBMI <55, color(navy)fintensity(inten40) lcolor(gr1) lwidth(vvthin) xsize(7) ysize(4) scale(1.4) xlabel(15 18.5 23 25 30 40 50) xtitle("BMI") ytitle("Prevalence of outcome(%)")
I want to make overlaying graph which include frequency(bar) and proportion(connected line) of outcome over grBMI
Like below.
I wish please someine help me...
Thank you.
Comment