Internal function for fitting model within a tryCatch loop, handling numerical errors gracefully.
model.try.catch(
model.formula,
data,
distribution = "negative-binomial",
maxit = 100,
epsilon = 1e-08,
init.theta = NULL,
start = NULL,
trace = FALSE,
verbose = FALSE
)
formula
model data
Name of distribution of the counts. Options are 'negative-binomial', 'poisson', 'truncated-poisson', and 'truncated-negative-binomial'
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
Initial value of theta in negative binomial model
starting values of coefficients in linear predictor
Logical indicating if output should be produced for each of model fitting procedure. Passed to glm.control
or gamlss.control
Logical indicating whether to print progress reports.
List with elements
model object. Set to NULL if no model could be fit.
vector of expected values for each element in original data, or vector of NAs if no model could be fit
vector of p-values for test of significantly higher response than expected, or vector of NAs if no model could be fit