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

st: RE: Question on the "new estout"


From   "Jann, Ben" <[email protected]>
To   <[email protected]>
Subject   st: RE: Question on the "new estout"
Date   Thu, 2 Dec 2004 09:55:02 +0100

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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index