Skip to contents

Fits the same Poisson log-link mean model as InferenceCountPoisson (point estimate via fast_poisson_regression_cpp, maximum likelihood), but computes standard errors via a Huber-White (Eicker-Huber-White) sandwich estimator instead of the model-based Poisson Fisher information or the quasi-Poisson dispersion scaling used by InferenceCountQuasiPoisson: \(\widehat{\mathrm{Var}}(\hat\beta) = B\,M\,B\), with "bread" \(B = (X^\top \hat W X)^{-1}\) (the Poisson Fisher information at \(\hat\beta\)) and "meat" \(M = X^\top \mathrm{diag}((y_i-\hat\mu_i)^2) X\) (the empirical score outer product), via robust_sandwich_variance_from_xtwx(). This is robust to arbitrary mean-variance misspecification (not just proportional overdispersion), at the cost of somewhat higher variance in the SE estimate itself for small samples. This class has no likelihood-ratio/ score/gradient testing capability (likelihood_tier = "quasi"): only Wald inference is available. Rank-deficient covariate columns are dropped automatically before fitting.

Super class

Inference -> InferenceCountRobustPoisson

Methods

+ inherited public methods from Inference


InferenceCountRobustPoisson$new()

Uses the shared randomization two-sided p-value contract; see InferenceRand.

Initialize a robust (sandwich-variance) Poisson regression inference object for a completed design with a count, uncensored response.

Usage

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

Arguments

des_obj

A completed Design object with a count response.

model_formula

Optional formula for covariate adjustment. If NULL (default), the formula from the design object is used and its pre-computed design matrix is reused. If a formula is provided, a new design matrix is constructed from the design's imputed covariates.

verbose

Whether to print progress messages.

smart_cold_start_default

Whether to use smart starting values for the optimizer.


InferenceCountRobustPoisson$compute_estimate()

Computes the Poisson treatment coefficient \(\hat\beta_T\) via fast_poisson_regression_cpp (see class documentation for the sandwich-variance model). Rank-deficient covariate columns are dropped before fitting.

Usage

InferenceCountRobustPoisson$compute_estimate(estimate_only = FALSE)

Arguments

estimate_only

If TRUE, skip variance calculations.


InferenceCountRobustPoisson$compute_estimate_with_bootstrap_weights()

Recomputes the Poisson-mean-model treatment estimate under subject/block bootstrap weights (via fast_poisson_regression_weighted_cpp), used by the Bayesian bootstrap and related weighted-resampling machinery; see InferenceBayesianBootstrap. Always leaves the standard error and degrees of freedom unavailable (NA) regardless of estimate_only — this weighted-refit path never computes the sandwich variance.

Usage

InferenceCountRobustPoisson$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

Present for interface parity; this method never computes variance components regardless of its value.


InferenceCountRobustPoisson$compute_asymp_confidence_interval()

Computes a \(1-\alpha\) level confidence interval for the robust Poisson treatment coefficient \(\hat\beta_T\), using the Huber-White sandwich standard error (see class documentation). See InferenceAsymp for the shared asymptotic confidence-interval contract this delegates to.

Usage

InferenceCountRobustPoisson$compute_asymp_confidence_interval(alpha = 0.05)

Arguments

alpha

Confidence level.


InferenceCountRobustPoisson$compute_asymp_two_sided_pval()

Computes a two-sided Wald p-value testing \(H_0: \beta_T = \code{delta}\), from the same Huber-White sandwich standard error used by $compute_asymp_confidence_interval(). See InferenceAsymp for the shared asymptotic two-sided p-value contract this delegates to.

Usage

InferenceCountRobustPoisson$compute_asymp_two_sided_pval(delta = 0)

Arguments

delta

Null treatment effect value.


InferenceCountRobustPoisson$clone()

The objects of this class are cloneable with this method.

Usage

InferenceCountRobustPoisson$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 = InferenceCountRobustPoisson$new(seq_des)
inf$compute_estimate()
#> treatment 
#>  0.351136 
# }