What Is a T-Test? A Simple Guide to Three Tests in SPSS
Choose a one-sample, independent or paired t-test in SPSS. Follow practice data and screenshots, interpret confidence intervals and report the comparison.
Published

A t-test is a statistical method for assessing whether a difference involving means is large relative to the variability and uncertainty in the data. Researchers use a one-sample t-test to compare a group mean with a reference value, an independent-samples t-test to compare two unrelated groups, and a paired-samples t-test to compare linked measurements such as before-and-after scores. Choosing the correct test in SPSS depends on how the observations were collected and what comparison the research question asks.
Why use a test at all? Because averages vary from sample to sample. Two groups can have different averages even when there is no difference between the populations they represent. A t-test considers the observed difference alongside the uncertainty in that estimate. It helps you assess the evidence against a starting assumption of no population difference.
You do not need to memorise a formula to follow this guide. First, understand what you are comparing. Then choose the matching SPSS procedure. For an overall comparison of three or more independent groups, follow the one-way ANOVA walkthrough.
One simple example: students taking a quiz
Imagine 24 students taking a quiz, spending some time revising, and taking another quiz on the same 0–100 scale. Twelve attend a teacher-led revision session, called Workshop in our data. Twelve different students revise on their own, called Self-study.
We record each student's score before and after revision. Now we can ask three questions: Does the average before revision differ from a target of 70? Do the two groups have different averages after revision? Do the same students' scores change from before to after?
These are simulated practice data, created to teach the procedures. They are not findings about real students. The screenshots and downloads all use these same 24 students, so you can follow along.
| What are you comparing? | Simple question | Use this test |
|---|---|---|
| One group's average and a fixed number | Is our average different from 70? | One-sample t-test |
| Two groups of different students | Does Workshop differ from Self-study? | Independent-samples t-test |
| The same students measured twice | Did scores change from before to after? | Paired-samples t-test |

The distinction to remember is different people versus the same people. Two unrelated groups give you an independent comparison. Each student's before score linked to their own after score gives you a paired comparison. Equal numbers in two groups do not make them paired. NIST explains the distinction between paired and unpaired data.
Open the practice data in SPSS
Download the SPSS practice bundle and open t-test-practice.sav. It includes the data, the commands used to create them, and the actual SPSS output. If you run the commands yourself, change their save paths to a folder on your computer first.
Download the practice CSV · Download the SPSS practice bundle: data, commands and output
Each row represents one student. pre_score means “before revision” and post_score means “after revision”. The variable group tells SPSS which revision group a student belongs to: 1 = Workshop; 2 = Self-study. The ID identifies the student; it is not a quiz score.

The SPSS file also contains change, calculated as after minus before. The first student scored 60 before revision and 72 afterwards: 72 − 60 = 12 points of improvement. The second student went from 70 to 78, an improvement of 8 points. This is the calculation behind the paired test.
If entering the data yourself, set group to Nominal in Variable View because it identifies categories, and set the scores to Scale because they are quantities. Make sure SPSS is analysing all cases without weights or split-file settings from another task.
1. One-sample t-test: compare an average with a target
Suppose the teacher sets 70 as a target average. We want to know whether the average before revision differs from that target. We have one set of scores and one fixed comparison number, so we use a one-sample t-test. Here, 70 is an invented teaching target, not a published educational standard.
The average before revision is 71.58. SPSS calls an average the mean, so “mean score” and “average score” mean the same thing here. The observed difference is 71.58 − 70 = 1.58 points. The test asks whether the data provide sufficient evidence that the wider population's average differs from 70.
Our starting assumption is that the population average equals 70. This is called the null hypothesis. We use a two-sided test, which allows a difference above or below 70. Kent State's one-sample guide explains this comparison.
How to run it in SPSS
- Choose Analyze > Compare Means > One-Sample T Test.
- Move Score before revision [pre_score] into Test Variable(s).
- Enter 70 in Test Value.
- Leave Estimate effect sizes selected. Under Options, keep the 95% confidence interval and click Continue.
- Click OK.


Start with Mean = 71.58 in the first table. Then find Sig. (2-tailed) = .175 in the second table. This is the p-value. We use .05 as our decision threshold throughout this exercise, chosen before interpreting the results. Because .175 is above .05, we do not reject the starting assumption.
In everyday language, the sample average is slightly above 70, but these data do not give sufficient evidence of a population difference at the .05 level. This does not prove that the population average is exactly 70. “We did not find clear evidence of a difference” is more accurate than “there is no difference.”
A simple results paragraph: “The average score before revision was 71.58. A one-sample t-test did not find a statistically significant difference from the target of 70, t(23) = 1.40, p = .175. The estimated difference was 1.58 points, with a 95% confidence interval from −0.76 to 3.93.”
2. Independent-samples t-test: compare two different groups
Now set aside the target of 70. We want to compare the Workshop and Self-study groups' averages after revision. The students in one group are different from the students in the other. That is why we use an independent-samples t-test.
The Workshop average is 79.58 and the Self-study average is 72.50. Their difference is 7.08 points. You can describe that difference without a test. The test adds an assessment of whether the data provide evidence of a population difference, taking account of variation in scores. Kent State's independent-samples guide explains the data arrangement.
How to run it in SPSS
- Choose Analyze > Compare Means > Independent-Samples T Test.
- Move Score after revision [post_score] into Test Variable(s).
- Move Revision method [group] into Grouping Variable using its separate arrow.
- Click Define Groups. Enter 1 for Group 1 and 2 for Group 2, then click Continue.
- Leave Estimate effect sizes selected, keep the 95% confidence interval under Options, and click OK.



The Group Statistics table shows the averages and confirms that there are twelve students per group. In Independent Samples Test, SPSS gives you two rows. Use Equal variances not assumed for this tutorial. This is Welch's t-test, a version that allows the groups to have different amounts of spread in their scores.
Welch's test is a reasonable choice to plan before seeing the results. You do not need to select it only when Levene's test is significant. Delacre and colleagues discuss this approach, with qualifications in their correction. Take t, df, p and the confidence limits from the same row.
In that row, Sig. (2-tailed) = .002. Since .002 is below .05, the result is statistically significant at our chosen threshold. The Workshop average is 7.08 points higher, with a 95% confidence interval from 2.89 to 11.28 points. Explain the size and direction of the difference as well as the p-value.
A simple results paragraph: “Students in the Workshop group scored 79.58 on average, compared with 72.50 in the Self-study group. A Welch independent-samples t-test found a statistically significant difference, t(21.84) = 3.50, p = .002. The Workshop average was 7.08 points higher, with a 95% confidence interval from 2.89 to 11.28.”
This result alone does not prove that the workshop caused higher scores. For example, the groups might have differed before revision. The test compares their final averages; a study designed to explain why they differ needs to address other possible explanations.
3. Paired-samples t-test: compare the same students twice
Our third question is whether the same students' scores changed from before to after revision. Think of the first student's increase from 60 to 72. We calculate a change for every student, then examine the average of those changes. That is the idea behind a paired-samples t-test.
The before score for Student 1 must be linked to the after score for Student 1. Keeping the correct scores together preserves the pairing. NIST explains how paired comparisons use these linked observations.
For this exercise, we include all 24 students together. We are asking about their overall average change. We are not asking whether Workshop students improved more than Self-study students; that is a different comparison.
How to run it in SPSS
- Choose Analyze > Compare Means > Paired-Samples T Test.
- Put post_score in Variable1 and pre_score in Variable2 on the same pair row, using the selection and transfer arrow.
- Check the order: after first, before second. This tells SPSS to calculate after minus before.
- Leave Estimate effect sizes selected, with Standard deviation of the difference as the standardizer. Keep the 95% confidence interval under Options.
- Click OK.


The average before revision was 71.58, and the average afterwards was 76.04. The average increase, calculated using the unrounded values, was 4.46 points. In Paired Samples Test, the p-value is less than .001. This is below .05, giving evidence of an average population change under the test's assumptions.
SPSS also shows Paired Samples Correlations. That table concerns whether students with higher before scores also tend to have higher after scores. It does not test the average improvement. For our question, use Paired Samples Test. Kent State's paired-samples guide explains these tables. The Pearson and Spearman correlation guide explains how to read the direction and size of an association.
A simple results paragraph: “The students' average score increased from 71.58 before revision to 76.04 afterwards. A paired-samples t-test found a statistically significant average increase of 4.46 points, t(23) = 5.62, p < .001. The 95% confidence interval for the average increase was 2.82 to 6.10 points.”
This describes change across the combined group. It does not establish its cause. Other learning, familiarity with the quiz or the passage of time could also matter. Keep your conclusion tied to the comparison you tested.
What do the other numbers mean?
N is the number of students included in the analysis. SD, short for standard deviation, describes how spread out their scores are. A group with a larger SD has more variation in its scores. Neither number, by itself, tells you whether a difference is statistically significant.
The t value expresses the estimated difference relative to its standard error. The standard error describes uncertainty in the estimate across repeated samples. df means degrees of freedom, a value used to calculate the p-value. You can take t and df from the correct SPSS row when writing your report.
A p-value is the probability of a test result at least as extreme as the observed result, assuming the null hypothesis and the other model assumptions. In these examples, we consider what we would expect if there were no population difference. It is not the probability that the null hypothesis is true. The American Statistical Association explains this distinction. Statistical significance also does not automatically mean practical importance; consider what a difference of several quiz points means.
A 95% confidence interval shows uncertainty around the estimated population difference. Our independent comparison estimates 7.08 points, with an interval from 2.89 to 11.28. The interval helps you judge the estimate's precision. More formally, the method would produce intervals containing the true difference about 95% of the time over repeated samples, under its assumptions. It is not an interval containing 95% of individual scores. NIST explains this repeated-sampling meaning.
An effect size describes the difference on a standardised scale rather than in quiz points. The supplied output includes Cohen's d. The paired version here uses the spread of the individual changes and is often written d_z. For a first reading, understand the difference in points and its confidence interval before moving to that table.
Before using a t-test in your own study
Check that the test matches your study design. For an independent comparison, observations should be unrelated. For a paired comparison, measurements within each pair are linked, while the pairs should be independent of one another. A t-test cannot correct a study design that ignores these relationships.
Inspect the data for errors, unusually extreme values and strong skewness, particularly with small samples. In SPSS, Analyze > Descriptive Statistics > Explore offers boxplots and normality plots. Examine pre_score for the one-sample test, post_score within each group for the independent test, and change for the paired test. For the paired test, normality concerns the changes.
Check the number of cases SPSS analysed. A student needs both scores to contribute to the paired test. Do not enter zero to represent a missing score. These practice data have no missing values, so all 24 students contribute to the paired comparison.
Finally, choose your question and decision threshold before examining the results. These three analyses teach different comparisons; they are not a reason to try many tests until one is significant. If your actual study tests several related hypotheses, plan how you will handle that set of tests.
Try choosing the test yourself
A class has one final score per student, and you want to compare its average with a fixed target of 70: choose a one-sample t-test. You compare final scores from two unrelated classes: choose an independent-samples t-test. You measure each student's score before and after revision: choose a paired-samples t-test.
Before opening SPSS, finish this sentence: “I want to compare ___ with ___.” Then identify whether the scores come from different students or the same students. A clear comparison gives you the starting point for both your analysis and your results paragraph.
Frequently asked questions
Do equal group sizes make a test paired?
No. Pairing depends on a meaningful one-to-one link, such as two measurements from the same person or a justified matched design. Two unrelated groups can have equal sample sizes and still require an independent-samples analysis.
When should I read the equal variances not assumed row?
That row reports the Welch comparison, which accommodates unequal population variances and may have non-integer degrees of freedom. Follow a justified analysis plan and assess the design and data; equal group sizes alone do not establish equal variances.
What should I report beyond the p-value?
Identify the test and comparison, give the relevant sample sizes and descriptive statistics, and report the mean difference, confidence interval, test statistic and degrees of freedom. Explain the direction of subtraction and include an appropriate effect size when required.
For three or more independent groups, see one-way ANOVA. For a group comparison adjusted for baseline, see ANCOVA in SPSS. A correlation answers a different question about association.




Discussion