Skip to contents

Unadjusted incidence inference using the empirical risk difference \(\hat\theta = \bar Y_T - \bar Y_C\) (sample proportions in the treatment and control arms) together with the standard unpooled Wald standard error \(\hat s(\hat\theta) = \sqrt{\bar Y_T(1-\bar Y_T)/n_T + \bar Y_C(1-\bar Y_C)/n_C}\) and normal-approximation confidence interval / hypothesis test \(\hat\theta \pm z_{1-\alpha/2}\,\hat s(\hat\theta)\). This is the classical two-proportion Wald interval (e.g. Wald 1943; see InferenceIncidNewcombeRiskDiff for a small-sample-robust alternative). likelihood_tier = "none": no likelihood is fit, so no likelihood-ratio or parametric-bootstrap methods are exposed; the reservoir/covariate structure is ignored, unlike InferenceIncidRiskDiff's covariate- adjusted linear-probability model. Non-estimable if either arm has zero subjects.

Super class

Inference -> InferenceIncidWald

Methods

+ inherited public methods from Inference


InferenceIncidWald$new()

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 (`compute_rand_two_sided_pval()` started throwing "Randomization tests are not supported for incidence" for the same designs the old ladder handled correctly) – found via test-incid-wald-migration-golden.R's randomization_pval case going from `"ok"` to `"unsupported"`.

Initialize Wald risk-difference incidence inference and prepare the treatment/control binomial summaries used by InferenceIncidWald and related InferenceIncidRiskDiff methods.

Usage

InferenceIncidWald$new(des_obj, model_formula = NULL, verbose = FALSE)

Arguments

des_obj

A completed design object.

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.

Returns

A new InferenceIncidWald object.


InferenceIncidWald$clone()

The objects of this class are cloneable with this method.

Usage

InferenceIncidWald$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

# \donttest{
seq_des = DesignSeqOneByOneBernoulli$new(n = 10, response_type = 'incidence')
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(rbinom(10, 1, 0.5))
inf = InferenceIncidWald$new(seq_des)
inf$compute_estimate()
#> [1] 0
# }