Statalist The Stata Listserver


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

Re: st: Tabout and frequency tables (second try)


From   "Austin Nichols" <austinnichols@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Tabout and frequency tables (second try)
Date   Tue, 11 Apr 2006 14:25:16 -0400

Hervé --
Do you want something that looks like:

Repair |
Record |
  1978 |  Freq.    Percent    Car type |  Freq.     Percent
-------+-------------------- ----------+---------------------
     1 |      2       2.90    Domestic |     52       70.27
     2 |      8      11.59     Foreign |     22       29.73
     3 |     30      43.48   ----------+---------------------
     4 |     18      26.09       Total |     74      100.00
     5 |     11      15.94
-------+--------------------
 Total |     69     100.00

or do you want the rows to have some common meaning across tables
(e.g. aligning Foreign with 1 and Domestic with 0, so the z-axis, if
you will, has a physical interpretation of some kind)?

If you don't care so much about alignment, you could just
. tab var1, matcell(m1) matrow(r1)
. tab var2, matcell(m2) matrow(r2)
and then use a -file- command with row and col -forv- loops to write
out the matrices.  Formats, etc, could also be added inside the loops.
--Austin

On 4/10/06, Herve STOLOWY <stolowy@hec.fr> wrote:
> Dear Statalisters:
>
> I sent this e-mail this afternoon but never received it myself. I fear that something wrong happened when I sent it. So, I try again. Sorry if you received it.
>
> I use the -tabout- command (downloadable from ssc) to get two frequency tables (with count and percentage):
>
> tabulate var1
> tabout var1, cells(fcount fper), using filename1, replace
>
> tabulate var2
> tabout var2, cells(fcount fper), using filename1, append
>
> With -tabout-, the second table appears below the first one.
>
> I have then two questions:
>
> - Is there a possibility with -tabout- to get  the two tables side by side?
> - If not, is there another command which could get the desired result (two tables side by side, exported to a tab-delimited file)?
>
> Best regards
>
> Hervé Stolowy
>

*
*   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