[R] glm

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu May 17 11:42:36 CEST 2001

On Thu, 17 May 2001, Sebastien Ollier wrote:

> Hello,
> I need to fit a generalized linear model with a Chi2 (6 ddl) as error
distribution and with "log" as link function. I have looked in help(family) and
maybe I could use Gamma(link="log") but I do not know if I can, and where I can
define the shape and the scale arguments of the gamma distribution. Maybe there
is another may to do that?
> Could someone explain me how can I fit a glm with :
> 	-error distribution : Chi2 (6 ddl)
> 	-link function : log

Easy. Fit it with glm(family=Gamma) and where needed (summary, predict)
specify the dispersion.  Now I don't know what a `Chi2 (6 ddl)' means:
perhaps a chi-squared on 6 df?  If so that is gamma with shape a=3, and
for a Gamma family that is dispersion 1/a (since the coefficient of
variation is a*s^2/(a*s)^2, in the terminology of ?dgamma).

However, I always check the details in an example, and in particular
check that the estimated dispersion is near what I calculate.

The scale is specified via the mean, and that's what a GLM models.

Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

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