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

Re: st: -Table- output presented horizontally and exported


From   "Svend Juul" <[email protected]>
To   <[email protected]>
Subject   Re: st: -Table- output presented horizontally and exported
Date   Thu, 3 Nov 2005 15:07:49 +0100

Herv=E9 Stolowy wrote:

I have a basic stat on a dummy variable with -table-:

table auditor_d

-------------------------
       Auditor |      Freq.
-------------+-----------
Non-Big four |         43
      Big four |        156

I don't find a way to have the results presented horizontally (in a row) an=
d not vertically.
If this is possible, I would like then to export the results in a tab-delim=
ited file.
=2E..
(The origin of my question is that I have in reality several dummy variable=
s and I would like to have those variables in lines and the output in two c=
olumns).

------------------------------------------------------

Nick Cox wrote (among other things) -tabm-; I think it does what you want. =
I start creating an artifical dataset with five dummy variables:

    clear
    set obs 100
    foreach V of newlist v1-v5 {
       gen `V' =3D uniform()>0.5
    }

    tabm v1-v5

             |        Values
    Variable |         0          1 |     Total
-----------+----------------------+----------
          v1 |        54         46 |       100
          v2 |        44         56 |       100
          v3 |        53         47 |       100
          v4 |        58         42 |       100
          v5 |        37         63 |       100
-----------+----------------------+----------
       Total |       246        254 |       500

-tabm- is part of the tab_chi package at SSC:
    ssc install tab_chi

Best,
Svend

__________________________________________

Svend Juul
Institut for Folkesundhed, Afdeling for Epidemiologi
(Institute of Public Health, Department of Epidemiology)
Vennelyst Boulevard 6
DK-8000  Aarhus C, Denmark
Phone: +45 8942 6090
Home:  +45 8693 7796
Email: [email protected]
__________________________________________

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