Student's t-test
The Student's t-test compares the means of two independent groups to see whether they differ statistically. Typical use: comparing average blood pressure between a drug group and a placebo group.
Step 1 — Choose data input type
The calculator opens with a Data Input Type selector with two big buttons:
| Option | What it means |
|---|---|
| Raw Data — "Individual measurements" | You have the original observation values for each group |
| Summary Data — "Mean, SD, sample size" | You only have the published summary statistics |
The choice matters: Raw Data mode runs additional checks that Summary Data mode cannot (see Step 6).
Step 2 — Load or enter your data
For Raw Data mode you have three options:
- Excel Import — upload an
.xlsx/.xls/.csvfile. The importer reads sheets and lets you pick the group variable and the dependent variable. - Sample Data Generator — pick one of five built-in clinical scenarios: Diagnostic Biomarker Study, Treatment Response Study, and three more. Each scenario generates a complete dataset (e.g. PSA / CEA / CA-125 levels comparing cancer patients vs. healthy controls).
- Manual entry — type or paste values directly into the Group 1 and Group 2 text areas. You can rename the groups (e.g. "Treatment" and "Placebo").
For Summary Data mode you fill in six fields — Mean, Standard Deviation, and Sample Size for each of Group 1 and Group 2.
Step 3 — Set the assumption switch
A toggle labelled "Assume equal variances" controls which version of the t-test is run:
- On (default) → standard pooled-variance t-test
- Off → Welch's t-test for unequal variances
Step 4 — Calculate
Click the CALCULATE button. If anything is wrong with your input, an error appears explaining what to fix. Common validation messages:
| Message | Cause |
|---|---|
| "Please fill in all fields" | A field is blank |
| "<Field> must be a valid number" | Non-numeric input |
| "Sample size must be at least 2 for both groups" | n is less than 2 |
| "Both groups have zero variance (all values are identical)..." | All values in both groups are the same |
| "<Group> has zero variance..." | One group has no variability |
If raw data fields are empty, the system also shows a clear alert before submitting:
"Please enter data in both Group 1 and Group 2 fields before calculating."
Step 5 — Read the results
A Test Results panel appears with cards for:
- Sample 1 / Sample 2 statistics — mean, SD, sample size for each group
- t-value
- Degrees of freedom
- p-value
- Effect Size (Cohen's d) — to 4 decimal places, with an interpretation label
A Hypothesis Testing block formally states:
| Element | What it shows |
|---|---|
| Analysis Information | Variable analysed, group labels |
| Null Hypothesis (H₀) | "There is no significant difference between the means of <Group 1> and <Group 2>." Formal notation: H₀: μ₁ = μ₂ |
| Alternative Hypothesis (H₁) | "There is a significant difference between the means..." Formal notation: H₁: μ₁ ≠ μ₂ (two-tailed) |
| Statistical Decision | α = 0.05, observed p-value, decision rule ("p ≤ α → Reject H₀" or "p > α → Fail to reject H₀") |
| Conclusion | Plain-language conclusion at the 5% significance level |
| Practical Interpretation | Translates Cohen's d into practical language |
| Type I and Type II error risks | Type I = 5% (when H₀ is rejected); Type II risk is reported as (1 − power) × 100% from the power analysis |
Step 6 — Raw Data Analysis enhancements
When you used Raw Data input, the results panel includes extra blocks that Summary Data mode cannot produce:
- Raw Data Analysis Advantages — six benefits enabled: Assumption Testing Available, Outlier Detection Available, Detailed Distribution Analysis, Enhanced Statistical Inference, More Reliable Results, Comprehensive Data Quality Checks
- Detailed Data Summary — quartiles, skewness, range
- Outlier Analysis — number of detected outliers per group, with a button to expand the full outlier list
- Assumption Tests — normality and equal-variances checks
- Power Analysis — achieved statistical power and recommendations
If unusual data conditions are detected, the results panel shows warnings:
- Zero Variance Detected — if either group has identical values
- Identical Group Means Detected — if both group means are nearly identical (notes this is a valid no-difference result)
Step 7 — Export and discuss
- DOWNLOAD AS PDF — exports the full results to a PDF file for your records or supplementary materials.
- UniversalChatBot — at the bottom, lets you discuss the test, ask about effect size, or get help writing up the result.
Statistical methods used
Test statistic
Two versions are supported, controlled by the "Assume equal variances" toggle:
| Variant | When used | Formula |
|---|---|---|
| Pooled-variance (Student's) t-test | Toggle ON (default) | t = (x̄₁ − x̄₂) / √(s²ₚ × (1/n₁ + 1/n₂)), where s²ₚ is the pooled variance and df = n₁ + n₂ − 2 |
| Welch's t-test | Toggle OFF — for unequal variances | t = (x̄₁ − x̄₂) / √(s₁²/n₁ + s₂²/n₂), with Welch-Satterthwaite degrees of freedom |
Hypothesis statement
- H₀: μ₁ = μ₂ (no difference between population means)
- H₁: μ₁ ≠ μ₂ (two-tailed test for difference)
- Significance level: α = 0.05
Effect size — Cohen's d
Computed as |x̄₁ − x̄₂| / s_pooled (always reported as an absolute value). Interpretation follows the standard Cohen (1988) convention:
| |Cohen's d| | Label |
|---|---|
| < 0.001 | No effect (identical means) |
| 0.001 – 0.20 | Very small effect |
| 0.20 – 0.50 | Small effect |
| 0.50 – 0.80 | Medium effect |
| ≥ 0.80 | Large effect |
Assumption tests (Raw Data mode only)
When you provide raw observations, the calculator automatically runs:
| Assumption | Test method | How it is judged |
|---|---|---|
| Normality of Group 1 | Shapiro-Wilk test + Kolmogorov-Smirnov test (with Lilliefors correction) | If both p-values > 0.05 → normal |
| Normality of Group 2 | Same as Group 1 | Same as Group 1 |
| Equal variances | Levene's test on the absolute deviations from each group's mean | Equal variances assumed if p > 0.05 |
Outlier detection (Raw Data mode only)
Three methods are run in parallel:
| Method | Outlier criterion | Severity tiers |
|---|---|---|
| Z-Score | |Z| > 2.5 from the mean | Mild (Z > 2.5), Moderate (Z > 3.0), Extreme (Z > 3.5) |
| IQR (Tukey) | Outside Q1 − 1.5×IQR to Q3 + 1.5×IQR | Mild beyond 1.5×IQR fence; Extreme beyond 3.0×IQR fence |
| Modified Z-Score (MAD-based) | Robust alternative based on median absolute deviation | Mild / Moderate / Extreme — robust to extreme values |
Power analysis (Raw Data mode only)
The power analysis uses the non-central t-distribution approximation. It reports your achieved (current) power and the sample size required for 80% power at the observed effect size. The achieved power is then labelled:
| Achieved power | Label |
|---|---|
≥ 0.80 |
Adequate power |
0.60 – 0.80 |
Moderate power |
0.40 – 0.60 |
Low power |
< 0.40 |
Very low power |