Statalist


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

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


From   Eric Booth <ebooth@ppri.tamu.edu>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: two-way table: how to supress total?
Date   Fri, 13 Nov 2009 09:40:45 -0600

I wish that the ptotal() option of -tabout- included a way to suppress panel column totals as well. Using -esttab- (as Martin suggested) is cleaner option, but you can still get the output you are asking for with -tabout-.

To do so, you need to split out your 'by' variable (drug) and switch the table to 'summary' format.
Here's an example:

*****

sysuse cancer, clear
tabout died drug using "table1.txt", replace ptotal(none)

tab drug, gen(f)
recode f* (0=.)

tabout died using "table1.txt", append sum c(N f1 N f2 N f3) ptotal (none)

*****

Eric

__
Eric A. Booth
Public Policy Research Institute
Texas A&M University
ebooth@ppri.tamu.edu
Office: +979.845.6754



On Nov 13, 2009, at 2:03 AM, Maarten buis wrote:

--- On Fri, 13/11/09, Yun Liu wrote:
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.

http://www.stata.com/statalist/archive/2009-11/msg00396.html

Hope this helps,
Maarten

--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany

http://www.maartenbuis.nl
--------------------------




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