Bookmark and Share

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, is already up and running.

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

Re: st: option problems with byhist (interlaced histogram)

From   Maarten Buis <>
Subject   Re: st: option problems with byhist (interlaced histogram)
Date   Wed, 30 Nov 2011 12:24:14 +0100

On Tue, Nov 29, 2011 at 7:38 PM, Patricia Biedermann wrote:
> I want to produce an interlaced histogram with two variables:
> 1. Variable: 1= Case; 2=Control (binary)
> 2. Varialbe: 1=Agriculture, 2=Employment; 3=Business, and so on... (categorical)
> I tried this command:
> byhist occup, by(casecontrol) percent tw1(color(blue) lwidth(3)) tw2(color(red) lwidth(3))
> (the important thing is that it has to be ONE GRAPH!)

A histogram is the wrong graph for such variables as your second
variable is not even an ordinal variable. For two categorical
variables I would look at Nick Cox's -spineplot-, which you can get by
typing in Stata -ssc install spineplot-.

Hope this helps,

Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index