Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: -Table- output presented horizontally and exported


From   jean ries <[email protected]>
To   [email protected]
Subject   Re: st: -Table- output presented horizontally and exported
Date   Thu, 03 Nov 2005 15:43:12 +0100

Herv�,

If I understand you correctly, you want to obtain a tab-delimited file that should look like the following:

yes no
dummy1 12 43
dummy2 29 19
...

If yes, here is one solution that works for me. It is based on the -file- command, and will write the results into a file called "DummyTable.txt"

file open dum using DummyTable.txt, write text replace
file write dum _tab "yes" _tab "no" _n
foreach v of varlist dummy* {
file write dum "`v'" _tab
count if `v' == 0
file write dum (r(N)) _tab
count if `v' == 1
file write dum (r(N)) _n
}
file close dum
type DummyTable.txt


I hope this helps,

jean

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* 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