However, shouldn't _free parameters_ only be counted for degrees of freedom and for calculation of AIC? The sigma parameter is profiled out in a least-squares linear regression, so it's not free, it's not a dimension of the likelihood. Just wondering ...
____________________________________________________________________________________ Dr. Rubén Roa-Ureta AZTI - Tecnalia / Marine Research Unit Txatxarramendi Ugartea z/g 48395 Sukarrieta (Bizkaia) SPAIN > -----Mensaje original----- > De: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] En nombre de Frank Harrell > Enviado el: lunes, 28 de marzo de 2011 15:44 > Para: r-help@r-project.org > Asunto: Re: [R] Degrees of freedom for lm in logLik and AIC > > Thank you Peter. I didn't realize that was the convention used. > Frank > > > Peter Dalgaard-2 wrote: > > > > On Mar 28, 2011, at 05:36 , Frank Harrell wrote: > > > > > I have a question about the computation of the degrees > of freedom > > in a linear > model: > > > > > > x <- runif(20); y <- runif(20) > f <- lm(y > ~ x) > > > logLik(f) > 'log Lik.' -1.968056 (df=3) > > The 3 > is coming > > from f$rank + 1. Shouldn't it be f$rank? This affects > AIC(f). > > > > I count three parameters in a simple linear regression: > alpha, beta, > > sigma. > > > > From a generic-likelihood point of view, I don't see how > you can omit > > the last one. > > > > -pd > > > > -- > > Peter Dalgaard > > Center for Statistics, Copenhagen Business School Solbjerg Plads 3, > > 2000 Frederiksberg, Denmark > > Phone: (+45)38153501 > > Email: pd....@cbs.dk Priv: pda...@gmail.com > > > > ______________________________________________ > > R-help@r-project.org mailing list > > https://stat.ethz.ch/mailman/listinfo/r-help > > PLEASE do read the posting guide > > http://www.R-project.org/posting-guide.html > > and provide commented, minimal, self-contained, reproducible code. > > > > > ----- > Frank Harrell > Department of Biostatistics, Vanderbilt University > -- > View this message in context: > http://r.789695.n4.nabble.com/Degrees-of-freedom-for-lm-in-log > Lik-and-AIC-tp3410687p3411759.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.