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   "Herve STOLOWY" <stolowy@hec.fr>
To   <statalist@hsphsun2.harvard.edu>
Subject   Re: st: -Table- output presented horizontally and exported
Date   Thu, 03 Nov 2005 17:46:11 +0100

Dear Jean:

It's really fine. Thanks again for your help.

Best regards

Hervé

***********************************************************
Professeur/Professor
Coordinateur du Département/Head of Department
HEC Paris
Département Comptabilité Contrôle de gestion / Dept of Accounting and Management Control
1, rue de la Liberation
78351 - Jouy-en-Josas
France
Tel: +33 1 39 67 94 42 - Fax: +33 1 39 67 70 86
stolowy@hec.fr
http://campus.hec.fr/profs/stolowy/perso/home.htm
>>> jean.ries@gmail.com 11/03/05 4:51 PM >>>
To obtain the total number of non-missing observations, you have to add 
two lines at the end of the loop. So here is the amended code:

file open dum using DummyTable.txt, write text replace
file write dum _tab "yes" _tab "no" _tab "N" _n
foreach v of varlist dummy* {
    file write dum "`v'" _tab
    qui count if `v' == 0
    file write dum (r(N)) _tab
    qui count if `v' == 1
    file write dum (r(N)) _tab
    qui count if !missing(`v')          // count the number of 
non-missings ...
    file write dum (r(N)) _n          // ... which is returned in r(N)
}
file close dum



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


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