[R] Calculating dispersion in glm

Bill.Venables@cmis.csiro.au Bill.Venables at cmis.csiro.au
Fri Aug 23 03:06:20 CEST 2002


Small footnote.  This estimate of the dispersion parameter is according to
the recommendation in McCullagh and Nelder.  For normal models it agrees
with mean deviance, for Poisson and Binomial it is not needed as dispersion
is 1, known, so the only contentious cases commonly occurring are gamma,
inverse gaussian and quasi and for quasi you don't have much else to go on.
There is a function in the MASS library called gamma.dispersion that
calculates an accurate MLE of the dispersion parameter and it can sometimes
be useful to compare these with the mean square Pearson residual estimate of
McCullagh and Nelder.  When they differ, use the latter; if they are the
same you can use either...!

Bill Venables.

-----Original Message-----
From: Thomas Lumley [mailto:tlumley at u.washington.edu]
Sent: Friday, August 23, 2002 8:30 AM
To: David Mackie
Cc: r-help at stat.math.ethz.ch
Subject: Re: [R] Calculating dispersion in glm


On Fri, 23 Aug 2002, David Mackie wrote:

> Hi all,
>
> How is dispersion calculated within the glm function in R ?
>

It isn't.

It's calculated within the summary.glm function (or supplied by the user).
as
 sum(object$weights * object$residuals^2)/df.r

which works out to be equal to the mean square of the Pearson residuals.

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