Skip to contents

Performs 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


InferenceIncidExactFisher$new()

Usage

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

Arguments

des_obj

A completed Design object whose entire n subjects are assigned and response y is recorded within.

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 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.


InferenceIncidExactFisher$compute_estimate()

Usage

InferenceIncidExactFisher$compute_estimate(estimate_only = FALSE)

Arguments

estimate_only

If TRUE, skip variance component calculations.


InferenceIncidExactFisher$clone()

The objects of this class are cloneable with this method.

Usage

InferenceIncidExactFisher$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

if (FALSE) { # \dontrun{
# Example for InferenceIncidExactFisher
} # }