Home ›
Statistics Help ›
T-Tests & ANOVA
T-Tests and ANOVA Explained: Comparing Means the Right Way
📊 Quick Answer
T-tests compare means between one or two groups. ANOVA (Analysis of Variance) compares means across three or more groups. Use a t-test when you have two groups to compare; use ANOVA when you have three or more. Both test whether differences between group means are statistically significant or just due to random chance.
📑 In This Guide
What Are T-Tests?
A t-test is a hypothesis test that determines whether there’s a statistically significant difference between means. It answers questions like: “Is the average score in Group A really different from Group B, or is the difference just random noise?”
The test produces a t-statistic and a p-value. If the p-value is below your significance level (usually 0.05), you reject the null hypothesis and conclude the difference is statistically significant.
P-values indicate the strength of evidence against the null hypothesis
T-tests are called “t-tests” because they use the t-distribution, which accounts for the extra uncertainty when working with small samples. As sample size increases, the t-distribution approaches the normal distribution.
Types of T-Tests
There are three main types of t-tests, and choosing the right one is critical for getting correct results.
One-Sample T-Test
Compares a sample mean to a known or hypothesized population value.
Example: A company claims their batteries last 500 hours. You test 30 batteries and find a mean of 485 hours. Is this significantly different from 500?
Hypotheses:
- H₀: μ = 500 (batteries last 500 hours as claimed)
- H₁: μ ≠ 500 (batteries don’t last 500 hours)
Two-Sample Independent T-Test
Compares means from two separate, unrelated groups.
Example: Does a new teaching method improve test scores? Compare scores from students taught with the new method vs. students taught with the traditional method.
Key requirement: The two groups must be independent—different people in each group with no pairing or matching.
Hypotheses:
- H₀: μ₁ = μ₂ (no difference between groups)
- H₁: μ₁ ≠ μ₂ (groups are different)
Paired T-Test (Dependent Samples)
Compares means from the same group measured twice, or from matched pairs.
Example: Measure blood pressure before and after taking a medication—same people, two measurements.
Key requirement: Each observation in one group is paired with a specific observation in the other (same person, matched subjects, or before/after design).
Hypotheses:
- H₀: μ_d = 0 (mean difference is zero)
- H₁: μ_d ≠ 0 (mean difference is not zero)
💡 Which T-Test Do I Use?
- Comparing to a known value → One-sample t-test
- Two different groups of people → Independent two-sample t-test
- Same people measured twice → Paired t-test
- Before/after design → Paired t-test
- Matched pairs → Paired t-test
One-tailed tests look for differences in a specific direction; two-tailed tests look for any difference
One-Tailed vs. Two-Tailed Tests
A two-tailed test checks for any difference (greater OR less than). A one-tailed test checks for a difference in a specific direction only.
Two-tailed: “Is there a difference?” (H₁: μ₁ ≠ μ₂)
One-tailed: “Is it greater than?” (H₁: μ₁ > μ₂) or “Is it less than?” (H₁: μ₁ < μ₂)
Most problems use two-tailed tests unless the question specifically asks about one direction. When in doubt, use two-tailed.
What Is ANOVA?
ANOVA (Analysis of Variance) extends the logic of t-tests to three or more groups. Instead of asking “Are these two means different?”, ANOVA asks “Are ANY of these means different from each other?”
ANOVA produces an F-statistic and p-value. If significant, at least one group mean differs from the others—but ANOVA doesn’t tell you which one. You need post-hoc tests for that.
One-Way ANOVA
Compares means across three or more groups based on one factor (independent variable).
Example: Compare test scores across three teaching methods (lecture, online, hybrid). One factor (teaching method) with three levels.
Hypotheses:
- H₀: μ₁ = μ₂ = μ₃ (all group means are equal)
- H₁: At least one mean is different
Two-Way ANOVA
Examines the effect of two factors simultaneously and their interaction.
Example: Does test performance depend on teaching method AND time of day? Two factors: teaching method (3 levels) and time (morning vs. afternoon).
Two-way ANOVA tests three things: main effect of Factor A, main effect of Factor B, and the interaction between A and B.
Why Not Just Run Multiple T-Tests?
With three groups, you’d need three t-tests (A vs B, A vs C, B vs C). Each test has a 5% chance of Type I error. Running multiple tests inflates your overall error rate—this is called the multiple comparisons problem.
ANOVA controls this by testing all groups simultaneously with a single test, maintaining your chosen significance level.
Type I error: rejecting a true null hypothesis. Type II error: failing to reject a false null hypothesis.
T-Test vs. ANOVA: When to Use Which
| Scenario | Test to Use |
|---|---|
| Compare sample mean to known value | One-sample t-test |
| Compare means of 2 independent groups | Independent two-sample t-test |
| Compare before/after measurements | Paired t-test |
| Compare means of 3+ independent groups | One-way ANOVA |
| Compare means across 2 factors | Two-way ANOVA |
| ANOVA is significant—which groups differ? | Post-hoc tests (Tukey, Bonferroni) |
Decision flowchart for selecting the appropriate test
Assumptions You Must Check
T-tests and ANOVA have assumptions that must be met for results to be valid. Violating these assumptions can lead to incorrect conclusions.
T-Test Assumptions
- Independence: Observations are independent of each other (except in paired tests, where pairs are independent)
- Normality: Data is approximately normally distributed (less critical with large samples due to Central Limit Theorem)
- Equal variances (for independent t-test): Both groups have similar spread. If violated, use Welch’s t-test instead.
ANOVA Assumptions
- Independence: Observations are independent within and between groups
- Normality: Data in each group is approximately normally distributed
- Homogeneity of variances: All groups have similar variances (test with Levene’s test)
⚠️ What If Assumptions Are Violated?
Non-normal data: Use non-parametric alternatives (Mann-Whitney U instead of independent t-test, Wilcoxon for paired, Kruskal-Wallis instead of ANOVA).
Unequal variances: Use Welch’s t-test or Welch’s ANOVA.
Interpreting Results
T-Test Output
A typical t-test output includes:
- t-statistic: How many standard errors the sample mean is from the hypothesized value
- Degrees of freedom (df): Related to sample size; affects the critical value
- p-value: Probability of getting results this extreme if the null hypothesis is true
- Confidence interval: Range likely to contain the true difference
Decision rule: If p-value < α (usually 0.05), reject H₀. The difference is statistically significant.
P-value decision process: compare to significance level to make your conclusion
ANOVA Output
ANOVA produces an ANOVA table with:
- Sum of Squares (SS): Between-groups and within-groups variation
- Degrees of freedom: df_between = k-1, df_within = N-k (where k = number of groups)
- Mean Square (MS): SS divided by df
- F-statistic: MS_between / MS_within
- p-value: Probability of getting this F-value if all means are equal
If ANOVA is significant: At least one group differs, but you don’t know which. Run post-hoc tests (Tukey HSD is most common) to identify specific differences.
Common Student Mistakes
❌ Mistake #1: Using independent t-test for paired data
Before/after measurements on the same people require a paired t-test. Using an independent t-test ignores the pairing and loses statistical power. Always ask: “Are these the same subjects measured twice?”
❌ Mistake #2: Running multiple t-tests instead of ANOVA
With 3+ groups, multiple t-tests inflate Type I error. If you run three t-tests at α = 0.05, your actual error rate is about 14%, not 5%. Use ANOVA to maintain the correct significance level.
❌ Mistake #3: Claiming ANOVA shows WHICH groups differ
A significant ANOVA only tells you that at least one mean differs—it doesn’t identify which one. You must run post-hoc tests (Tukey, Bonferroni, etc.) to determine specific pairwise differences.
❌ Mistake #4: Confusing statistical and practical significance
A p-value of 0.001 means the difference is unlikely due to chance—it doesn’t mean the difference matters in the real world. A drug that lowers blood pressure by 0.5 mmHg might be statistically significant with a large sample but clinically meaningless.
❌ Mistake #5: Using one-tailed test to get a lower p-value
One-tailed tests should only be used when you have a strong directional hypothesis BEFORE seeing the data. Using one-tailed tests just to achieve significance is p-hacking and scientifically dishonest.
❌ Mistake #6: Ignoring assumption violations
Running a t-test on heavily skewed data or ANOVA with very unequal variances produces unreliable results. Check assumptions first. Use non-parametric alternatives or Welch’s versions when assumptions are violated.
Platform-Specific Tips
ALEKS
ALEKS walks you through hypothesis testing step-by-step and is strict about format. Pay attention to whether it asks for a one-tailed or two-tailed test—the p-value interpretation differs. ALEKS often asks you to identify the correct test before calculating, so understand the decision rules.
MyStatLab (Pearson)
StatCrunch is integrated and handles t-tests and ANOVA well. For t-tests, make sure you select the correct type (one-sample, two-sample, paired). MyStatLab often asks for both the test statistic AND the p-value—don’t skip steps.
WebAssign
WebAssign problems often provide summary statistics rather than raw data. Use the appropriate formulas or calculator functions for summarized data. Watch rounding—WebAssign accepts answers within a tolerance, but stay close to their expected precision.
Calculator Tips (TI-83/84)
- T-Test: STAT → TESTS → T-Test (one-sample) or 2-SampTTest (independent)
- Paired t-test: Calculate differences first, then run a one-sample t-test on the differences with μ₀ = 0
- ANOVA: STAT → TESTS → ANOVA (enter lists separated by commas)
Need help with these platforms? Our tutors work with ALEKS statistics, MyStatLab, and WebAssign every day.
Frequently Asked Questions
What’s the difference between a t-test and ANOVA?
T-tests compare means between one or two groups. ANOVA compares means across three or more groups. If you have exactly two groups, use a t-test. If you have three or more groups, use ANOVA. Technically, a t-test is a special case of ANOVA—with two groups, the F-statistic equals t².
When do I use a paired t-test vs. independent t-test?
Use a paired t-test when measurements come from the same subjects (before/after), matched pairs, or repeated measures. Use an independent t-test when comparing two completely separate groups with different people in each. The key question: “Can I match each observation in Group A to a specific observation in Group B?”
My ANOVA is significant—now what?
A significant ANOVA tells you at least one group mean differs from the others, but not which one. Run post-hoc tests to identify specific differences. Tukey’s HSD is most common for comparing all pairs. Bonferroni is more conservative. Dunnett’s is used when comparing all groups to a single control group.
What if my data isn’t normally distributed?
With large samples (n > 30 per group), the Central Limit Theorem makes t-tests and ANOVA fairly robust to non-normality. For small samples with non-normal data, use non-parametric alternatives: Mann-Whitney U (instead of independent t-test), Wilcoxon signed-rank (instead of paired t-test), or Kruskal-Wallis (instead of ANOVA).
What’s Welch’s t-test and when should I use it?
Welch’s t-test is a modification of the independent t-test that doesn’t assume equal variances between groups. Use it when Levene’s test indicates unequal variances, or when sample sizes are very different between groups. Many statisticians recommend using Welch’s t-test by default since it performs well even when variances are equal.
What does “degrees of freedom” mean?
Degrees of freedom (df) represent the number of independent values that can vary in a calculation. For a one-sample t-test, df = n – 1. For an independent t-test, df = n₁ + n₂ – 2. Degrees of freedom determine which t-distribution to use—lower df means heavier tails and larger critical values.
How do I interpret effect size for t-tests?
Cohen’s d measures effect size for t-tests: d = (mean difference) / (pooled standard deviation). Guidelines: d = 0.2 is small, d = 0.5 is medium, d = 0.8 is large. Effect size tells you the magnitude of the difference, while p-value only tells you if it’s statistically significant. Both matter for interpretation.
Can you help with my t-test or ANOVA homework?
Absolutely. T-tests and ANOVA are some of the most common statistics assignments we handle. Whether you need help understanding concepts, setting up hypotheses, running the analysis, or interpreting results, our tutors work with ALEKS, MyStatLab, WebAssign, and other platforms daily. Get a free quote to get started.
Related Resources
Statistics Foundations
- Hypothesis Testing Guide
- Descriptive Statistics Explained
- Normal Distribution Guide
- Confidence Intervals Explained
Statistics Help
Need Help With T-Tests or ANOVA?
Our tutors handle hypothesis testing assignments daily—from setting up hypotheses to interpreting output and post-hoc tests.