Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: How to export a table with oneway frequencies of several variables into word / excel ?


From   "Ewa Juditha Wojcik" <[email protected]>
To   <[email protected]>
Subject   st: How to export a table with oneway frequencies of several variables into word / excel ?
Date   Wed, 27 Jul 2011 09:58:48 +0200

Hi !
 
Is there a command in Stata to export tables into Microsoft Word or
Excel, such that one table comprises several ONEWAY tables of frequency,
simply attached to each other ?
 
I have a large dataset comprising multiple waves. I would like to
obtain oneway frequency tables and percentages of the categories of each
variable and compare this for each variable over all waves. However, I
do not want twoway tables/cross-tabulations, just simple oneway
frequency tables next to each other. And this I want exported into Word
or Excel and converted into a nice-looking table. 
 
That is, if I had waves A, B and C and variables 1 and 2 which each
comprise 4 possible answer categories, I want (if possible, with labels
instead of values): 
 

Variable 1:
                     
categories      A                   B                 C
of Var. 1
               freq  perc       freq  perc      freq  perc
 
 1             50   29.41      30   13.63     90     37.50
 2             70   41.17      20     9.09     40     16.66
 3             10    5.88       80   36.36     30     12.50
 4             30   17.64      40   18.18     60     25.00
 miss        10     5.88      50   22.72     20       8.33
 Total      170 100.00    220 100.00    240   100.00 
 
 
Variable 2:
                
categories      A                   B                 C
of Var. 2
                freq  perc       freq  perc      freq  perc

 1              10     5.88      20     9.09     40   16.66
 2              30   17.64      30   13.63      90   37.50
 3              50   29.41      40   18.18      60   25.00
 4              70   41.17      80   36.36      30   12.50
 miss         10     5.88      50   22.72      20     8.33
 Total       170 100.00    220  100.00    240  100.00
 
 

I have tried -estpost tab- with -esttab- as well as -logout- with -fre-
(-logout, save(tables) excel word replace: fre variable1_A -
variable1_C, all - ...) but with these commands I obtained frequency
tables for each variable and wave separately and would have to combine
the tables manually. 
 
I get:  
 
Variable 1, Wave A:
           
categories    A 
of Var. 1   freq   perc  
 
 1             50    29.41 
 2             70    41.17 
 3             10     5.88 
 4             30    17.64 
 miss        10      5.88 
 Total      170  100.00  
 
 

Variable 1, Wave B:
                
categories    B 
of Var. 1   freq   perc
 1              30    13.63 
 2              20      9.09 
 3              80     36.36 
 4              40     18.18 
 miss         50     22.72 
 Total       220   100.00 
 

and so on ...
 
 

Is there a command suited for my problem ?
 

Thanks for your help !
Juditha 

Zentrum für Europäische Wirtschaftsforschung GmbH (ZEW), L7,1 68161
Mannheim 
Sitz der Gesellschaft: Mannheim Amtsgericht Mannheim HRB 6554
Aufsichtsratsvorsitzender: Gerhard Stratthaus MdL, Finanzminister a.D.
Geschaeftsfuehrer: Prof. Dr. Dr. h.c. mult. Wolfgang Franz, Thomas Kohl
Centre for European Economic Research L7,1 68161 Mannheim Germany
Seat of the Company: Mannheim Local Court Mannheim HRB 6554
Chairman of the Supervisory Board: Gerhard Stratthaus MdL, Minister,
ret.
Executive Directors: Prof. Dr. Dr. h.c. mult. Wolfgang Franz, Thomas
Kohl
--------------------------------------------------------------------------------
*
*   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index