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

Re: st: RE: Question on the "new estout"


From   "Herve STOLOWY" <[email protected]>
To   <[email protected]>
Subject   Re: st: RE: Question on the "new estout"
Date   Thu, 02 Dec 2004 20:48:26 +0100

Dear Ben:

I thank you again for your help. I will update my estout and try what
you suggest.

Best regards

Herve

***********************************************************
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] 12/02/04 9:55 AM >>>
Herve wrote:
> Some time ago, I asked several questions concerning estout, especially
> one on the inclusion of the Nagelkerke R2 in a logit regression. Ben
> Jann helped me a lot and I found the solution with the 
> following syntax:
> 
> estout Balance_sheet Income_statement using estout_logit, 
> replace  cells
> ("b(fmt(%9.3f)) t(fmt(%9.3f) label(z)) p(fmt(%9.3f))") stats (chi2 p N
> r2_p, calc(p nagelkerke) fmt(%9.3f %9.3f %9.0f %9.3f %9.3f) 
> labels("Chi
> square" "p(chi2)" "Number of observations" "Pseudo R-square" 
> "Nagelkerke
> R-square")) label varlabels(_cons Constant)
...
> My question is simple. Is it possible to get the same output as I had
> with the above-mentioned syntax (adopting the new estout syntax)?

Yes, definitely. The main difference is, however, that the calculation 
of extra statistics has to be done in advance with the new version. 
Suppose that you are using the following subroutine with the old 
version of -estout-:

 program define _estout_stat_nagelkerke
   ... [commands calculating nagelkerke] ...
   c_local value `nagelkerke' 
 end

For use with the new version, change the program to

 program define _estadd_nagelkerke, eclass
   ... [commands calculating nagelkerke] ...
   ereturn scalar nagelkerke = `nagelkerke'
 end

(note that the name of the program starts with "estadd", not 
"estout"; see -help estadd-) and then type

 estadd Balance_sheet Income_statement, stats(nagelkerke)
 estout Balance_sheet Income_statement using estout_logit, 
   replace  cells("b(fmt(%9.3f)) t(label(z)) p") 
   stats(chi2 p N r2_p nagelkerke r2_p, 
     fmt(%9.3f %9.3f %9.0f %9.3f %9.3f) 
     labels("Chi square" "p(chi2)" "Number of observations" 
            "Pseudo R-square" "Nagelkerke R-square")) 
   label varlabels(_cons Constant)

The new procedure might seem to be more involved than the 
old one. However, it is much more consistent and actually 
much easier to handle and more efficient than the old 
method in most cases.

Cheers, 
ben


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