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

Initialize simple pooled-variance mean-difference inference for continuous responses and prepare the pooled standard-error calculation used by InferenceAllSimpleMeanDiffPooledVar. Disables warm starts (closed-form estimator) and asserts des_obj has no censored observations (unsupported by this class).

Computes a \(1-\alpha\) level confidence interval for the simple (unadjusted) mean-difference treatment effect \(\hat\beta_T = \bar y_T - \bar y_C\), using the classical pooled equal-variance Student's t-test formula (unlike InferenceAllSimpleAverageDiff's Welch unequal-variance version): the pooled variance estimate \(s_p^2 = \left((n_T-1)s_T^2 + (n_C-1)s_C^2\right) / (n_T+n_C-2)\) gives standard error \(\widehat{\mathrm{SE}}(\hat\beta_T) = s_p\sqrt{1/n_T + 1/n_C}\) with exact degrees of freedom \(n_T + n_C - 2\); the interval is \(\hat\beta_T \pm t_{\mathrm{df}, 1-\alpha/2}\, \widehat{\mathrm{SE}}(\hat\beta_T)\). Assumes equal population variances in the two arms — use InferenceAllSimpleAverageDiff instead when that assumption is doubtful. Requires at least 2 observations per arm; otherwise returns c(NA, NA). See InferenceAsymp for the shared asymptotic confidence-interval contract this participates in.

Computes a two-sided pooled-variance Student's t-test p-value testing \(H_0: \beta_T = \code{delta}\), from the same pooled standard error and exact \(n_T+n_C-2\) degrees of freedom used by $compute_asymp_confidence_interval() — see that method's documentation for the full formula. See InferenceAsymp for the shared asymptotic two-sided p-value contract this participates in.

Value

A new InferenceAllSimpleMeanDiffPooledVar object.

Small-sample behaviour

How fast the size (and coverage) error of each procedure is expected to vanish as the effective sample size \(n_{eff}\) grows, from EDI's convergence-rate registry (inference_convergence_expectation()). Exact procedures are valid at every n by construction; the others are asymptotic, so a small-sample excess is expected, and its constant is not given by an order. The table is the expectation for a balanced complete-randomization design; it is not a measured size. Reference keys are explained under References.

ProcedureRegimeError orderEffective nRegularityBasisReferences
randfinite sampleexactsubjectsregulartheory[Fisher1935], [LehmannRomano2005]
waldasymptotic\(O(n_{eff}^{-1})\)subjectsregularassumed default[Hall1992]
jackknifeasymptotic\(O(n_{eff}^{-1})\)subjectsregularassumed default[ShaoTu1995]
bootstrapasymptotic\(O(n_{eff}^{-1})\)subjectsregularassumed default[Hall1992]
bayes_bootasymptotic\(O(n_{eff}^{-1})\)subjectsregularassumed default[Rubin1981], [Lo1987]
rand_bootstrapasymptotic\(O(n_{eff}^{-1})\)subjectsregularassumed default[Hall1992], [Kallus2018]

The point estimate is unbiased under randomization (theory: [Neyman1923], [ImbensRubin2015]).

Rows with basis assumed default: the order shown is the procedure's rate in a regular parametric model, and the cited works establish it for that case only. EDI has not derived it for this class.

Design-specific differences from the table:

  • On any design with unequal allocation (prob_T not 0.5), for wald, jackknife, bootstrap, bayes_boot, rand_bootstrap: the effective n is the size of the smaller arm.

  • On DesignFixedBinaryMatch, DesignFixedBlocking, DesignFixedGreedy, DesignFixedGreedyDOptimal, DesignFixedMatchingGreedyPairSwitching, DesignFixedOptimal, DesignFixedOptimalBlocks, DesignFixedRerandomization, DesignSeqOneByOneKK14, DesignSeqOneByOneKK21, DesignSeqOneByOneKK21stepwise, DesignSeqOneByOnePocockSimon, DesignSeqOneByOneSPBR, for wald: the error order is \(O(1)\) (design mismatch; [BaiRomanoShaikh2021], [BugniCanayShaikh2018], [MaHuZhang2015], [LiDingRubin2018]).

  • On DesignFixedBlockedCluster, DesignFixedCluster, for wald, jackknife, bootstrap, bayes_boot, rand_bootstrap: the effective n is the number of clusters.

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.

[Fisher1935] Fisher, R. A. (1935). The Design of Experiments. Oliver and Boyd.

[LehmannRomano2005] Lehmann, E. L., and Romano, J. P. (2005). Testing Statistical Hypotheses (3rd ed.). Springer.

[Hall1992] Hall, P. (1992). The Bootstrap and Edgeworth Expansion. Springer.

[ShaoTu1995] Shao, J., and Tu, D. (1995). The Jackknife and Bootstrap. Springer.

[Rubin1981] Rubin, D. B. (1981). "The Bayesian Bootstrap." The Annals of Statistics, 9(1), 130-134.

[Lo1987] Lo, A. Y. (1987). "A Large Sample Study of the Bayesian Bootstrap." The Annals of Statistics, 15(1), 360-375.

[Kallus2018] Kallus, N. (2018). "Optimal a priori balance in the design of controlled experiments." Journal of the Royal Statistical Society: Series B, 80(1), 85-112. Section 5 ("Algorithms for inference"), Algorithm 4.

[BaiRomanoShaikh2021] Bai, Y., Romano, J. P., and Shaikh, A. M. (2021; in print 2022). "Inference in Experiments with Matched Pairs." Journal of the American Statistical Association, 117(540), 1726-1737.

[BugniCanayShaikh2018] Bugni, F. A., Canay, I. A., and Shaikh, A. M. (2018). "Inference under Covariate-Adaptive Randomization." Journal of the American Statistical Association, 113(524), 1784-1796.

[MaHuZhang2015] Ma, W., Hu, F., and Zhang, L. (2015). "Testing Hypotheses of Covariate-Adaptive Randomized Clinical Trials." Journal of the American Statistical Association, 110(510), 669-680.

[LiDingRubin2018] Li, X., Ding, P., and Rubin, D. B. (2018). "Asymptotic Theory of Rerandomization in Treatment-Control Experiments." Proceedings of the National Academy of Sciences, 115(37), 9157-9162.

[Neyman1923] Neyman, J. (1923, transl. 1990). "On the Application of Probability Theory to Agricultural Experiments." Statistical Science, 5(4), 465-472.

[ImbensRubin2015] Imbens, G. W., and Rubin, D. B. (2015). Causal Inference for Statistics, Social, and Biomedical Sciences. Cambridge University Press.

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.

model_formula

Optional covariate formula. It is accepted for interface consistency but does not change the estimate or standard error, which use only the responses and treatment assignments (no covariate adjustment). If NULL (default), the formula from the design object is used.

verbose

Whether to print progress messages.

smart_cold_start_default

Whether to use smart cold start values.


InferenceAllSimpleMeanDiffPooledVar$compute_asymp_confidence_interval()

Usage

InferenceAllSimpleMeanDiffPooledVar$compute_asymp_confidence_interval(
  alpha = 0.05
)

Arguments

alpha

Significance level; the interval has confidence level 1 - alpha. Default 0.05.


InferenceAllSimpleMeanDiffPooledVar$compute_asymp_two_sided_pval()

Usage

InferenceAllSimpleMeanDiffPooledVar$compute_asymp_two_sided_pval(delta = 0)

Arguments

delta

Null treatment effect value.


InferenceAllSimpleMeanDiffPooledVar$compute_estimate_with_bootstrap_weights()

Recomputes the pooled-variance difference in means and its pooled (equal-variance) standard error under bootstrap weights, so bootstrap and studentized intervals use the same variance convention as the asymptotic methods; see InferenceBayesianBootstrap.

Usage

InferenceAllSimpleMeanDiffPooledVar$compute_estimate_with_bootstrap_weights(
  subject_or_block_weights,
  estimate_only = FALSE
)

Arguments

subject_or_block_weights

Bootstrap weights at the subject or block level.

estimate_only

If TRUE, skip variance calculations.


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

set.seed(1)
seq_des = DesignSeqOneByOneBernoulli$new(n = 20, response_type = 'continuous')
for (i in 1:20) {
  seq_des$add_one_subject_to_experiment_and_assign(data.frame(x1 = rnorm(1)))
}
seq_des$add_all_subject_responses(rnorm(20))
inf = InferenceAllSimpleMeanDiffPooledVar$new(seq_des)
inf$compute_estimate()
#> [1] -0.3011212
inf$compute_asymp_confidence_interval()
#>       2.5%      97.5% 
#> -0.9515388  0.3492964 
inf$compute_asymp_two_sided_pval()
#> [1] 0.3436151