Fits a binomial model for a positive outcome and a Gamma model with a log link among positive outcomes. The marginal mean is the product of the probability of a positive outcome and the conditional positive mean.

fastglm_twopart(
  formula,
  data,
  subset,
  na.action,
  weights,
  offset,
  link = "logit",
  method = "auto",
  tol = 1e-08,
  maxit = 100L,
  firth = FALSE,
  response = NULL,
  z = NULL,
  block.size = 8192L
)

Arguments

formula

numeric matrix, `dgCMatrix`, [fastglm_source()], or a formula with one or two right-hand sides, as in [fastglm_hurdle()].

data, subset, na.action, weights, offset

model-frame arguments. A vector offset applies to the positive component; a two-column matrix supplies positive and binary offsets.

link for the probability of a positive outcome.

method, tol, maxit

solver and convergence controls for [fastglm()].

firth

apply mean bias reduction to both components.

response

nonnegative continuous response for a matrix design.

z

optional binary-component design for matrix inputs; defaults to the positive-component matrix. Source blocks can supply `Z` and `X`.

block.size

maximum number of matrix rows processed together for model validation. A source determines its own block sizes.

Value

A `fastglm_twopart` model supporting prediction, delta-method standard errors, simulation, and component summaries.