model.try.catch {chicane}R Documentation

model.try.catch

Description

Internal function for fitting model within a tryCatch loop, handling numerical errors gracefully.

Usage

model.try.catch(
  model.formula,
  data,
  distribution = "negative-binomial",
  maxit = 100,
  epsilon = 1e-08,
  init.theta = NULL,
  start = NULL,
  trace = FALSE,
  verbose = FALSE
)

Arguments

model.formula

formula

data

model data

distribution

Name of distribution of the counts. Options are 'negative-binomial', 'poisson', 'truncated-poisson', and 'truncated-negative-binomial'

maxit

Maximum number of IWLS iterations for fitting the model (passed to glm.control)

epsilon

Positive convergence tolerance for Poisson and negative binomial models. Passed to glm.control

init.theta

Initial value of theta in negative binomial model

start

starting values of coefficients in linear predictor

trace

Logical indicating if output should be produced for each of model fitting procedure. Passed to glm.control or gamlss.control

verbose

Logical indicating whether to print progress reports.

Value

List with elements

model

model object. Set to NULL if no model could be fit.

expected.values

vector of expected values for each element in original data, or vector of NAs if no model could be fit

p.values

vector of p-values for test of significantly higher response than expected, or vector of NAs if no model could be fit


[Package chicane version 0.1.8 Index]