Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: calculating a loglikelihood in regress


From   [email protected] (Roberto G. Gutierrez, StataCorp)
To   [email protected]
Subject   Re: st: calculating a loglikelihood in regress
Date   Wed, 02 May 2007 21:33:28 -0500

Dan MacNulty <[email protected]> asks:

> Does anyone know if it's possible to calculate a loglikelihood value from
> regress? I tried to download and implement the command "reglike", but I was
> unsuccessful. Perhaps someone is aware of an up-to-date alternative, or can
> provide further instruction on how to use the reglike procedure. Any
> insights would be much appreciated.

-regress- saves this information in e(ll), although it does not display it.
Try

    . sysuse auto
    . regress mpg weight 
    . display e(ll)

Of course, if you want this sort of thing displayed, you could always type

    . xtmixed mpg weight

or

    . xtmixed mpg weight, reml

if you want the likelihood associated with the "N-k" divided residual error, 
rather than the ML residual error, which merely divides by N.  -regress- 
gives the latter, by the way.

--Bobby
[email protected]
*
*   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