Statistical Inference Tests

Two-Sample T-Test for Statistical Comparison | Lattice

A two-sample t-test determines if the difference between the averages of two groups is real or just due to random chance. You use this when you want to compare a specific numeric measurement across two distinct sets of data, such as comparing the performance of two different marketing campaigns.

Comparing Two Groups

The two-sample t-test is the standard method for evaluating whether two sets of data are fundamentally different. By calculating the difference between group averages and accounting for the spread of the data, the tool provides a clear answer regarding whether your findings are consistent or coincidental.

Lattice supports three distinct test types: independent samples for comparing different items, Welch's test for groups with unequal variance, and paired tests for tracking the same subjects over two different time points or conditions.

Interpreting the Results

Every analysis returns the raw t-statistic, p-value, and degrees of freedom. We provide these values directly from the computation, ensuring you have the precise figures needed for your audit trail and reporting.

Beyond just the p-value, we include 95% confidence intervals for the mean difference. This shows the range where the true average difference likely falls, providing a practical view of the impact.

Understanding Effect Size

Statistical significance is only part of the story. To help you understand the magnitude of the difference, Lattice calculates Cohen’s d. This value is categorized into small, medium, or large based on established guidelines.

For smaller datasets, the tool reports Hedges' g as a correction to Cohen's d. This ensures that your assessment of the effect size remains accurate and is not inflated by sample size limitations.

Automated Quality Checks

Lattice handles the data integrity checks for you. If your dataset is very small, the system will provide a warning recommending non-parametric alternatives. Additionally, the tool automatically monitors for missing values, tracking how many rows were excluded to maintain the integrity of your calculation.

1 · Intent → method

An LLM picks svt_run_ttest from a fixed catalog.

2 · Method → numbers

Deterministic Python engine runs the math. Same input → same output.

3 · Numbers → plain language

A second LLM translates the result into your domain’s vocabulary.

  • How do I know if I should use a standard t-test or the Welch variant?

    You don't need to choose manually. Lattice automatically performs a test for variance. If the groups have unequal spread, the tool automatically switches to the Welch t-test to ensure your results remain accurate.

  • What does the 'effect size' tell me?

    While the p-value tells you if a difference is statistically significant, the effect size (Cohen's d) tells you if the difference is large enough to matter in the real world, classified as small, medium, or large.

Tool input schema

Schema for svt_run_ttest not exported yet (run pnpm export:registry).