Dear Statalist
I would like to make a figure that looks like this:
But obviously the red line I drew in MS Paint, because I couldn't get Stata to do it. Is there a way to get such a figure in Stata?
This is the code (including data) I got so far:
Thanks a lot!
Go
I would like to make a figure that looks like this:
But obviously the red line I drew in MS Paint, because I couldn't get Stata to do it. Is there a way to get such a figure in Stata?
This is the code (including data) I got so far:
Code:
version 14 clear set obs 1000 generate x1 = _n recode x1 ( 1/200 = 1 "Year 1") /// ( 201/400 = 2 "Year 2") /// ( 401/600 = 3 "Year 3") /// ( 601/800 = 4 "Year 4") /// (801/1000 = 5 "Year 5"), gen(x) drop x1 generate y = rnormal(x, 1) bys x: egen avgy = mean(y) gen dot = 0 twoway (histogram y, horizontal percent by(x) /// by(, note("") row(1) imargin(zero)) lcolor(black) /// lwidth(thin) plotregion(margin(zero)) width(1) subtitle(, size(*1))) /// (connect avgy dot, by(x, legend(off)) msymbol(O) mcolor(black) msize(large)), xlabel(none)
Thanks a lot!
Go
Comment