Statalist


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

Re: st: RE: Bar chart to display results from crosstabs


From   Austin Nichols <austinnichols@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: Bar chart to display results from crosstabs
Date   Thu, 12 Feb 2009 13:23:50 -0500

Geoffrey Wallace <gw46@cornell.edu>:
Try also:

ssc inst byhist, replace
clear
set obs 211
g d=(_n<56)
g fv=(_n<16) if d
sort d
replace fv=(_n<68) if d==0
la def fv 0 "No" 1 "Yes"
la val fv fv
la def d 0 "Not Democ" 1 "Democ"
la val d d
la var fv "First Violator"
ta fv d, col nofr
byhist fv, by(d) frac disc tw(xla(0/1,val))

On Thu, Feb 12, 2009 at 12:58 PM, Geoffrey Wallace <gw46@cornell.edu> wrote:
> Hi Nick,
>
> I was able to get the basic outlines of what I was looking for using
> -spineplot- and will only need to tinker with the options to get the desired
> appearance.
<...>
>> Geoffrey Wallace, Ph.D. candidate
>> I want to use a bar chart to display in a more visual manner the column
>> percentages from a crosstab for two dichotomous variables, such as democracy
>> and first violator.
>>
>> For the two-way table, I used the command
>> --tab democ firstviol, column--
>>
>> Which gives the following output.
>>
>>
>>      First |       Democracy
>>   violator |        No        Yes |     Total
>> -----------+----------------------+----------
>>         No |        89         40 |       129
>>            |     57.05      72.73 |     61.14
>> -----------+----------------------+----------
>>        Yes |        67         15 |        82
>>            |     42.95      27.27 |     38.86
>> -----------+----------------------+----------
>>      Total |       156         55 |       211
>>            |    100.00     100.00 |    100.00
...
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index