[R] question regarding lm and logLik in R

Thomas Lumley tlumley at u.washington.edu
Sat Sep 28 17:22:16 CEST 2002


On Fri, 27 Sep 2002, Wright, Deanne wrote:

> One person suggested that version 1.5 might include estimation of the
> residual variance into the model parameters.  Does anyone know if
> a) this is the only change or if there is somewhere I can read about how the
> degrees of freedom are calculated?
> b) the degrees of freedom in 1.5.1 are correct for using in differences for
> LRTs?

The degrees of freedom do include the residual variance -- this is clear
if you look at the code for logLik.glm, where an extra df is added for
families that have a scale parameter but not otherwise.

The only real place to find how the variance is calculated is in the
methods for the logLik function: logLik.lm, logLik.glm.

You should be able to rely on the df being right for likelihood ratio
tests, since that's the point of having them.

	-thomas

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list