Skip to contents

Fits a hurdle negative binomial regression for count responses: a binary hurdle submodel \(P(Y_i > 0) = \mathrm{logit}^{-1}(X_i^{h\top} \gamma^h)\) (fit jointly with the count submodel) crossed with a zero-truncated negative-binomial count submodel for \(Y_i \mid Y_i > 0\): \(\log E[Y_i \mid Y_i > 0, w_i, x_i] = \beta_0 + \beta_T w_i + x_i^\top \gamma\), \(\mathrm{Var}(Y_i \mid Y_i > 0) = \mu_i + \mu_i^2 / \theta\) (fast_hurdle_negbin_cpp/ fast_hurdle_negbin_with_var_cpp). The hurdle and count submodels may use different covariate formulas (model_formula/model_formula_hurdle). The reported treatment effect is the coefficient from the conditional (truncated, \(Y > 0\)) count component, on the log-rate scale, conditional on clearing the hurdle: it is not the effect on the unconditional mean \(E[Y]\), which also depends on how treatment shifts the hurdle-crossing probability. A marginal (unconditional-mean) estimand is not yet implemented for this class (see marginal_estimand_report.md). likelihood_tier = "full": Wald, gradient, and (bootstrap-calibrated) likelihood-ratio tests are available for the count submodel's treatment coefficient; a plain score test is not exposed. Jackknife inference is not supported: delete-one refits of this two-part model with a jointly-estimated dispersion parameter are numerically unstable, so compute_jackknife_estimate() and related methods report explicit non-estimability rather than attempting delete-one refits.

References

Mullahy, J. (1986). "Specification and Testing of Some Modified Count Data Models." Journal of Econometrics, 33(3), 341-365, doi:10.1016/0304-4076(86)90002-3 , for the hurdle count-model framework.

See also

InferenceCountNegBin for the single-part negative binomial model this class's count submodel generalizes to two parts.

Super class

Inference -> InferenceCountHurdleNegBin

Methods

+ inherited public methods from Inference


InferenceCountHurdleNegBin$new()

Initialize inference for the two-part hurdle negative binomial model (binary hurdle submodel plus zero-truncated negative-binomial count submodel); see InferenceCountHurdleNegBin for the model form. Does not fit the model; the fit is deferred to the first call to compute_estimate() or a method that requires it.

Usage

InferenceCountHurdleNegBin$new(
  des_obj,
  model_formula = NULL,
  model_formula_hurdle = NULL,
  verbose = FALSE,
  smart_cold_start_default = NULL
)

Arguments

des_obj

A completed Design object.

model_formula

Optional formula for covariate adjustment.

model_formula_hurdle

Formula for the hurdle submodel. If NULL (default), it uses the same formula as model_formula.

verbose

A flag indicating whether messages should be displayed.

smart_cold_start_default

Whether to use smart cold start values.


InferenceCountHurdleNegBin$compute_asymp_confidence_interval()

Compute the hurdle negative-binomial asymptotic confidence interval for the treatment coefficient, using the shared count-likelihood semantics documented in InferenceCountLikelihood.

Usage

InferenceCountHurdleNegBin$compute_asymp_confidence_interval(alpha = 0.05)

Arguments

alpha

The significance level (default 0.05).


InferenceCountHurdleNegBin$compute_asymp_two_sided_pval()

Compute the hurdle negative-binomial asymptotic two-sided p-value for the treatment coefficient, falling back through the shared count-likelihood machinery when needed; see InferenceCountLikelihood.

Usage

InferenceCountHurdleNegBin$compute_asymp_two_sided_pval(delta = 0)

Arguments

delta

The null treatment effect (default 0).


InferenceCountHurdleNegBin$compute_gradient_two_sided_pval()

Gradient test of \(H_0: \beta_T = \code{delta}\) on the truncated count submodel's treatment coefficient (a score-test variant using the observed rather than expected information); see InferenceCountLikelihood for the shared likelihood-test dispatch.

Usage

InferenceCountHurdleNegBin$compute_gradient_two_sided_pval(delta = 0)

Arguments

delta

The null treatment effect (default 0).


InferenceCountHurdleNegBin$compute_gradient_confidence_interval()

Compute a hurdle negative-binomial likelihood-based confidence interval by inverting the configured likelihood test. See InferenceCountLikelihood for related score, likelihood-ratio, and gradient methods.

Usage

InferenceCountHurdleNegBin$compute_gradient_confidence_interval(alpha = 0.05)

Arguments

alpha

The significance level (default 0.05).


InferenceCountHurdleNegBin$compute_estimate_with_bootstrap_weights()

Refits the hurdle negative-binomial model with subject/ block-level weights (Bayesian-bootstrap or nonparametric-bootstrap draw weights, expanded to row level via private$expand_subject_or_block_weights_to_row_weights()) via glmmTMB's glmmTMB(family = truncated_nbinom2()) (not the package's internal C++ solver, which has no weighted variant for this model), and returns the reweighted conditional-count log-rate-ratio estimate \(\hat\beta_T^{(w)}\). Requires the glmmTMB package; errors if unavailable. No standard error is computed (s_beta_hat_T is always NA). A fit that fails, or whose fitted treatment coefficient is missing or non-finite, is cached as nonestimable and returns NA.

Usage

InferenceCountHurdleNegBin$compute_estimate_with_bootstrap_weights(
  subject_or_block_weights,
  estimate_only = FALSE
)

Arguments

subject_or_block_weights

Bootstrap weights at the subject or block level.

estimate_only

If TRUE, skip variance calculations.


InferenceCountHurdleNegBin$compute_jackknife_estimate()

Hurdle negative-binomial delete-one refits are unstable for jackknife inference; report explicit non-estimability.

Usage

InferenceCountHurdleNegBin$compute_jackknife_estimate(unit = "auto")

Arguments

unit

Deletion unit. Default "auto".


InferenceCountHurdleNegBin$compute_jackknife_bias_estimate()

Report that the jackknife bias estimate is unavailable for hurdle negative-binomial fits because delete-one refits are unstable; see InferenceJackknife for the shared jackknife contract.

Usage

InferenceCountHurdleNegBin$compute_jackknife_bias_estimate(unit = "auto")

Arguments

unit

Deletion unit. Default "auto".


InferenceCountHurdleNegBin$compute_jackknife_std_error()

Report that the jackknife standard error is unavailable for hurdle negative-binomial fits because delete-one refits are unstable; see InferenceJackknife for the shared jackknife contract.

Usage

InferenceCountHurdleNegBin$compute_jackknife_std_error(unit = "auto")

Arguments

unit

Deletion unit. Default "auto".


InferenceCountHurdleNegBin$compute_jackknife_wald_two_sided_pval()

Reports that jackknife-Wald p-values are unavailable here; see InferenceJackknife.

Usage

InferenceCountHurdleNegBin$compute_jackknife_wald_two_sided_pval(
  delta = 0,
  unit = "auto"
)

Arguments

delta

Null treatment-effect value. Default 0.

unit

Deletion unit. Default "auto".


InferenceCountHurdleNegBin$compute_jackknife_wald_confidence_interval()

Reports that jackknife-Wald intervals are unavailable here; see InferenceJackknife.

Usage

InferenceCountHurdleNegBin$compute_jackknife_wald_confidence_interval(
  alpha = 0.05,
  unit = "auto"
)

Arguments

alpha

Significance level. Default 0.05.

unit

Deletion unit. Default "auto".


InferenceCountHurdleNegBin$clone()

The objects of this class are cloneable with this method.

Usage

InferenceCountHurdleNegBin$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

# \donttest{
seq_des = DesignSeqOneByOneBernoulli$new(n = 10, response_type = 'count')
for (i in 1:10) {
  seq_des$add_one_subject_to_experiment_and_assign(data.frame(x1 = rnorm(1)))
}
seq_des$add_all_subject_responses(rpois(10, 2))
inf = InferenceCountHurdleNegBin$new(seq_des, model_formula = ~ x1)
inf$compute_estimate()
#> [1] 1.850173
# }