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

st: RE: estout and Nagelkerke R2

From   "Jann, Ben" <>
To   <>
Subject   st: RE: estout and Nagelkerke R2
Date   Fri, 10 Sep 2004 22:47:53 +0200

Herve wrote:
> After a logit, I created a do-file which computes the Nagelkerke R2.
> I would like to add this figure to the table of results with 
> estout. Is it possible? 

It is possible, needs some minimal programming, though (see the 
"Programming subroutines" section in the helpfile; further 
explanations are given in the file "_estout_stat_p.ado", 
which is part of the -estout- package). 

(Please make sure that you are running the latest version 
of -estout-!)

Suppose your program is called -Nagelkerke- and returns 
Nagelkerke R2 in -r(nagelkerke)-. Then save the program

    program _estout_stat_nagelkerke
        c_local value "`r(nagelkerke)'"

as "_estout_stat_nagelkerke.ado" in the current directory 
or somewhere else in the ado-path (or just include the 
program in your do-file). Then type

 . estout ..., stats(chi2 N r2_p, calc(nagelkerke))

To change the order of the statistics, type, e.g.

 . estout ..., stats(chi2 N nagelkerke r2_p, calc(nagelkerke))

Another possibility is, of course, to write a program which 
adds e(nagelkerke) to the e-returns of the estimates.


*   For searches and help try:

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