Skip to main content
All articles

Subject explainers

How to Run and Report a t-Test (Independent and Paired)

How to Run and Report a t-Test (Independent and Paired)

Use an independent-samples t-test to compare the means of two separate groups and a paired-samples t-test to compare two measurements from the same people. Check the assumptions, run the test, then report the means and standard deviations, the t statistic with its degrees of freedom, the exact p value, a confidence interval and an effect size such as Cohen's d, for example t(48) = 2.59, p = .013, d = 0.73.

By HomeworkHero Editorial Team

Published

7 min read

A t-test asks whether the difference between two means is larger than you would expect from random sampling variation alone. It is one of the first inferential tests students meet in statistics, psychology, biology and business courses, and one of the most commonly misreported. This guide explains which t-test to use, how to check its assumptions, how to run it and how to write it up. The numbers in the examples are made up for illustration.

Which t-test should you use?

There are three common versions:

TestUse whenExample
One-sample t-testComparing one group's mean to a known valueIs the mean exam score different from the pass mark of 70?
Independent-samples t-testComparing means of two separate, unrelated groupsDo students taught with method A score differently from those taught with method B?
Paired-samples t-testComparing two measurements on the same people or matched pairsDid anxiety scores change from before to after a workshop?

The key question is whether the two sets of scores come from the same participants (or deliberately matched pairs). If yes, use a paired test. If the groups are different people, use an independent test. Using the wrong one is a common, serious error: a paired design analysed as independent usually loses power, and an independent design analysed as paired is simply invalid.

If you have three or more groups, do not run several t-tests; use ANOVA instead, because multiple tests inflate the chance of a false positive.

What are the hypotheses?

For a two-tailed independent t-test:

  • Null hypothesis (H0): the two population means are equal.
  • Alternative hypothesis (H1): the two population means are different.

Use a two-tailed test unless you specified a direction in advance for a strong reason. Choosing a one-tailed test after seeing the data is not acceptable.

What assumptions does a t-test make?

  1. The dependent variable is continuous (interval or ratio), such as a test score or reaction time.
  2. Independence of observations. Each participant contributes one score per condition, and participants do not influence each other.
  3. Approximate normality. For the independent test, scores in each group should be roughly normally distributed; for the paired test, the differences should be. Check with a histogram or Q-Q plot. With moderate samples (often cited as about 30 per group), the t-test is fairly robust to non-normality, but strong skew or outliers in small samples are a problem.
  4. Homogeneity of variance (independent test only). The groups should have similar variances. Levene's test is often used to check this.

If variances look unequal, use Welch's t-test, which does not assume equal variances. Many statisticians recommend using Welch's version by default, and some software (such as R's t.test) does so automatically. If normality is badly violated with small samples, consider a non-parametric alternative: the Mann-Whitney U test for independent groups or the Wilcoxon signed-rank test for paired data.

The NIST/SEMATECH e-Handbook of Statistical Methods gives the formulas for both the equal-variance and unequal-variance versions.

How do you run a t-test in common software?

  • SPSS: Analyze, then Compare Means, then Independent-Samples T Test (or Paired-Samples T Test). Move the outcome to the test variable box and define the two groups. SPSS reports Levene's test with results for both "equal variances assumed" and "not assumed"; read the row that matches your decision.
  • R: t.test(score ~ group, data = df) runs Welch's test by default; add var.equal = TRUE for the Student version, or use paired = TRUE with two paired vectors.
  • Python (SciPy): scipy.stats.ttest_ind(a, b, equal_var=False) for Welch's independent test and scipy.stats.ttest_rel(before, after) for paired data. The SciPy documentation lists all options.
  • Excel: the T.TEST function returns only the p value; the Data Analysis ToolPak gives the full output.

How do you interpret the output?

You need four things from the output:

  • t statistic: the difference in means divided by its standard error. Larger absolute values mean the difference is large relative to the variability.
  • Degrees of freedom (df): for a Student independent test, n1 + n2 - 2; for a paired test, the number of pairs minus 1; Welch's test gives a decimal df.
  • p value: the probability of a difference at least this large if the null hypothesis were true. If p is below your alpha (usually .05), the difference is statistically significant.
  • Confidence interval for the difference: the range of plausible values for the true difference. If a 95% interval excludes zero, the result is significant at .05.

A p value does not tell you how big or important the difference is. That is what the effect size is for.

How do you calculate the effect size?

The usual effect size for a t-test is Cohen's d: the difference in means divided by a standard deviation (the pooled SD for independent groups). Cohen's conventional benchmarks are roughly 0.2 small, 0.5 medium and 0.8 large, but what counts as meaningful depends on the field. For paired designs, report which version of d you used, for example d based on the SD of the difference scores (often written as d with a subscript z).

How do you report an independent-samples t-test in APA style?

Suppose 50 students were randomly assigned to two study methods. The retrieval-practice group (n = 25) scored M = 78.4, SD = 8.2 on the final quiz; the re-reading group (n = 25) scored M = 72.1, SD = 9.0. A Student's t-test gives t(48) = 2.59, p = .013, with a mean difference of 6.3 points, 95% CI [1.40, 11.20], and d = 0.73.

A write-up:

Students in the retrieval-practice condition (M = 78.4, SD = 8.2) scored higher on the final quiz than students in the re-reading condition (M = 72.1, SD = 9.0). An independent-samples t-test showed that this difference was statistically significant, t(48) = 2.59, p = .013, 95% CI [1.40, 11.20], d = 0.73.

APA conventions to follow, from the APA's numbers and statistics guide and Purdue OWL's summary of APA numbers and statistics:

  • Italicise statistical symbols such as t, p, M, SD and d.
  • Report exact p values to two or three decimals (p = .013), except below .001, which is written p < .001.
  • Do not put a leading zero before values that cannot exceed 1, such as p (write .013, not 0.013).
  • Put degrees of freedom in parentheses after t.
  • Report descriptive statistics alongside the test.

How do you report a paired-samples t-test?

Suppose 20 students completed an anxiety questionnaire before and after a study-skills workshop. Scores fell from M = 24.6 (SD = 7.0) to M = 20.3 (SD = 6.4). The mean difference was 4.3 (SD of differences = 6.1).

Anxiety scores were lower after the workshop (M = 20.3, SD = 6.4) than before it (M = 24.6, SD = 7.0). A paired-samples t-test showed that the mean decrease of 4.3 points was statistically significant, t(19) = 3.15, p = .005, 95% CI [1.45, 7.15], d = 0.70, calculated from the standard deviation of the difference scores.

Note the limitation: without a control group, this design cannot show that the workshop caused the drop.

How do you report a non-significant result?

Report it in full, with the same statistics. Do not write "there was no difference", because failing to reject the null hypothesis is not evidence that the means are equal. For example: "Scores did not differ significantly between the two groups, t(48) = 1.12, p = .268, d = 0.32." Then discuss the effect size and whether the study had enough power to detect a meaningful difference.

What are the most common t-test mistakes?

  • Using an independent test on paired data, or the reverse.
  • Running many t-tests instead of ANOVA.
  • Reporting "p = .000" from software output (write p < .001).
  • Reporting only the p value without means, SDs or effect size.
  • Saying a result is "highly significant" or "proves" a hypothesis.
  • Ignoring unequal variances or extreme outliers.
  • Treating a non-significant result as proof of no difference.

If your assignment moves on to predicting outcomes from several variables, see our guide on how to interpret regression output.

Where can you get help with a t-test?

If you are unsure which test fits your design or how to read your software output, a statistics tutor can walk through your data with you. On HomeworkHero, posting a question is free: tutors who cover statistics send offers with their own price, you choose one, and messaging opens once you do. Payment is held in escrow until you approve the work. See statistics assignment help, or browse psychology tutors for research methods courses. Use worked examples to understand the method and do your own analysis, and follow your institution's academic integrity policy.

How much will my statistics assignment cost?

A guide price from our pricing rules. Tutors confirm the final price in their offers, and you pay into escrow only when you choose one.

Guide price: $62.40

Get my exact quote

No posting fee. Free to sign up. Payment is held in escrow until you approve the work.

Frequently asked questions

What sample size do I need for a t-test?

There is no single minimum, but small samples have low power to detect real differences. Run a power analysis before collecting data, based on the smallest effect size you care about.

What is the difference between Student's t-test and Welch's t-test?

Student's independent t-test assumes the two groups have equal variances, while Welch's test does not and adjusts the degrees of freedom. Welch's test performs well even when variances are equal, so many analysts use it by default.

Can I use a t-test on Likert scale data?

For a single Likert item, many statisticians prefer non-parametric tests because the data are ordinal. For a scale score summed or averaged from several items, a t-test is commonly used, but check your course's guidance.

What does a negative t value mean?

It only means the first group's mean is lower than the second's, given the order the software used. Report the direction in words and the absolute value or sign consistently.

Should I use a one-tailed or two-tailed t-test?

Use a two-tailed test unless you had a strong, pre-specified reason to predict a direction. Switching to one-tailed after seeing the results is not legitimate.

Sources

  1. Two-Sample t-Test for Equal Means (NIST/SEMATECH e-Handbook of Statistical Methods)
  2. Numbers and Statistics Guide (American Psychological Association (APA Style))
  3. Numbers and Statistics (APA) (Purdue OWL)
  4. scipy.stats.ttest_ind (SciPy documentation)

Tags

  • statistics
  • t-test
  • hypothesis testing
  • apa style
  • spss

Get help with your next question.

Post your question with no posting fee, compare offers from tutors who know the subject, and choose who to work with.