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

From |
Geoffrey Wallace <gw46@cornell.edu> |

To |
statalist@hsphsun2.harvard.edu |

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

Date |
Thu, 12 Feb 2009 12:58:29 -0500 |

Hi Nick,

Thanks again, this was really helpful. Cheers, Geoff Nick Cox wrote:

-graph bar- is not much use directly. You would need to do some pre-processing first. (The essential reason is that -graph bar- is awrapper for -collapse-, not -contract-.)See -catplot- and -tabplot- on SSC which give more direct solutions.Also, -spineplot- on the Stata Journal site. Use -findit- to getlocations. And two papers in the Stata Journal itself:SJ-8-1 gr0031 . . . . . . . . . . . Speaking Stata: Spineplots and their kin (help spineplot if installed) . . . . . . . . . . . . . . . N. J. Cox Q1/08 SJ 8(1):105--121 discusses spineplots (mosaic plots), a type of bar chart for showing frequencies, proportions, or percentages of cross- classified categorical variables SJ-4-2 gr0004 . Speaking Stata: Graphing categorical and compositional data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . N. J. Cox Q2/04 SJ 4(2):190--215 (no commands) discusses graphical possibilities for categorical and compositional dataThe last is accessible to all under the SJ's 3-year rule.Nickn.j.cox@durham.ac.ukGeoffrey Wallace, Ph.D. candidateI want to use a bar chart to display in a more visual manner the columnpercentages from a crosstab for two dichotomous variables, such asdemocracy 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.00The final product I would hope for in the corresponding bar would havetwo separate pairs of columns. The first fair would have the relativepercentages for democracies (democ=1) and nondemocracies (democ=0) thatare not first violators (firstviol=0) (i.e. 72.73 and 57.05), and thesecond would be the corresponding pair for first violators (firstviol=1)(i.e. 27.27 and 42.95).I'm assuming I would use some version of the -graph bar- command, butI'm having trouble figuring how to specify the column percentages.* * 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/

-- Geoffrey Wallace PhD Candidate Department of Government 214 White Hall Cornell University Ithaca, NY 14853 t.202.302.4209 f.607.255.4530 http://www.people.cornell.edu/pages/gw46/ * * 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: RE: Bar chart to display results from crosstabs***From:*Austin Nichols <austinnichols@gmail.com>

**References**:**st: Bar chart to display results from crosstabs***From:*Geoffrey Wallace <gw46@cornell.edu>

**st: RE: Bar chart to display results from crosstabs***From:*"Nick Cox" <n.j.cox@durham.ac.uk>

- Prev by Date:
**Re: st: RE: Re: two steps of writing commands** - Next by Date:
**Re: st: RE: Bar chart to display results from crosstabs** - Previous by thread:
**st: RE: Bar chart to display results from crosstabs** - Next by thread:
**Re: st: RE: Bar chart to display results from crosstabs** - Index(es):

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