Skip to content
Prev 25601 / 398502 Next

Understanding function residuals()

On Sun, 24 Nov 2002, Andrew Criswell wrote:

            
If you want loglikelihoods you use the logLik() function.

 R> logLik(fm1)
`log Lik.' -68.38682 (df=1)
You shouldn't use fm1$residuals --- the S language doesn't prevent you
from accessing internal fields of objects directly, but it's still a bad
idea, especially if you don't know what they mean.

The residuals() function for a glm provides five different sorts of
residuals according to the "type" argument (as described in
help(residuals.glm)).  The values for fm1$residuals are in fact *not* the
difference between the actual and fitted data (in this model they are
equal purely by coincidence).

	-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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._