The <tt>glm()</tt> function



next up previous contents
Next: The gaussian family Up: Generalized linear models; Previous: Families

The glm() function

Since the distribution of the response depends on the stimulus variables through a single linear function only, the same mechanism as was used for linear models can still be used to specify the linear part of a generalized model. The family has to be specified in a different way.

The S-PLUS function to fit a generalized linear model is glm() which uses the form

fitted.model <- glm(formula, family =family.generator, data=data.frame)

The only new feature is the family.generator, which is the way the family is described. Although it seems a little complicated at first sight, (it is the name of a function that generates a list of functions and expressions that together define and control the model and estimation process), its use is quite simple.

The names of the standard, supplied family generators are given under ``Family Name'' in Table 3. Where there is a choice of links, the name of the link may also be supplied with the family name, in parentheses as a parameter. In the case of the quasi family, the variance function may also be specified in this way.

Some examples make the process clear.



Erik Moledor
Tue Jan 31 21:02:18 EST 1995