Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

st: add column in -tabout- for symbols


From   "Kaulisch, Marc" <kaulisch@forschungsinfo.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: add column in -tabout- for symbols
Date   Mon, 13 Jun 2011 07:22:43 +0200

Using -tabout- (from ssc) I encounter a difficulty I can not solve on my
own. Using the layout(row) option I would like to add a column for the
symbols (% and N).
The following example should illustrate my point:
sysuse auto
gen lengthc = length>200
tabout foreign lengthc using test_tabout.doc, style(tab) cells(row freq)
format(1 0) ///
								clab(%
N) layout(row) 			///
								dpcomma
replace
I get the following table

lengthc		  
Car type	0	1	Total
		  
Domestic %	55,8	44,2	100,0
N       29	23	52
Foreign %	100,0	0,0	100,0
N       22	0	22
Total % 68,9	31,1	100,0
N       51	23	74

But I would like to get the following:
lengthc		  
Car type		0	1	Total
		  
Domestic	 %	55,8	44,2	100,0
	N       29	23	52
Foreign	 %	100,0	0,0	100,0
	N       22	0	22
Total	 % 68,9	31,1	100,0
	N       51	23	74

Is there a way to add this column automatically in the program?

Thanks for your help.


Marc

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