Unadjusted blocked-design incidence inference using the simple mean-difference point estimate with a randomization-based standard error.
Legacy inference class. This class is retained for backwards compatibility and is not comprehensively tested by the package comprehensive-test harness.
Internally, this class recodes treatment assignments to \(w_i \in \{-1, +1\}\)
(the package-wide convention is \(\{0,1\}\); see Design). For a balanced
design the treatment-effect estimator is \(\hat\tau = (2/n)\,\mathbf{y}'\mathbf{w}\),
and since \(E_w[\mathbf{y}'\mathbf{w}] = 0\) for any balanced randomization the
standard error is
$$SE(\hat\tau) = \frac{2}{n}\sqrt{\frac{\sum_k (\mathbf{y}'\mathbf{w}_k)^2}{K}}$$
where \(K\) draws \(\mathbf{w}_1,\ldots,\mathbf{w}_K\) come from the design's
reference distribution. Centering at the known zero mean (rather than the sample mean)
makes the denominator \(K\) rather than \(K-1\).
For blocking designs the expectation is evaluated exactly: $$SE(\hat\tau) = \frac{2}{n}\sqrt{\sum_b \frac{n_{1b}\,n_{0b}}{n_B - 1}}$$ where \(n_{1b}, n_{0b}\) are the numbers of positive and negative responses in block \(b\) and \(n_B\) is the (common) block size. This equals \(2\sqrt{V_{\rm CMH}}\) where \(V_{\rm CMH}\) is the CMH variance from Azriel et al. (2026), Equation 3.
For non-blocking designs, the "balanced design" precondition above requires the observed treatment allocation to be exactly balanced (\(n_T = n_C\)), not merely drawn from a \(prob\_T = 0.5\) mechanism – e.g. plain Bernoulli randomization has \(prob\_T = 0.5\) but does not guarantee an exactly balanced realized allocation. A warning (not an error) is issued once, the first time the standard error is actually computed (i.e. on the first confidence-interval / p-value / standard-error request, not at construction or for estimate-only use), when this is violated – erroring would make this class unusable with Bernoulli-style non-blocking designs entirely; the warning tells the caller the reported standard error may be miscalibrated.
Super class
Inference -> InferenceIncidCMH
Methods
+ inherited public methods from Inference
Inference$capabilities()Inference$compute_estimate()Inference$compute_exact_confidence_interval()Inference$compute_exact_two_sided_pval_for_treatment_effect()Inference$duplicate()Inference$get_analysis_data()Inference$get_covariates()Inference$get_design_object()Inference$get_model_formula()Inference$get_nonestimable_reason()Inference$get_nonestimable_stage()Inference$get_optimization_alg()Inference$get_response()Inference$get_response_type()Inference$get_treatment()Inference$is_nonestimable()Inference$set_optimization_alg()Inference$set_seed()Inference$supports()
InferenceIncidCMH$compute_asymp_confidence_interval()
Uses the randomization-CI layer's two-sided p-value contract
(InferenceRandCI's version, not InferenceRand's): for
incidence responses this dispatches to the Zhang exact randomization
test where applicable rather than refusing outright, matching this
class's pre-migration old-ladder behavior (it inherited from
InferenceAllSimpleAverageDiff, whose own pin was already
corrected to InferenceRandCI – see that file's identical
rationale). This class independently composes the same components
rather than truly inheriting InferenceAllSimpleAverageDiff, so it
had its own stale copy of the old InferenceRand pin, which
silently regressed Zhang dispatch for the non-blocking balanced-design
path – found via
test-incid-cmh-extended-robins-migration-golden.R's
randomization_pval case going from `"ok"` to `"unsupported"`.
Wald confidence interval for the balanced-design/CMH risk-difference
estimate \(\hat\tau\), using the randomization-based (blocking-design: exact CMH
variance formula; non-blocking design: Monte Carlo over se_est_num_vectors
design draws) standard error documented in the class @details. See
InferenceAsymp for the shared Wald contract.
InferenceIncidCMH$compute_asymp_two_sided_pval()
Two-sided Wald p-value for \(H_0: \tau = \code{delta}\) vs.
\(H_1: \tau \neq \code{delta}\), using the same randomization-based standard error
as compute_asymp_confidence_interval().
InferenceIncidCMH$new()
Initialize Cochran-Mantel-Haenszel incidence inference,
validate the stratified binary-response design, and prepare the
stratum-adjusted test used by
InferenceIncidCMH.
Usage
InferenceIncidCMH$new(
des_obj,
model_formula = NULL,
se_est_num_vectors = 5000L,
verbose = FALSE
)Arguments
des_objA completed design object.
model_formulaOptional formula for covariate adjustment.
se_est_num_vectorsFor non-block designs, the number of randomization vectors drawn from the design to estimate the standard error. Default
1000L.verboseLogical. Whether to print progress messages.
