Statalist


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

RE: st: Quick display of categorical data


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   RE: st: Quick display of categorical data
Date   Fri, 27 Jun 2008 16:09:37 +0200

This is a sentence for the server to eat.

Let`s try that again:
Admitted: -ta, plot- is a not so well known but convenient solution to the
problem... As a matter of fact, it pays to browse the help files of
well-known commands such as -ta- occasionally. Browsing -h tabulate oneway-
recently, I noticed you can have the command sort according to the
frequencies displayed (but I failed to notice the -plot- option). Thanks for
pointing it out, Nick.


Martin Weiss
_________________________________________________________________

Diplom-Kaufmann Martin Weiss
Mohlstrasse 36
Room 415
72074 Tuebingen
Germany

Fon: 0049-7071-2978184

Home: http://www.wiwi.uni-tuebingen.de/cms/index.php?id=1130

Publications: http://www.wiwi.uni-tuebingen.de/cms/index.php?id=1131

SSRN: http://papers.ssrn.com/sol3/cf_dev/AbsByAuth.cfm?per_id=669945


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Nick Cox
Sent: Friday, June 27, 2008 3:02 PM
To: [email protected]
Subject: RE: st: Quick display of categorical data

Martin's answer focuses on tabular displays. Here are seven ways to get
a graph. There will be others.  

Official Stata: 

tabulate rep78, plot
histogram rep78, discrete
dotplot rep78
quantile rep78 

The last is best for ordinal variables. 

User-written commands: 

stripplot rep78, stack 
catplot hbar rep78 
qplot rep78 

-stripplot- and -catplot- are on SSC. -qplot- is on the SJ website.
-qplot- is best for ordinal variables. 

See also a discussion: 

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 data

That is the public domain via
<http://www.stata-journal.com/sjpdf.html?articlenum=gr0004>

Nick 
[email protected] 

Martin Weiss

Try this:

sysuse auto, clear
foreach var of varlist rep78 for{
ta `var'
inspect `var'
}

Admittedly quick and dirty...

Zitat von "Michael I. Lichter" <[email protected]>:

> I'm beginning to analyze
> some survey data, and much of the data consists of responses to
> questions on a 1-5 scale, a few responses on a 1-3 scale, and a few
> responses to limited nominal scales. I have too many cases (1,000+) to
> learn anything from a stemplot (although I suppose I could sample 1/10
> of the cases for this purpose), which isn't meant for categorical data
> anyway, and it's way, way too cumbersome to individually create and
> print bar charts using Stata graphics (unless there's something I
don't
> know about how to do this, which is likely). Ideally, what I'd like is
> a display something like this:
>
> Some inter |
> esting var |
>      iable |      Freq.     Percent        Cum.
> ------------+-----------------------------------         Never, ever |
>       315       30.79       30.79        30 X           X
> Maybe once |        204       19.94       50.73           X
X
> Occasionlly |        149       14.57       65.30        20 X  X
X
> Pretty oftn |         55        5.38       70.67           X  X  X
X
>    Always! |        300       29.33      100.00        10 X  X  X
X
> ------------+-----------------------------------           X  X  X  X
X
>      Total |      1,023      100.00                       1  2  3  4
5
>
> I would happily settle for just the ASCII bar chart, and a horizontal
> bar would be fine. The point is to be able to get a sense of the data
> at a glance, without wasting a bunch of paper. 

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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