Re: [R] Algorithm used by glm, family=binomial?

Prof Brian D Ripley (ripley@stats.ox.ac.uk)
Mon, 19 Apr 1999 06:53:30 +0100 (BST)

Date: Mon, 19 Apr 1999 06:53:30 +0100 (BST)
From: Prof Brian D Ripley <ripley@stats.ox.ac.uk>
To: Barnet Wagman <wagman@enteract.com>
Subject: Re: [R] Algorithm used by glm, family=binomial?
In-Reply-To: <371AB67D.2726AC8D@enteract.com>

On Mon, 19 Apr 1999, Barnet Wagman wrote:

> Does anyone know what algorithm R uses in glm, family=binomial (i.e. a
> logit model)?
>
> I assume that it's in the source somewhere, but I wasn't able to find
> it. I'd like to know
> what file it's in (in a unix distribution of R).

src/library/base/R/glm.R, or just list the glm and glm.fit functions.
The `meat' is in glm.fit.

R uses the `standard' Nelder-Wedderburn IWLS algorithm for this problem.
That is explained in a number of places. One Bill Venables and I
particularly like is

Firth, D. (1991) Generalized linear models. Chapter 3 of Hinkley, D. V.,
Reid, N. and Snell, E. J. eds (1991) Statistical Theory and Modelling. In
Honour of Sir David Cox, FRS. London: Chapman & Hall.

Perhaps the most elementary exposition is in

A. J. Dobson (1990) "An Introduction to Generalized Linear Models"
Chapham & Hall.

which was previously

A. J. Dobson (1983) "An Introduction to Statistical Modelling".

It is a useful exercise (one I set our graduate students) to write out the
details in the logistic regression case, where some terms cancel.

-- 
Brian D. Ripley,                  ripley@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@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


This archive was generated by hypermail 1.02.