Skip to contents

Performs exact inference for a binary (incidence) outcome that combines two exact component tests when the design has both matched-pair and reservoir (unmatched) subjects — an internal-to-this-package method (not drawn from external literature) analogous in spirit to InferenceIncidExactBinomial (matched pairs) and InferenceIncidExactFisher (unmatched 2x2 table), fused into one combined exact test rather than a Wald-style variance combination. The point estimate is always the Haldane-Anscombe continuity-corrected log odds ratio \(\log\left((n_{11} + 0.5)(n_{00} + 0.5) / \left((n_{10}+0.5)(n_{01}+0.5)\right)\right)\) from the pooled \(2\times2\) table across all subjects (matched and reservoir together). For p-values and confidence intervals, the two subsets are tested separately (an exact matched-pairs binomial test, as in InferenceIncidExactBinomial, on discordant pairs; an exact Fisher test on the reservoir \(2\times2\) table, as in InferenceIncidExactFisher), and their p-values are combined via combination_method: "Fisher" (default; \(-2(\log p_M + \log p_R) \sim \chi^2_4\) under independence), "Stouffer" (averaged z-scores), or "min_p" (Šidák-style \(1-(1-\min(p_M,p_R))^2\)). If only one of the two subsets is informative (e.g. a pure-Bernoulli design with no matching, or no discordant pairs), the combined p-value degenerates to that one component's p-value. Confidence intervals are obtained by numerically inverting (bisection) the combined p-value as a function of the hypothesized log odds ratio, starting from a normal-approximation (Haldane-Anscombe MLE) interval as the search bracket. Requires a Bernoulli-capable or matching-capable design.

Super class

Inference -> InferenceIncidExactZhang

Methods

+ inherited public methods from Inference


InferenceIncidExactZhang$new()

Usage

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


InferenceIncidExactZhang$compute_estimate()

Usage

InferenceIncidExactZhang$compute_estimate(estimate_only = FALSE)

Arguments

estimate_only

If TRUE, skip variance component calculations.


InferenceIncidExactZhang$compute_exact_confidence_interval()

Usage

InferenceIncidExactZhang$compute_exact_confidence_interval(
  alpha = 0.05,
  pval_epsilon = 0.005,
  type = NULL,
  args_for_type = NULL
)


InferenceIncidExactZhang$clone()

The objects of this class are cloneable with this method.

Usage

InferenceIncidExactZhang$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

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