Statalist


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

st: two-way table: how to supress total?


From   Yun Liu <[email protected]>
To   [email protected]
Subject   st: two-way table: how to supress total?
Date   Thu, 12 Nov 2009 21:32:09 -0800

Hi Stata users,

When generating two-way tables, I couldn't find a way to supress the
total reported at the end of each row.
I usualy use the "tabout" command to generate tables.  In the example
below, I do not want the last column reporting 17, 31 and 48. As you
can see, I tried the "ptotal" option but it did not work. Would you
please help me? The version of Stata I have is STATA MP 11 for windows
(32bits). Thank you very much!

. sysuse cancer, clear

. tabout died drug using table1.txt, replace

Table output written to: table1.txt

       Drug type (1=placebo)
1 if patient died       1       2       3       Total
       No.     No.     No.     No.
0       1.0     8.0     8.0     17.0
1       19.0    6.0     6.0     31.0
Total   20.0    14.0    14.0    48.0


. tabout died drug using table1.txt, replace ptotal(single)

Table output written to: table1.txt

       Drug type (1=placebo)
       1       2       3       Total
       No.     No.     No.     No.
1 if patient died
0       1.0     8.0     8.0     17.0
1       19.0    6.0     6.0     31.0

Total   20.0    14.0    14.0    48.0

. tabout died drug using table1.txt, replace ptotal(none)

Table output written to: table1.txt

       Drug type (1=placebo)
1 if patient died       1       2       3       Total
       No.     No.     No.     No.
0       1.0     8.0     8.0     17.0
1       19.0    6.0     6.0     31.0

Best Regards,
Yun

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