Skip to contents

Fits the simplest possible treatment-effect estimator for a continuous response: the unadjusted difference in sample means between the treated and control arms, \(\hat\beta_T = \bar y_T - \bar y_C\), with no covariate adjustment. Inference is by Welch's unequal-variance t-test: standard error \(\sqrt{s_T^2/n_T + s_C^2/n_C}\) (per-arm sample variances, not pooled) with Satterthwaite-Welch degrees of freedom — see $compute_asymp_confidence_interval() for the exact formula. This class has no likelihood tier (likelihood_tier = "none") and provides asymptotic Wald, randomization, and bootstrap (including Bayesian bootstrap) confidence intervals and p-values. Warm starts are disabled for this class, since the simple mean difference is a closed-form estimator (no iterative fit to warm-start).

References

Welch, B. L. (1947). "The Generalization of 'Student's' Problem when Several Different Population Variances are Involved." Biometrika, 34(1-2), 28-35, doi:10.1093/biomet/34.1-2.28 , for the unequal-variance t-test and its Satterthwaite-Welch degrees-of-freedom approximation used here.

Super class

Inference -> InferenceAllSimpleAverageDiff

Methods

+ inherited public methods from Inference


InferenceAllSimpleAverageDiff$new()

Usage

InferenceAllSimpleAverageDiff$new(
  des_obj,
  model_formula = NULL,
  verbose = FALSE,
  max_resample_attempts = 50L,
  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.


InferenceAllSimpleAverageDiff$compute_asymp_confidence_interval()

Usage

InferenceAllSimpleAverageDiff$compute_asymp_confidence_interval(alpha = 0.05)

Arguments

alpha

Significance level.


InferenceAllSimpleAverageDiff$compute_asymp_two_sided_pval()

Usage

InferenceAllSimpleAverageDiff$compute_asymp_two_sided_pval(delta = 0)

Arguments

delta

Null treatment effect.


InferenceAllSimpleAverageDiff$compute_estimate()

Usage

InferenceAllSimpleAverageDiff$compute_estimate(estimate_only = FALSE)

Arguments

estimate_only

If TRUE, skip variance component calculations.


InferenceAllSimpleAverageDiff$compute_estimate_with_bootstrap_weights()

Usage

InferenceAllSimpleAverageDiff$compute_estimate_with_bootstrap_weights(
  subject_or_block_weights,
  estimate_only = FALSE
)


InferenceAllSimpleAverageDiff$clone()

The objects of this class are cloneable with this method.

Usage

InferenceAllSimpleAverageDiff$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

if (FALSE) { # \dontrun{
seq_des = DesignSeqOneByOneBernoulli$new(n = 6, response_type = "continuous")
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[1, 2 : 10])
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[2, 2 : 10])
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[3, 2 : 10])
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[4, 2 : 10])
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[5, 2 : 10])
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[6, 2 : 10])
seq_des$add_all_subject_responses(c(4.71, 1.23, 4.78, 6.11, 5.95, 8.43))

seq_des_inf = InferenceAllSimpleAverageDiff$new(seq_des)
seq_des_inf$compute_estimate()
seq_des_inf$compute_asymp_confidence_interval()
seq_des_inf$compute_asymp_two_sided_pval()
} # }