Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: bihistogram


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: bihistogram
Date   Tue, 26 Aug 2008 12:50:00 +0100

A bihistogram -- I didn't know before searching -- is a dual histogram
with one group's frequencies shown as negative. 

Rajesh found nothing, but -search histogram- points to this: 

SJ-5-2  gr0014  . . . . . . . Stata tip 20: Generating histogram bin
variables
        . . . . . . . . . . . . . . . . . . . . . . . . . . . . D. A.
Harrison
        Q2/05   SJ 5(2):280--281                                 (no
commands)
        tip illustrating the use of twoway__histogram_gen for
        creation of complex histograms and other graphs or tables

The text is accessible to all via 
<http://www.stata-journal.com/sjpdf.html?articlenum=gr0014>

That includes a worked example. 

Here is another: 

sysuse auto, clear 
twoway__histogram_gen mpg if foreign, width(2) start(10) freq ///
gen(freq_foreign mpg_foreign)
twoway__histogram_gen mpg if !foreign, width(2) start(10) freq /// 
gen(freq_domestic mpg_domestic)
replace freq_foreign = -freq_foreign
twoway bar freq_foreign mpg_foreign, barw(2) || ///
bar freq_domestic mpg_domestic, barw(2) ///
legend(order(1 "Foreign" 2 "Domestic")) 

Nick 
[email protected] 

Rajesh Tharyan

Is it possible to produce a bihistogram in stata? Nothing turns up on
findit
or search. I was trying to write a program to do that. But can one get
stata
to produce histogram with -ve frequencies? 


*
*   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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index