Skip to contents

Fits the same unadjusted mean-difference point estimate as InferenceAllSimpleAverageDiff, \(\hat\beta_T = \bar y_T - \bar y_C\), but performs inference via the classical pooled equal-variance Student's t-test instead of Welch's unequal-variance version: pooled variance \(s_p^2 = \left((n_T-1)s_T^2 + (n_C-1)s_C^2\right)/(n_T+n_C-2)\), standard error \(s_p\sqrt{1/n_T + 1/n_C}\), and exact degrees of freedom \(n_T+n_C-2\) — see $compute_asymp_confidence_interval() for the full formula. This assumes the two arms have equal population variance; prefer InferenceAllSimpleAverageDiff when that assumption is doubtful, since the pooled estimator's nominal coverage degrades under heteroskedasticity with unequal arm sizes. This class does not support censored survival data (enforced at construction). 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

Student [Gosset, W. S.] (1908). "The Probable Error of a Mean." Biometrika, 6(1), 1-25, doi:10.1093/biomet/6.1.1 , for the pooled-variance two-sample t-test used here.

Super class

Inference -> InferenceAllSimpleMeanDiffPooledVar

Methods

+ inherited public methods from Inference


InferenceAllSimpleMeanDiffPooledVar$new()

Usage

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


InferenceAllSimpleMeanDiffPooledVar$compute_asymp_confidence_interval()

Usage

InferenceAllSimpleMeanDiffPooledVar$compute_asymp_confidence_interval(
  alpha = 0.05
)

Arguments

alpha

Significance level.


InferenceAllSimpleMeanDiffPooledVar$compute_asymp_two_sided_pval()

Usage

InferenceAllSimpleMeanDiffPooledVar$compute_asymp_two_sided_pval(delta = 0)

Arguments

delta

Null treatment effect.


InferenceAllSimpleMeanDiffPooledVar$clone()

The objects of this class are cloneable with this method.

Usage

InferenceAllSimpleMeanDiffPooledVar$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

# \donttest{
seq_des = DesignSeqOneByOneBernoulli$new(n = 10, response_type = 'continuous')
for (i in 1:10) {
  seq_des$add_one_subject_to_experiment_and_assign(data.frame(x1 = rnorm(1)))
}
seq_des$add_all_subject_responses(rnorm(10))
inf = InferenceAllSimpleMeanDiffPooledVar$new(seq_des)
inf$compute_estimate()
#> [1] -0.3356485
# }