Statalist


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

st: AW: logout for twoway tabulate


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: AW: logout for twoway tabulate
Date   Fri, 2 Oct 2009 17:32:55 +0200

<> 

Try Ben Jann`s -esttab- and -estpost-:



*************
capt ssc inst estout
di in red _rc

webuse dose, clear

estpost tab dose function

//for tex
esttab . using C:\mytable.tex,  /* 
*/ cell(b(fmt(2))  /* 
*/ colpct(fmt(2))) /* 
*/  unstack noobs  /* 
*/ replace

//for excel
esttab . using C:\mytable.csv,  /* 
*/ cell(b(fmt(2))  /* 
*/ colpct(fmt(2))) /* 
*/  unstack noobs  /* 
*/ replace
*************



HTH
Martin


-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Falco Möller
Gesendet: Freitag, 2. Oktober 2009 17:24
An: [email protected]
Betreff: st: logout for twoway tabulate

Dear statalist,

after a long search through all the different possibillities to get
stata sum and tab outputs into latex and excel I finally found the
logout command.

It works great for tabulate twoway without percentages. But including
column percentages leads to a percentage line that is shifted to the
left. In other words, the command misinterprets the blank field below
the variable label.


webuse dose, clear

logout, clear: tab dose function, col

             |             Function
      Dosage |    < 1 hr     1 to 4         4+ |     Total
-----------+---------------------------------+----------
       1/day |        20         10          2 |        32
             |     43.48      26.32      16.67 |     33.33
-----------+---------------------------------+----------
       2/day |        16         12          4 |        32
             |     34.78      31.58      33.33 |     33.33
-----------+---------------------------------+----------
       3/day |        10         16          6 |        32
             |     21.74      42.11      50.00 |     33.33
-----------+---------------------------------+----------
       Total |        46         38         12 |        96
             |    100.00     100.00     100.00 |    100.00


logout, save(C:\mytable) tex excel replace

I also experimented with the tabout command, but did not find a
possibillity to save an output in excel or tex as shown above.

Thanks in advance
Falco

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


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