
Exact Fisher (Conditional Hypergeometric) Incidence Inference
Source:R/inference_indicidence_exact_fisher.R
InferenceIncidExactFisher.RdPerforms exact conditional inference for binary (incidence) outcomes via
Fisher's exact test on one or more 2x2 (treated/control by case/noncase)
tables. When the design provides no stratification structure (e.g. an
unstructured or iBCRD design), a single overall 2x2 table is built and
fisher.test is used directly, giving the conditional
MLE odds ratio and its exact confidence interval/p-value. When the design
has blocking structure (DesignFixedBlocking,
DesignSeqOneByOneSPBR, DesignSeqOneByOneRandomBlockSize), a
separate 2x2 table is built per block-defining covariate stratum. When the
design has matched-pair structure (KK matching-on-the-fly designs),
each matched pair becomes its own 2x2 table, with any reservoir (unmatched)
subjects pooled into one additional stratum table. In either stratified
case, mantelhaen.test (exact conditional test) is used
instead, giving the common odds ratio across strata; stratified inference
only supports testing/estimating against a null odds ratio of 1 (log odds
ratio 0) — a non-zero null shift is rejected with an error. Strata with no
cases or no noncases in either arm are dropped before analysis; if no
informative strata remain, this errors rather than returning a degenerate
result.
References
Fisher, R. A. (1935). "The Logic of Inductive Inference."
Journal of the Royal Statistical Society, 98(1), 39-82,
doi:10.2307/2342435
, for the exact conditional test underlying
fisher.test; Mantel, N., and Haenszel, W. (1959).
"Statistical Aspects of the Analysis of Data from Retrospective Studies
of Disease." Journal of the National Cancer Institute, 22(4),
719-748, for the stratified common-odds-ratio test used when the design
provides multiple strata.
Super class
Inference -> InferenceIncidExactFisher
Methods
+ inherited public methods from Inference
Inference$capabilities()Inference$compute_asymp_confidence_interval()Inference$compute_asymp_two_sided_pval()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()
InferenceIncidExactFisher$new()
Usage
InferenceIncidExactFisher$new(
des_obj,
model_formula = NULL,
verbose = FALSE,
smart_cold_start_default = NULL
)Arguments
des_objA completed
Designobject whose entire n subjects are assigned and response y is recorded within.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.
smart_cold_start_defaultWhether to use smart cold start values by default for likelihood-based models. Explicit starts always override this object-level policy.
NULL(default) consults the global cold-start dispatch policy.