Fit GLM according to a specified distribution. This needs to be done separately from glm
in order to include negative binomial and truncated distributions as options.
fit.glm(
formula,
data,
distribution = c("negative-binomial", "poisson", "truncated-poisson",
"truncated-negative-binomial"),
start = NULL,
init.theta = NULL,
maxit = 100,
epsilon = 1e-08,
trace = FALSE
)
Formula specifying model of interest
Data frame containing variables specified in formula
Name of distribution of the counts. Options are 'negative-binomial', 'poisson', 'truncated-poisson', and 'truncated-negative-binomial'
Starting values for model coefficients
Initial value of theta if fitting the negative binomial distribution
Maximum number of IWLS iterations for fitting the model (passed to glm.control
)
Positive convergence tolerance for Poisson and negative binomial models. Passed to glm.control
Logical indicating if output should be produced for each of model fitting procedure. Passed to glm.control
or gamlss.control
List with elements
model object
vector of expected values for each element in original data
vector of p-values for test of significantly higher response than expected