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
Inference$capabilities()Inference$compute_asymp_confidence_interval()Inference$compute_asymp_two_sided_pval()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()
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_objA completed design object.
model_formulaOptional 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.verboseWhether to print progress messages.
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
# }
