Re: [R] Degrees of freedom for lm in logLik and AIC

From: Frank Harrell <f.harrell_at_vanderbilt.edu>
Date: Mon, 28 Mar 2011 06:43:50 -0700 (PDT)

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:
>
> &gt; I have a question about the computation of the degrees of freedom in
> a linear
> &gt; model:
> &gt;
> &gt; x &lt;- runif(20); y &lt;- runif(20)
> &gt; f &lt;- lm(y ~ x)
> &gt; logLik(f)
> &gt; 'log Lik.' -1.968056 (df=3)
> &gt;
> &gt; The 3 is coming from f$rank + 1. Shouldn't it be f$rank? This
> affects
> &gt; 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.mes_at_cbs.dk Priv: PDalgd_at_gmail.com
>
> ______________________________________________
> R-help_at_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-logLik-and-AIC-tp3410687p3411759.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help_at_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.
Received on Mon 28 Mar 2011 - 13:48:41 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 28 Mar 2011 - 14:50:24 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive