Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: How to plot the cells of tabi like -catplot-?


From   eva.poen@unisg.ch
To   statalist@hsphsun2.harvard.edu
Subject   st: How to plot the cells of tabi like -catplot-?
Date   Wed, 26 Nov 2003 12:01:47 +0100

Dear statalisters


I am making quite heavy use of -catplot-, available on SSC, recently. This 
nice program by Nick Cox (Thank you, Nick, once again!) plots a 
categorical variable, in frequencies or percents, on its own or against 
another categorical variable.

However, this of course only works when you have variables. I would like 
to do the same with the values I entered as arguments to tabi. 

Example:

. tabi 15 8\ 3 47, col chi2

+-------------------+
| Key               |
|-------------------|
|     frequency     |
| column percentage |
+-------------------+

           |          col
       row |         1          2 |     Total
-----------+----------------------+----------
         1 |        15          8 |        23 
           |     83.33      14.55 |     31.51 
-----------+----------------------+----------
         2 |         3         47 |        50 
           |     16.67      85.45 |     68.49 
-----------+----------------------+----------
     Total |        18         55 |        73 
           |    100.00     100.00 |    100.00 

          Pearson chi2(1) =  29.7361   Pr = 0.000


Now I would like to have the plot output just the same as -catplot-, 
something like this:


|
|                                  85.5
|  83.3                              +
|    +                               +
|    +                               +
|    +                               +
|    +                               +
|    +                               +
|    +                               +
|    +       16.7                    +
|    +        +            14.6      +
|    +        +             +        +
|    +        +             +        +
|    +        +             +        +
|--------------------------------------------
  row=1    row=2          row=1    row=2


      col=1                   col=2



The same with frequencies. 
Any ideas on how to do this? I really want to avoid using excel for this.


Thanks and best regards, 
Eva Poen


____________________________________
Eva Poen
University of St. Gallen
FEW-HSG
VarnbŁelstr. 14
CH-9000 St. Gallen
Switzerland
Tel: +41-71-224 23 13
Fax: +41-71-224 23 02
EMail: eva.poen@unisg.ch

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index