Learn R Programming

COUNT (version 1.3.4)

ml.nbc: NBC: maximum likelihood linear negative binomial regression

Description

ml.nbc is a maximum likelihood function for estimating canonical linear negative binomial (NB-C) data.

Usage

ml.nbc(formula, data, start=NULL, verbose=FALSE)

Arguments

formula
an object of class '"formula"': a symbolic description of the model to be fitted. The details of model specification are given under 'Details'.
data
a mandatory data frame containing the variables in the model.
start
an optional vector of starting values for the parameters.
verbose
a logical flag to indicate whether the fit information should be printed.

Value

The function returns a dataframe with the following components:

Details

ml.nbc is used like glm.nb, but without saving ancillary statistics.

References

Hilbe, J.M. (2011), Negative Binomial Regression, second edition, Cambridge University Press.

See Also

glm.nb, ml.nb1, ml.nb2

Examples

Run this code
# Table 10.12, Hilbe. J.M. (2011), Negative Binomial Regression, 
#   2nd ed. Cambridge University Press (adapted)

## Not run: 
# data(medpar)
# nobs <- 50000
# x2 <- runif(nobs)
# x1 <- runif(nobs)
# xb <- 1.25*x1 + .1*x2 - 1.5
# mu <- 1/(exp(-xb)-1)
# p <- 1/(1+mu)
# r <- 1
# gcy <- rnbinom(nobs, size=r, prob = p)
# test <- data.frame(gcy, x1, x2)
# nbc <- ml.nbc(gcy ~ x1 + x2, data=test)
# nbc
# ## End(Not run)

Run the code above in your browser using DataLab