
Simple Mean-Difference Inference for Continuous Responses
Source:R/inference_all_average_diff.R
InferenceAllSimpleAverageDiff.RdFits 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
Public methods
+ inherited public methods from Inference
Inference$capabilities()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()
InferenceAllSimpleAverageDiff$new()
Usage
InferenceAllSimpleAverageDiff$new(
des_obj,
model_formula = NULL,
verbose = FALSE,
max_resample_attempts = 50L,
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.
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()
} # }