Description Usage Arguments Details Value References See Also Examples

A modification of the system function `glm()`

to include
estimation of the additional parameter, `theta`

, for a
Negative Binomial generalized linear model.

1 2 3 4 5 |

```
formula, data, weights, subset, na.action, start, etastart,
mustart, control, method, model, x, y, contrasts, ...
``` |
arguments for the |

`init.theta` |
Optional initial value for the theta parameter. If omitted a moment estimator after an initial fit using a Poisson GLM is used. |

`link` |
The link function. Currently must be one of |

An alternating iteration process is used. For given `theta`

the GLM
is fitted using the same process as used by `glm()`

. For fixed means
the `theta`

parameter is estimated using score and information
iterations. The two are alternated until convergence of both. (The
number of alternations and the number of iterations when estimating
`theta`

are controlled by the `maxit`

parameter of
`glm.control`

.)

Setting `trace > 0`

traces the alternating iteration
process. Setting `trace > 1`

traces the `glm`

fit, and
setting `trace > 2`

traces the estimation of `theta`

.

A fitted model object of class `negbin`

inheriting from `glm`

and `lm`

. The object is like the output of `glm`

but contains
three additional components, namely `theta`

for the ML estimate of
theta, `SE.theta`

for its approximate standard error (using
observed rather than expected information), and `twologlik`

for
twice the log-likelihood function.

Venables, W. N. and Ripley, B. D. (2002)
*Modern Applied Statistics with S.* Fourth edition. Springer.

`glm`

, `negative.binomial`

,
`anova.negbin`

, `summary.negbin`

,
`theta.md`

There is a `simulate`

method.

1 2 3 4 |

```
Likelihood ratio tests of Negative Binomial Models
Response: Days
Model
1 Sex/(Age + Eth * Lrn)
2 Sex + Sex:Age + Sex:Eth + Sex:Lrn + Sex:Eth:Lrn + Sex:Age:Lrn
3 Sex + Sex:Age + Sex:Eth + Sex:Lrn + Sex:Eth:Lrn + Sex:Age:Lrn + Sex:Age:Eth + Sex:Age:Eth:Lrn
theta Resid. df 2 x log-lik. Test df LR stat. Pr(Chi)
1 1.597991 132 -1063.025
2 1.686899 128 -1055.398 1 vs 2 4 7.627279 0.10622602
3 1.928360 118 -1039.324 2 vs 3 10 16.073723 0.09754136
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.