Statalist The Stata Listserver


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

Re: st: calculating a loglikelihood in regress


From   Richard Williams <Richard.A.Williams.5@ND.edu>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: calculating a loglikelihood in regress
Date   Wed, 02 May 2007 22:44:55 -0500

At 11:14 PM 5/2/2007, Dan MacNulty wrote:
Dear all,
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.
e(ll) and e(ll_0) are stored by regress. Long and Freese's -fitstat- command (part of their spost9.ado package) provides one of many ways for displaying this and other useful info.

. webuse auto
(1978 Automobile Data)

. quietly reg price mpg rep78 foreign

. fitstat

Measures of Fit for regress of price

Log-Lik Intercept Only: -647.799 Log-Lik Full Model: -637.096
D(65): 1274.193 LR(3): 21.405
Prob > LR: 0.000
R2: 0.267 Adjusted R2: 0.233
AIC: 18.583 AIC*n: 1282.193
BIC: 998.976 BIC': -8.702
BIC used by Stata: 1291.129 AIC used by Stata: 1282.193

Another way:

. nestreg, lr quietly: reg price ( mpg rep78 foreign)

Block 1: mpg rep78 foreign

+----------------------------------------------------------------+
| Block | LL LR df Pr > LR AIC BIC |
|-------+--------------------------------------------------------|
| 1 | -637.0963 21.40 3 0.0001 1282.193 1291.129 |
+----------------------------------------------------------------+


-------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
HOME: (574)289-5227
EMAIL: Richard.A.Williams.5@ND.Edu
WWW: http://www.nd.edu/~rwilliam

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