Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down on April 23, and its replacement, **statalist.org** is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
Stefano Lombardi <lombardi_stefano@fastwebnet.it> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
st: Stacked bar graph with twoway__histogram_gen |

Date |
Wed, 07 Mar 2012 19:28:08 +0100 |

Dear Statalisters,

use "epd0", clear twoway__histogram_gen os if status_os==0, gen(freq_1 x, replace) /// freq start(0) width(5) drop if missing(x) keep freq_1 x save f1, replace use "epd0", clear twoway__histogram_gen os if status_os==1, gen(freq_2 x, replace) /// freq start(0) width(5) drop if missing(x) keep freq_2 x os merge 1:1 x using f1 mvencode freq_1 freq_2, mv(. = 0) egen freq = rowtotal(freq_1 freq_2) twoway /// (bar freq_1 x, barw(5) bcolor(red)) /// rbar freq_2 freq x, barw(5) bcolor(blue) /// legend(order(1 "Uncensored" 2 "Censored")) /// xtitle("`: var label os'") ytitle(Frequency)

Thank you very much for any help, Stefano Lombardi * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**Follow-Ups**:**Re: st: Stacked bar graph with twoway__histogram_gen***From:*Nick Cox <njcoxstata@gmail.com>

**Re: st: Stacked bar graph with twoway__histogram_gen***From:*Austin Nichols <austinnichols@gmail.com>

- Prev by Date:
**st: CI interval in ANOVA summary table** - Next by Date:
**Re: st: Issue with hazard function generated by sts graph** - Previous by thread:
**st: CI interval in ANOVA summary table** - Next by thread:
**Re: st: Stacked bar graph with twoway__histogram_gen** - Index(es):