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

Re: st: RE: Log-Likelihood of Each Observation


From   "Marc F. Bellemare" <mfb24@cornell.edu>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: Log-Likelihood of Each Observation
Date   Sat, 09 Oct 2004 17:19:23 -0400

Dear colleagues:

Stas was pretty close. I tried his suggestion, and my ml program was not able to find feasible initial values anymore! (This strikes me as rather odd, by the way...) So what I did was to generate (prior to defining my ml program) a new variable called logL, and to add at the end of my ml program which is just "replace logL = `lnf'. It now works just fine.

To answer Stas' question, I am running a Vuong test to discriminate between two non-nested models, one of which is a bivariate probit, in order to see which is best supported by my data.

Thanks very much, Stas' and Maarten!

Marc

At 11:04 PM 10/9/2004 +0200, you wrote:

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.

Example:

. sysuse auto
(1978 Automobile Data)

. quietly logit foreign weight mpg

. ereturn list

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

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

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

functions:
e(sample)

. di e(ll)
-27.175156

Maarten

-----Original Message-----
From: Marc F. Bellemare [mailto:mfb24@cornell.edu]
Sent: Sat 10/9/2004 10:44 PM
To: statalist@hsphsun2.harvard.edu
Cc:
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.

Cheers,

Marc

__________
Marc F. Bellemare
Ph.D. Candidate
Department of Applied Economics and Management
Cornell University
Ithaca, NY 14853-7801
http://www.people.cornell.edu/pages/mfb24


*
* 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/



__________
Marc F. Bellemare
Ph.D. Candidate
Department of Applied Economics and Management
Cornell University
Ithaca, NY 14853-7801
http://www.people.cornell.edu/pages/mfb24


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