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

st: RE: Log-Likelihood of Each Observation

From   "Maarten Buis" <[email protected]>
To   <[email protected]>
Subject   st: RE: Log-Likelihood of Each Observation
Date   Sat, 9 Oct 2004 23:04:19 +0200

Dear mark:

You would not generate a variable (althought you could if you really wanted to). After any estimation command a number of statistics are temporarily stored. You can see which by looking in the manual or type -ereturn list-. In the example below you can see that the log likelihood is stored in e(ll). You can use that in your calculations. See -help return- and the manual entry for return for more information.


. sysuse auto
(1978 Automobile Data)

. quietly logit foreign weight mpg

. ereturn list

                 e(N) =  74
              e(ll_0) =  -45.0332095569914
                e(ll) =  -27.17515619914122
              e(df_m) =  2
              e(chi2) =  35.71610671570034
              e(r2_p) =  .3965529779806182

            e(depvar) : "foreign"
               e(cmd) : "logit"
          e(crittype) : "log likelihood"
           e(predict) : "logit_p"
          e(chi2type) : "LR"

                 e(b) :  1 x 3
                 e(V) :  3 x 3


. di e(ll)


-----Original Message-----
From:	Marc F. Bellemare [mailto:[email protected]]
Sent:	Sat 10/9/2004 10:44 PM
To:	[email protected]
Subject:	st: Log-Likelihood of Each Observation
Dear colleagues:

I was wondering if anyone knew how to generate a variable equal to the 
log-likelihood of a model just evaluated (either when using the ml subset 
of command or not). I would need such a variable to compute the test 
statistic for a Vuong (1989) test.



Marc F. Bellemare
Ph.D. Candidate
Department of Applied Economics and Management
Cornell University
Ithaca, NY 14853-7801

*   For searches and help try:


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