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
[email protected]
http://campus.hec.fr/profs/stolowy/perso/home.htm
>>> [email protected] 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/