Skip to content
Technical & algorithm documentationSource reviewed

Group comparisons and categorical inference

Technical guide to Student and Welch t tests, paired t tests, conventional and Welch ANOVA, chi-square and Fisher exact tests.

Overview

Survlytics provides explicit two-sided tests and procedure-specific effect sizes rather than one generic comparison routine.

Theoretical foundation

t statistics standardise mean differences by estimated sampling error. ANOVA partitions variation or uses Welch weighting. Pearson chi-square compares observed and expected counts; Fisher exact enumerates 2 × 2 table probabilities conditional on margins.

Key equations

Welch mean difference statistic
t=\frac{\bar{x}_1-\bar{x}_2}{\sqrt{s_1^2/n_1+s_2^2/n_2}}

Algorithm and computation

SciPy supplies t and exact distributions. Student’s test pools variances; Welch uses Satterthwaite degrees of freedom. Paired tests operate on complete differences. Conventional ANOVA reports eta² and omega²; Welch ANOVA is calculated from inverse-variance group weights. Chi-square has no continuity correction; sparse 2 × 2 tables can automatically use two-sided Fisher exact inference.

Required data

Numeric outcomes and valid groups for t/ANOVA; paired numeric measurements for paired t; two categorical variables for chi-square/Fisher.

Assumptions

Independence follows the design. Conventional tests require suitable residual distributions; Student/standard ANOVA also require equal variances. Fisher exact is limited to 2 × 2 tables.

Available settings

Student or Welch; conventional or Welch ANOVA; automatic, chi-square or Fisher categorical method; confidence level.

Worked example

A synthetic two-group comparison reports the mean difference, Welch degrees of freedom, 95% interval, Cohen d and Hedges g.

Limitations and non-claims

No repeated-measures ANOVA, nonparametric group tests, post-hoc pairwise procedure, survey weighting or multiplicity correction is implemented.

Validation notes

Formula-level outputs and edge cases are covered by repository numerical tests.

How Surv.lytics computes Categorical inference
EstimatorPearson chi-square or 2 × 2 Fisher exact
LibrariesSciPy 1.17.0
Missing dataComplete category pairs
ValidationImplemented and covered by tests
Defaults{'method': 'auto'}
Open full technical documentation
How Surv.lytics computes Independent t test
EstimatorStudent or Welch two-sample test
LibrariesSciPy 1.17.0
Missing dataProcedure-complete cases
ValidationImplemented and covered by tests
Defaults{'method': 'welch'}
Open full technical documentation
How Surv.lytics computes One-way ANOVA
EstimatorConventional or Welch one-way ANOVA
LibrariesNumPy 2.4.2; SciPy 1.17.0
Missing dataProcedure-complete cases
ValidationImplemented and covered by tests
Defaults{'method': 'welch'}
Open full technical documentation
How Surv.lytics computes Paired t test
EstimatorPaired-difference t test
LibrariesSciPy 1.17.0
Missing dataComplete pairs
ValidationImplemented and covered by tests
Defaults{}
Open full technical documentation

Was this article helpful?

Your response helps the methodology team improve this documentation.