User Preferences

Content preview.

Arcu felis bibendum ut tristique et egestas quis:

  • Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
  • Duis aute irure dolor in reprehenderit in voluptate
  • Excepteur sint occaecat cupidatat non proident

Keyboard Shortcuts

10.3 - paired t-test.

In the next lesson, we'll learn how to compare the means of two independent populations, but there may be occasions in which we are interested in comparing the means of two dependent populations. For example, suppose a researcher is interested in determining whether the mean IQ of the population of first-born twins differs from the mean IQ of the population of second-born twins. She identifies a random sample of \(n\) pairs of twins, and measures \(X\), the IQ of the first-born twin, and \(Y\), the IQ of the second-born twin. In that case, she's interested in determining whether:

\(\mu_X=\mu_Y\)

or equivalently if:

\(\mu_X-\mu_Y=0\)

Now, the population of first-born twins is not independent of the population of second-born twins. Since all of our distributional theory requires the independence of measurements, we're rather stuck. There's a way out though... we can "remove" the dependence between \(X\) and \(Y\) by subtracting the two measurements \(X_i\) and \(Y_i\) for each pair of twins \(i\), that is, by considering the independent measurements

\(D_i=X_i-Y_i\)

Then, our null hypothesis involves just a single mean, which we'll denote \(\mu_D\), the mean of the differences:

\(H_0=\mu_D=\mu_X-\mu_Y=0\)

and then our hard work is done! We can just use the \(t\)-test for a mean for conducting the hypothesis test... it's just that, in this situation, our measurements are differences \(d_i\) whose mean is \(\bar{d}\) and standard deviation is \(s_D\). That is, when testing the null hypothesis \(H_0:\mu_D=\mu_0\) against any of the alternative hypotheses \(H_A:\mu_D \neq \mu_0\), \(H_A:\mu_D<\mu_0\), and \(H_A:\mu_D>\mu_0\), we compare the test statistic:

\(t=\dfrac{\bar{d}-\mu_0}{s_D/\sqrt{n}}\)

to a \(t\)-distribution with \(n-1\) degrees of freedom. Let's take a look at an example!

Example 10-3 Section  

blood in tubes

Blood samples from \(n=10\) = 10 people were sent to each of two laboratories (Lab 1 and Lab 2) for cholesterol determinations. The resulting data are summarized here:

Is there a statistically significant difference at the \(\alpha=0.01\) level, say, in the (population) mean cholesterol levels reported by Lab 1 and Lab 2?

The null hypothesis is \(H_0:\mu_D=0\), and the alternative hypothesis is \(H_A:\mu_D\ne 0\). The value of the test statistic is:

\(t=\dfrac{-14.4-0}{6.77/\sqrt{10}}=-6.73\)

The critical region approach tells us to reject the null hypothesis at the \(\alpha=0.01\) level if \(t>t_{0.005, 9}=3.25\) or if \(t<t_{0.005, 9}=-3.25\). Therefore, we reject the null hypothesis because \(t=-6.73<-3.25\), and therefore falls in the rejection region.

Again, we draw the same conclusion when using the \(p\)-value approach. In this case, the \(p\)-value is:

\(p-\text{value }=2\times P(T_9<-6.73)\le 2\times 0.005=0.01\)

As expected, we reject the null hypothesis because \(p\)-value \(\le 0.01=\alpha\).

And, the Minitab output for this example looks like this:

SPSS tutorials website header logo

SPSS Paired Samples T-Test Tutorial

A paired samples t-test examines if 2 variables are likely to have equal population means.

Paired Samples T-Test Assumptions

Spss paired samples t-test dialogs, paired samples t-test output, effect size - cohen’s d, testing the normality assumption.

A teacher developed 3 exams for the same course. He needs to know if they're equally difficult so he asks his students to complete all 3 exams in random order. Only 19 students volunteer. Their data -partly shown below- are in compare-exams.sav . They hold the number of correct answers for each student on all 3 exams.

Paired Samples T-Test Example Data

Null Hypothesis

Generally, the null hypothesis for a paired samples t-test is that 2 variables have equal population means. Now, we don't have data on the entire student population. We only have a sample of N = 19 students and sample outcomes tend to differ from population outcomes. So even if the population means are really equal, our sample means may differ a bit. However, very different sample means are unlikely and thus suggest that the population means aren't equal after all. So are the sample means different enough to draw this conclusion? We'll answer just that by running a paired samples t-test on each pair of exams. However, this test requires some assumptions so let's look into those first.

Technically, a paired samples t-test is equivalent to a one sample t-test on difference scores. It therefore requires the same 2 assumptions. These are

  • independent observations ;
  • normality : the difference scores must be normally distributed in the population. Normality is only needed for small sample sizes, say N < 25 or so.

Our exam data probably hold independent observations: each case holds a separate student who didn't interact with the other students while completing the exams. Since we've only N = 19 students, we do require the normality assumption. The only way to look into this is actually computing the difference scores between each pair of examns as new variables in our data. We'll do so later on.

At this point, you should carefully inspect your data. At the very least, run some histograms over the outcome variables and see if these look plausible. If necessary, set and count missing values for each variable as well. If all is good, proceed with the actual tests as shown below.

SPSS Menu Arrow

Paired Samples T-Test Syntax

SPSS creates 3 output tables when running the test. The last one - Paired Samples Test - shows the actual test results.

SPSS Paired Samples T-Test Output

In a similar vein, the second test (not shown) indicates that the means for exams 1 and 3 do differ statistically significantly, t(18) = 2.46, p = 0.025. The same goes for the final test between exams 2 and 3.

Our t-tests show that exam 3 has a lower mean score than the other 2 exams. The next question is: are the differences large or small? One way to answer this is computing an effect size measure. For t-tests, Cohen’s D is often used. Sadly, SPSS 27 is the only version that includes it. However, it's easily computed in Excel as shown below.

SPSS Paired Samples T-Test Effect Size Cohens D

The effect sizes thus obtained are

  • d = -0.23 (pair 1) - roughly a small effect;
  • d = 0.56 (pair 2) - slightly over a medium effect;
  • d = 0.57 (pair 3) - slightly over a medium effect.

Interpretational Issues

Thus far, we compared 3 pairs of exams using 3 t-tests. A shortcoming here is that all 3 tests use the same tiny student sample. This increases the risk that at least 1 test is statistically significant just by chance. There's 2 basic solutions for this:

  • apply a Bonferroni correction in order to adjust the significance levels;
  • run a repeated measures ANOVA on all 3 exams simultaneously.

If you choose the ANOVA approach, you may want to follow it up with post hoc tests. And these are -guess what?- Bonferroni corrected t-tests again...

Thus far, we blindly assumed that the normality assumption for our paired samples t-tests holds. Since we've a small sample of N = 19 students, we do need this assumption. The only way to evaluate it, is computing the actual difference scores as new variables in our data. We'll do so with the syntax below.

SPSS Difference Scores In Example Data

We can now test the normality assumption by running

  • a Shapiro-Wilk test or
  • a Kolmogorov-Smirnov test .

on our newly created difference scores. Since we discussed both tests in separate tutorials, we'll limit ourselves to the syntax below.

SPSS Normality Test Output

Conclusion: the difference scores between exams 1 and 2 are unlikely to be normally distributed in the population. This violates the normality assumption required by our t-test. This implies that we should perhaps not run a t-test at all on exams 1 and 2. A good alternative for comparing these variables is a Wilcoxon signed-ranks test as this doesn't require any normality assumption.

Last, if you compute difference scores, you can circumvent the paired samples t-tests altogether: instead, you can run one-sample t-tests on the difference scores with zeroes as test values. The syntax below does just that. If you run it, you'll get the exact same results as from the previous paired samples tests.

Right, so that'll do for today. Hope you found this tutorial helpful. And as always:

thanks for reading!

Tell us what you think!

This tutorial has 19 comments:.

null hypothesis paired sample t test

By kidest on January 23rd, 2020

Good one it helps me

null hypothesis paired sample t test

By Patrick Guziewicz on March 27th, 2020

Nice overview! Only comment would be that in standard nomenclature (at least for APA) would be not to use p=.00, it would be p<.001 since a normal distribution never touches zero. Best and thank you!

null hypothesis paired sample t test

By Ruben Geert van den Berg on March 28th, 2020

Hi Patrick, thanks for your feedback!

We actually started rewriting this tutorial from scratch yesterday because we've some more issues with it:

-it doesn't test the normality assumption required for this test -only needed for small sample sizes (say N < 25 or so); -it doesn't mention Cohen’s D , the effect size for this test.

But anyway, we think APA recommendations usually suck and they should also be rewritten from scratch after serious debate with some good statisticians.

Regarding p-values, our view is that more accurate is always better than less accurate. You're technically right that neither the normal distribution nor the t-distribution ever comes up with exact zero probabilities because they both run from -∞ to +∞.

However, we didn't say exactly zero: taking rounding into regard, 0.00 may be any value between (exactly) 0 and 0.0049. That is, we don't use 0, 0.0, 0.00 and 0.000 interchangeably. Perhaps scientific notation would be appropriate here.

In any case, we feel that effect size and confidence intervals deserve more attention than p-values and most researchers -as well as the APA- do a very poor job there.

Have a great weekend!

SPSS tutorials

null hypothesis paired sample t test

By Joyce A. Harris-Stokes on September 9th, 2021

Very helpful information. Without it I would not know what to do.

Privacy Overview

Library homepage

  • school Campus Bookshelves
  • menu_book Bookshelves
  • perm_media Learning Objects
  • login Login
  • how_to_reg Request Instructor Account
  • hub Instructor Commons
  • Download Page (PDF)
  • Download Full Book (PDF)
  • Periodic Table
  • Physics Constants
  • Scientific Calculator
  • Reference & Cite
  • Tools expand_more
  • Readability

selected template will load here

This action is not available.

Statistics LibreTexts

11.5: The Paired-samples t-test

  • Last updated
  • Save as PDF
  • Page ID 36155

  • Danielle Navarro
  • University of New South Wales

Regardless of whether we’re talking about the Student test or the Welch test, an independent samples t-test is intended to be used in a situation where you have two samples that are, well, independent of one another. This situation arises naturally when participants are assigned randomly to one of two experimental conditions, but it provides a very poor approximation to other sorts of research designs. In particular, a repeated measures design – in which each participant is measured (with respect to the same outcome variable) in both experimental conditions – is not suited for analysis using independent samples t-tests. For example, we might be interested in whether listening to music reduces people’s working memory capacity. To that end, we could measure each person’s working memory capacity in two conditions: with music, and without music. In an experimental design such as this one, 194 each participant appears in both groups. This requires us to approach the problem in a different way; by using the paired samples t-test .

The data set that we’ll use this time comes from Dr Chico’s class. 195 In her class, students take two major tests, one early in the semester and one later in the semester. To hear her tell it, she runs a very hard class, one that most students find very challenging; but she argues that by setting hard assessments, students are encouraged to work harder. Her theory is that the first test is a bit of a “wake up call” for students: when they realise how hard her class really is, they’ll work harder for the second test and get a better mark. Is she right? To test this, let’s have a look at the chico.Rdata file:

The data frame chico contains three variables: an id variable that identifies each student in the class, the grade_test1 variable that records the student grade for the first test, and the grade_test2 variable that has the grades for the second test. Here’s the first six students:

At a glance, it does seem like the class is a hard one (most grades are between 50% and 60%), but it does look like there’s an improvement from the first test to the second one. If we take a quick look at the descriptive statistics

we see that this impression seems to be supported. Across all 20 students 196 the mean grade for the first test is 57%, but this rises to 58% for the second test. Although, given that the standard deviations are 6.6% and 6.4% respectively, it’s starting to feel like maybe the improvement is just illusory; maybe just random variation. This impression is reinforced when you see the means and confidence intervals plotted in Figure 13.11. If we were to rely on this plot alone, we’d come to the same conclusion that we got from looking at the descriptive statistics that the describe() function produced. Looking at how wide those confidence intervals are, we’d be tempted to think that the apparent improvement in student performance is pure chance.

pairedta-1.png

Nevertheless, this impression is wrong. To see why, take a look at the scatterplot of the grades for test 1 against the grades for test 2. shown in Figure 13.12.

pairedtb-1.png

In this plot, each dot corresponds to the two grades for a given student: if their grade for test 1 (x co-ordinate) equals their grade for test 2 (y co-ordinate), then the dot falls on the line. Points falling above the line are the students that performed better on the second test. Critically, almost all of the data points fall above the diagonal line: almost all of the students do seem to have improved their grade, if only by a small amount. This suggests that we should be looking at the improvement made by each student from one test to the next, and treating that as our raw data. To do this, we’ll need to create a new variable for the improvement that each student makes, and add it to the chico data frame. The easiest way to do this is as follows:

Notice that I assigned the output to a variable called chico$improvement . That has the effect of creating a new variable called improvement inside the chico data frame. So now when I look at the chico data frame, I get an output that looks like this:

Now that we’ve created and stored this improvement variable, we can draw a histogram showing the distribution of these improvement scores (using the hist() function), shown in Figure 13.13.

pairedtc-1.png

When we look at histogram, it’s very clear that there is a real improvement here. The vast majority of the students scored higher on the test 2 than on test 1, reflected in the fact that almost the entire histogram is above zero. In fact, if we use ciMean() to compute a confidence interval for the population mean of this new variable,

we see that it is 95% certain that the true (population-wide) average improvement would lie between 0.95% and 1.86%. So you can see, qualitatively, what’s going on: there is a real “within student” improvement (everyone improves by about 1%), but it is very small when set against the quite large “between student” differences (student grades vary by about 20% or so).

What is the paired samples t-test?

In light of the previous exploration, let’s think about how to construct an appropriate t test. One possibility would be to try to run an independent samples t-test using grade_test1 and grade_test2 as the variables of interest. However, this is clearly the wrong thing to do: the independent samples t-test assumes that there is no particular relationship between the two samples. Yet clearly that’s not true in this case, because of the repeated measures structure to the data. To use the language that I introduced in the last section, if we were to try to do an independent samples t-test, we would be conflating the within subject differences (which is what we’re interested in testing) with the between subject variability (which we are not).

The solution to the problem is obvious, I hope, since we already did all the hard work in the previous section. Instead of running an independent samples t-test on grade_test1 and grade_test2 , we run a one-sample t-test on the within-subject difference variable, improvement . To formalise this slightly, if X i1 is the score that the i-th participant obtained on the first variable, and X i2 is the score that the same person obtained on the second one, then the difference score is:

D i =X i1 −X i2

Notice that the difference scores is variable 1 minus variable 2 and not the other way around, so if we want improvement to correspond to a positive valued difference, we actually want “test 2” to be our “variable 1”. Equally, we would say that μ D =μ 1 −μ 2 is the population mean for this difference variable. So, to convert this to a hypothesis test, our null hypothesis is that this mean difference is zero; the alternative hypothesis is that it is not:

H 0 :μ D =0

H 1 :μ D ≠0

(this is assuming we’re talking about a two-sided test here). This is more or less identical to the way we described the hypotheses for the one-sample t-test: the only difference is that the specific value that the null hypothesis predicts is 0. And so our t-statistic is defined in more or less the same way too. If we let \(\ \bar{D}\) denote the mean of the difference scores, then

\(t=\dfrac{\bar{D}}{\operatorname{SE}(\bar{D})}\)

\(t=\dfrac{\bar{D}}{\hat{\sigma}_{D} / \sqrt{N}}\)

where \(\ \hat{\sigma_D}\) is the standard deviation of the difference scores. Since this is just an ordinary, one-sample t-test, with nothing special about it, the degrees of freedom are still N−1. And that’s it: the paired samples t-test really isn’t a new test at all: it’s a one-sample t-test, but applied to the difference between two variables. It’s actually very simple; the only reason it merits a discussion as long as the one we’ve just gone through is that you need to be able to recognise when a paired samples test is appropriate, and to understand why it’s better than an independent samples t test.

Doing the test in R, part 1

How do you do a paired samples t-test in R. One possibility is to follow the process I outlined above: create a “difference” variable and then run a one sample t-test on that. Since we’ve already created a variable called chico$improvement , let’s do that:

The output here is (obviously) formatted exactly the same was as it was the last time we used the oneSampleTTest() function (Section 13.2), and it confirms our intuition. There’s an average improvement of 1.4% from test 1 to test 2, and this is significantly different from 0 (t(19)=6.48, p<.001).

However, suppose you’re lazy and you don’t want to go to all the effort of creating a new variable. Or perhaps you just want to keep the difference between one-sample and paired-samples tests clear in your head. If so, you can use the pairedSamplesTTest() function, also in the lsr package. Let’s assume that your data organised like they are in the chico data frame, where there are two separate variables, one for each measurement. The way to run the test is to input a one-sided formula, just like you did when running a test of association using the associationTest() function in Chapter 12. For the chico data frame, the formula that you need would be ~ grade_time2 + grade_time1 . As usual, you’ll also need to input the name of the data frame too. So the command just looks like this:

The numbers are identical to those that come from the one sample test, which of course they have to be given that the paired samples t-test is just a one sample test under the hood. However, the output is a bit more detailed:

This time around the descriptive statistics block shows you the means and standard deviations for the original variables, as well as for the difference variable (notice that it always defines the difference as the first listed variable mines the second listed one). The null hypothesis and the alternative hypothesis are now framed in terms of the original variables rather than the difference score, but you should keep in mind that in a paired samples test it’s still the difference score being tested. The statistical information at the bottom about the test result is of course the same as before.

Doing the test in R, part 2

The paired samples t-test is a little different from the other t-tests, because it is used in repeated measures designs. For the chico data, every student is “measured” twice, once for the first test, and again for the second test. Back in Section 7.7 I talked about the fact that repeated measures data can be expressed in two standard ways, known as wide form and long form . The chico data frame is in wide form: every row corresponds to a unique person . I’ve shown you the data in that form first because that’s the form that you’re most used to seeing, and it’s also the format that you’re most likely to receive data in. However, the majority of tools in R for dealing with repeated measures data expect to receive data in long form. The paired samples t-test is a bit of an exception that way.

As you make the transition from a novice user to an advanced one, you’re going to have to get comfortable with long form data, and switching between the two forms. To that end, I want to show you how to apply the pairedSamplesTTest() function to long form data. First, let’s use the wideToLong() function to create a long form version of the chico data frame. If you’ve forgotten how the wideToLong() function works, it might be worth your while quickly re-reading Section 7.7. Assuming that you’ve done so, or that you’re already comfortable with data reshaping, I’ll use it to create a new data frame called chico2 :

As you can see, this has created a new data frame containing three variables: an id variable indicating which person provided the data, a time variable indicating which test the data refers to (i.e., test 1 or test 2), and a grade variable that records what score the person got on that test. Notice that this data frame is in long form: every row corresponds to a unique measurement . Because every person provides two observations (test 1 and test 2), there are two rows for every person. To see this a little more clearly, I’ll use the sortFrame() function to sort the rows of chico2 by id variable (see Section 7.6.3).

As you can see, there are two rows for “student1”: one showing their grade on the first test, the other showing their grade on the second test. 197

Okay, suppose that we were given the chico2 data frame to analyse. How would we run our paired samples t-test now? One possibility would be to use the longToWide() function (Section 7.7) to force the data back into wide form, and do the same thing that we did previously. But that’s sort of defeating the point, and besides, there’s an easier way. Let’s think about what how the chico2 data frame is structured: there are three variables here, and they all matter. The outcome measure is stored as the grade , and we effectively have two “groups” of measurements (test 1 and test 2) that are defined by the time points at which a test is given. Finally, because we want to keep track of which measurements should be paired together, we need to know which student obtained each grade, which is what the id variable gives us. So, when your data are presented to you in long form, we would want specify a two-sided formula and a data frame, in the same way that we do for an independent samples t-test: the formula specifies the outcome variable and the groups, so in this case it would be grade ~ time , and the data frame is chico2 . However, we also need to tell it the id variable, which in this case is boringly called id . So our command is:

Note that the name of the id variable is "id" and not id . Note that the id variable must be a factor. As of the current writing, you do need to include the quote marks, because the pairedSamplesTTest() function is expecting a character string that specifies the name of a variable. If I ever find the time I’ll try to relax this constraint.

As you can see, it’s a bit more detailed than the output from oneSampleTTest() . It gives you the descriptive statistics for the original variables, states the null hypothesis in a fashion that is a bit more appropriate for a repeated measures design, and then reports all the nuts and bolts from the hypothesis test itself. Not surprisingly the numbers the same as the ones that we saw last time.

One final comment about the pairedSamplesTTest() function. One of the reasons I designed it to be able handle long form and wide form data is that I want you to be get comfortable thinking about repeated measures data in both formats, and also to become familiar with the different ways in which R functions tend to specify models and tests for repeated measures data. With that last point in mind, I want to highlight a slightly different way of thinking about what the paired samples t-test is doing. There’s a sense in which what you’re really trying to do is look at how the outcome variable ( grade ) is related to the grouping variable ( time ), after taking account of the fact that there are individual differences between people ( id ). So there’s a sense in which id is actually a second predictor: you’re trying to predict the grade on the basis of the time and the id . With that in mind, the pairedSamplesTTest() function lets you specify a formula like this one

This formula tells R everything it needs to know: the variable on the left ( grade ) is the outcome variable, the bracketed term on the right ( id ) is the id variable, and the other term on the right is the grouping variable ( time ). If you specify your formula that way, then you only need to specify the formula and the data frame, and so you can get away with using a command as simple as this one:

or you can drop the argument names and just do this:

These commands will produce the same output as the last one, I personally find this format a lot more elegant. That being said, the main reason for allowing you to write your formulas that way is that they’re quite similar to the way that mixed models (fancy pants repeated measures analyses) are specified in the lme4 package. This book doesn’t talk about mixed models (yet!), but if you go on to learn more statistics you’ll find them pretty hard to avoid, so I’ve tried to lay a little bit of the groundwork here.

Paired Samples T-Test

The StatsTest Flow: Difference >> Continuous Variable of Interest >> Two Sample Tests (2 groups) >> Paired Samples >> Normal Variable of Interest

Not sure this is the right statistical method? Use the Choose Your StatsTest workflow to select the right method.

What is a Paired Samples T-Test?

The Paired Samples T-Test is a statistical test used to determine if 2 paired groups are significantly different from each other on your variable of interest. Your variable of interest should be continuous, be normally distributed, and have a similar spread between your 2 groups. Your 2 groups should be paired (often two observations from the same group) and you should have enough data (more than 5 values in each group).

The paired samples t-test is a statistical test used to determine if two observations from the same group are significantly different from each other.

The Paired Samples T-Test is also called the Paired Sample T-Test, Dependent Sample T-Test and the Paired T-Test.

Assumptions for a Paired Samples T-Test

Every statistical method has assumptions. Assumptions mean that your data must satisfy certain properties in order for statistical method results to be accurate.

The assumptions for the Paired Samples T-Test include:

Normally Distributed

Random sample, enough data, similar spread between groups.

Let’s dive in to each one of these separately.

The variable that you care about (and want to see if it is different between the two groups) must be continuous. Continuous means that the variable can take on any reasonable value.

Some good examples of continuous variables include age, weight, height, test scores, survey scores, yearly salary, etc.

If the variable that you care about is a proportion (48% of males voted vs 56% of females voted) then you should probably use the McNemar Test instead.

The variable that you care about must be spread out in a normal way. In statistics, this is called being normally distributed (aka it must look like a bell curve when you graph the data). Only use an paired samples t-test with your data if the variable you care about is normally distributed.

A normal distribution is bell shaped with most of the data in the middle as seen on the top of this image. A skewed distribution is leaning left or right with most of the data on the edge as seen on the bottom of this image.

If your variable is not normally distributed, you should use the Wilcoxon Signed-Rank Test instead.

The data points for each group in your analysis must have come from a simple random sample. This means that if you wanted to see if drinking sugary soda makes you gain weight, you would need to randomly select a group of soda drinkers for your soda drinker group, and then randomly select a group of non-soda drinkers for your non-soda drinking group.

The key here is that the data points for each group were randomly selected. This is important because if your groups were not randomly determined then your analysis will be incorrect. In statistical terms this is called bias, or a tendency to have incorrect results because of bad data.

If you do not have a random sample, the conclusions you can draw from your results are very limited. You should try to get a simple random sample. If your two samples are not paired (2 measurements from two different groups of subjects) then you should use an Independent Samples T-Test instead.

The sample size (or data set size) should be greater than 5 in each group. Some people argue for more, but more than 5 is probably sufficient.

The sample size also depends on the expected size of the difference between groups. If you expect a large difference between groups, then you can get away with a smaller sample size. If you expect a small difference between groups, then you likely need a larger sample.

If your sample size is greater than 30 (and you know the average and spread of the population), you should run a Paired Samples Z-Test instead.

In statistics this is called homogeneity of variance, or making sure the variable of interest is spread similarly between the two groups (see image below).

There are two group comparisons. The top group comparison is comparing group 1, with points fairly close together on a vertical line, with group2, with points spread out along the entire line. In this case, group 2 is much more spread out than group 1. On the bottom, both groups have points spread out across the entire vertical line, showing they have a similar spread.

When to use a Paired Samples T-Test?

You should use a Paired Samples T-Test in the following scenario:

  • You want to know if two measurements from a group are different on your variable of interest
  • Your variable of interest is continuous
  • You have two and only two groups (i.e. two measurements from a single group)
  • You have paired samples
  • You have a normal variable of interest

Let’s clarify these to help you know when to use an Paired Samples T-Test.

You are looking for a statistical test to see whether two groups are significantly different on your variable of interest. This is a difference question. Other types of analyses include examining the relationship between two variables (correlation) or predicting one variable using another variable (prediction).

Continuous Data

Your variable of interest must be continuous. Continuous means that your variable of interest can basically take on any value, such as heart rate, height, weight, number of ice cream bars you can eat in 1 minute, etc.

Types of data that are NOT continuous include ordered data (such as finishing place in a race, best business rankings, etc.), categorical data (gender, eye color, race, etc.), or binary data (purchased the product or not, has the disease or not, etc.).

A Paired Samples T-Test can only be used to compare two groups (i.e. two observations from one group) on your variable of interest.

If you have three or more observations from the same group, you should use a One Way Repeated Measures Anova analysis instead.

Paired Samples

Paired samples means that your two “groups” consist of data from the same group observed at multiple points in time. For example, if you randomly sample men at two points in time to get their IQ score, then the two observations are paired.

If your data consist of two samples from two independent groups, then you should use an Independent Samples T-Test instead.

Normal Variable of Interest

Normality was discussed earlier on this page and simply means your plotted data is bell shaped with most of the data in the middle. If you actually would like to prove that your data is normal, you can use the Kolmogorov-Smirnov test or the Shapiro-Wilk test.

Paired Samples T-Test Example

Observation 1 : A group of people were evaluated at baseline. Observation 2 : This same group of people were evaluated after a 12-week exercise program. Variable of interest : Cholesterol levels.

In this example, we have one group with two observations, meaning that the data are paired.

The null hypothesis, which is statistical lingo for what would happen if the exercise program has no effect, is that there will be no difference in cholesterol levels measured before and after the exercise program. After observing that our data meet the assumptions of a paired samples t-test, we proceed with the analysis.

When we run the analysis, we get a test statistic (in this case a T-statistic) and a p-value.

The test statistic is a measure of how different the group is on our cholesterol variable of interest across the two observations. The p-value is the chance of seeing our results assuming the exercise program actually doesn’t do anything. A p-value less than or equal to 0.05 means that our result is statistically significant and we can trust that the difference is not due to chance alone.

Frequently Asked Questions

Q: How do I run a paired samples t-test in SPSS or R? A: This resource is focused on helping you pick the right statistical method every time. There are many resources available to help you figure out how to run this method with your data: SPSS article:   https://libguides.library.kent.edu/SPSS/PairedSamplestTest SPSS video:   https://www.youtube.com/watch?v=vII22ZnFOP0 R article:  http://www.sthda.com/english/wiki/paired-samples-t-test-in-r R video:   https://www.youtube.com/watch?v=yD6aU0fY2lo

If you still can’t figure something out,  feel free to reach out .

css.php

  • Flashes Safe Seven
  • FlashLine Login
  • Faculty & Staff Phone Directory
  • Emeriti or Retiree
  • All Departments
  • Maps & Directions

Kent State University Home

  • Building Guide
  • Departments
  • Directions & Parking
  • Faculty & Staff
  • Give to University Libraries
  • Library Instructional Spaces
  • Mission & Vision
  • Newsletters
  • Circulation
  • Course Reserves / Core Textbooks
  • Equipment for Checkout
  • Interlibrary Loan
  • Library Instruction
  • Library Tutorials
  • My Library Account
  • Open Access Kent State
  • Research Support Services
  • Statistical Consulting
  • Student Multimedia Studio
  • Citation Tools
  • Databases A-to-Z
  • Databases By Subject
  • Digital Collections
  • Discovery@Kent State
  • Government Information
  • Journal Finder
  • Library Guides
  • Connect from Off-Campus
  • Library Workshops
  • Subject Librarians Directory
  • Suggestions/Feedback
  • Writing Commons
  • Academic Integrity
  • Jobs for Students
  • International Students
  • Meet with a Librarian
  • Study Spaces
  • University Libraries Student Scholarship
  • Affordable Course Materials
  • Copyright Services
  • Selection Manager
  • Suggest a Purchase

Library Locations at the Kent Campus

  • Architecture Library
  • Fashion Library
  • Map Library
  • Performing Arts Library
  • Special Collections and Archives

Regional Campus Libraries

  • East Liverpool
  • College of Podiatric Medicine

null hypothesis paired sample t test

  • Kent State University
  • SPSS Tutorials

Paired Samples t Test

Spss tutorials: paired samples t test.

  • The SPSS Environment
  • The Data View Window
  • Using SPSS Syntax
  • Data Creation in SPSS
  • Importing Data into SPSS
  • Variable Types
  • Date-Time Variables in SPSS
  • Defining Variables
  • Creating a Codebook
  • Computing Variables
  • Recoding Variables
  • Recoding String Variables (Automatic Recode)
  • Weighting Cases
  • rank transform converts a set of data values by ordering them from smallest to largest, and then assigning a rank to each value. In SPSS, the Rank Cases procedure can be used to compute the rank transform of a variable." href="https://libguides.library.kent.edu/SPSS/RankCases" style="" >Rank Cases
  • Sorting Data
  • Grouping Data
  • Descriptive Stats for One Numeric Variable (Explore)
  • Descriptive Stats for One Numeric Variable (Frequencies)
  • Descriptive Stats for Many Numeric Variables (Descriptives)
  • Descriptive Stats by Group (Compare Means)
  • Frequency Tables
  • Working with "Check All That Apply" Survey Data (Multiple Response Sets)
  • Chi-Square Test of Independence
  • Pearson Correlation
  • One Sample t Test
  • Independent Samples t Test
  • One-Way ANOVA
  • How to Cite the Tutorials

Sample Data Files

Our tutorials reference a dataset called "sample" in many examples. If you'd like to download the sample dataset to work through the examples, choose one of the files below:

  • Data definitions (*.pdf)
  • Data - Comma delimited (*.csv)
  • Data - Tab delimited (*.txt)
  • Data - Excel format (*.xlsx)
  • Data - SAS format (*.sas7bdat)
  • Data - SPSS format (*.sav)
  • SPSS Syntax (*.sps) Syntax to add variable labels, value labels, set variable types, and compute several recoded variables used in later tutorials.
  • SAS Syntax (*.sas) Syntax to read the CSV-format sample data and set variable labels and formats/value labels.

The Paired Samples t Test compares the means of two measurements taken from the same individual, object, or related units. These "paired" measurements can represent things like:

  • A measurement taken at two different times (e.g., pre-test and post-test score with an intervention administered between the two time points)
  • A measurement taken under two different conditions (e.g., completing a test under a "control" condition and an "experimental" condition)
  • Measurements taken from two halves or sides of a subject or experimental unit (e.g., measuring hearing loss in a subject's left and right ears).

The purpose of the test is to determine whether there is statistical evidence that the mean difference between paired observations is significantly different from zero. The Paired Samples t Test is a parametric test.

This test is also known as:

  • Dependent t Test
  • Paired t Test
  • Repeated Measures t Test

The variable used in this test is known as:

  • Dependent variable, or test variable (continuous), measured at two different times or for two related conditions or units

Common Uses

The Paired Samples t Test is commonly used to test the following:

  • Statistical difference between two time points
  • Statistical difference between two conditions
  • Statistical difference between two measurements
  • Statistical difference between a matched pair

Note: The Paired Samples t Test can only compare the means for two (and only two) related (paired) units on a continuous outcome that is normally distributed. The Paired Samples t Test is not appropriate for analyses involving the following: 1) unpaired data; 2) comparisons between more than two units/groups; 3) a continuous outcome that is not normally distributed; and 4) an ordinal/ranked outcome.

  • To compare unpaired means between two independent groups on a continuous outcome that is normally distributed, choose the Independent Samples  t  Test.
  • To compare unpaired means between more than two groups on a continuous outcome that is normally distributed, choose ANOVA.
  • To compare paired means for continuous data that are not normally distributed, choose the nonparametric Wilcoxon Signed-Ranks Test.
  • To compare paired means for ranked data, choose the nonparametric Wilcoxon Signed-Ranks Test.

Data Requirements

Your data must meet the following requirements:

  • Note: The paired measurements must be recorded in two separate variables.
  • The subjects in each sample, or group, are the same. This means that the subjects in the first group are also in the second group.
  • Random sample of data from the population
  • Normal distribution (approximately) of the difference between the paired values
  • No outliers in the difference between the two related groups

Note: When testing assumptions related to normality and outliers, you must use a variable that represents the difference between the paired values - not the original variables themselves.

Note: When one or more of the assumptions for the Paired Samples t Test are not met, you may want to run the nonparametric Wilcoxon Signed-Ranks Test instead.

The hypotheses can be expressed in two different ways that express the same idea and are mathematically equivalent:

H 0 : µ 1  = µ 2 ("the paired population means are equal") H 1 : µ 1  ≠ µ 2 ("the paired population means are not equal")

H 0 : µ 1  - µ 2  = 0 ("the difference between the paired population means is equal to 0") H 1 :  µ 1  - µ 2  ≠ 0 ("the difference between the paired population means is not 0")

  • µ 1 is the population mean of variable 1, and
  • µ 2 is the population mean of variable 2.

Test Statistic

The test statistic for the Paired Samples t Test, denoted t , follows the same formula as the one sample t test.

$$ t = \frac{\overline{x}_{\mathrm{diff}}-0}{s_{\overline{x}}} $$

$$ s_{\overline{x}} = \frac{s_{\mathrm{diff}}}{\sqrt{n}} $$

\(\bar{x}_{\mathrm{diff}}\) = Sample mean of the differences \(n\) = Sample size (i.e., number of observations) \(s_{\mathrm{diff}}\)= Sample standard deviation of the differences \(s_{\bar{x}}\) = Estimated standard error of the mean ( s /sqrt( n ))

The calculated t value is then compared to the critical t value with df = n - 1 from the t distribution table for a chosen confidence level. If the calculated t value is greater than the critical t value, then we reject the null hypothesis (and conclude that the means are significantly different).

Data Set-Up

Your data should include two continuous numeric variables (represented in columns) that will be used in the analysis. The two variables should represent the paired variables for each subject (row). If your data are arranged differently (e.g., cases represent repeated units/subjects), simply restructure the data to reflect this format.

Run a Paired Samples t Test

To run a Paired Samples t Test in SPSS, click Analyze > Compare Means > Paired-Samples T Test .

Click Analyze > Compare Means > Paired-Samples T Test.

The Paired-Samples T Test window opens where you will specify the variables to be used in the analysis. All of the variables in your dataset appear in the list on the left side. Move variables to the right by selecting them in the list and clicking the blue arrow buttons. You will specify the paired variables in the Paired Variables area.

SPSS Paired-Samples T Test window.

A Pair: The “Pair” column represents the number of Paired Samples t Tests to run. You may choose to run multiple Paired Samples t Tests simultaneously by selecting multiple sets of matched variables. Each new pair will appear on a new line.

B Variable1: The first variable, representing the first group of matched values. Move the variable that represents the first group to the right where it will be listed beneath the “Variable1 ” column.

C Variable2: The second variable, representing the second group of matched values. Move the variable that represents the second group to the right where it will be listed beneath the “Variable2” column.

D Options : Clicking Options will open a window where you can specify the Confidence Interval Percentage and how the analysis will address Missing Values (i.e., Exclude cases analysis by analysis or Exclude cases listwise ). Click  Continue  when you are finished making specifications.

SPSS Paired-Samples T Test: Options window.

  • Setting the confidence interval percentage does not have any impact on the calculation of the p-value.
  • If you are only running one paired samples t test, the two "missing values" settings will produce the same results. There will only be differences if you are running 2 or more paired samples t tests. (This would look like having two or more rows in the main Paired Samples T Test dialog window.)

Problem Statement

The sample dataset has placement test scores (out of 100 points) for four subject areas: English, Reading, Math, and Writing. Students in the sample completed all 4 placement tests when they enrolled in the university. Suppose we are particularly interested in the English and Math sections, and want to determine whether students tended to score higher on their English or Math test, on average. We could use a paired t test to test if there was a significant difference in the average of the two tests.

Before the Test

Variable English has a high of 101.95 and a low of 59.83, while variable Math has a high of 93.78 and a low of 35.32 ( Analyze > Descriptive Statistics > Descriptives ). The mean English score is much higher than the mean Math score (82.79 versus 65.47). Additionally, there were 409 cases with non-missing English scores, and 422 cases with non-missing Math scores, but only 398 cases with non-missing observations for both variables. (Recall that the sample dataset has 435 cases in all.)

Let's create a comparative boxplot of these variables to help visualize these numbers. Click Analyze > Descriptive Statistics > Explore . Add English and Math to the Dependents box; then, change the Display option to Plots . We'll also need to tell SPSS to put these two variables on the same chart. Click the Plots button, and in the Boxplots area, change the selection to Dependents Together . You can also uncheck Stem-and-leaf . Click Continue . Then click OK to run the procedure.

Comparative boxplot of Math versus English scores. The English scores tended to be much higher than the Math scores in general.

We can see from the boxplot that the center of the English scores is much higher than the center of the Math scores, and that there is slightly more spread in the Math scores than in the English scores. Both variables appear to be symmetrically distributed. It's quite possible that the paired samples t test could come back significant.

Running the Test

  • Click Analyze > Compare Means and Proportions > Paired-Samples T Test . If you are using an older version of SPSS Statistics (prior to version 29), the menu path is Analyze > Compare Means > Paired-Samples T Test .
  • Select the variable English and move it to the Variable1 slot in the Paired Variables box. Then select the variable Math and move it to the Variable2 slot in the Paired Variables box.

There are three tables: Paired Samples Statistics , Paired Samples Correlations , and Paired Samples Test . Paired Samples Statistics gives univariate descriptive statistics (mean, sample size, standard deviation, and standard error) for each variable entered. Notice that the sample size here is 398; this is because the paired t-test can only use cases that have non-missing values for both variables. Paired Samples Correlations shows the bivariate Pearson correlation coefficient (with a two-tailed test of significance) for each pair of variables entered. Paired Samples Test gives the hypothesis test results.

null hypothesis paired sample t test

The Paired Samples Statistics output repeats what we examined before we ran the test. The Paired Samples Correlation table adds the information that English and Math scores are significantly positively correlated ( r = .243).

Why does SPSS report the correlation between the two variables when you run a Paired t Test? Although our primary interest when we run a Paired t Test is finding out if the means of the two variables are significantly different, it's also important to consider how strongly the two variables are associated with one another, especially when the variables being compared are pre-test/post-test measures. For more information about correlation, check out the Pearson Correlation tutorial .

null hypothesis paired sample t test

Reading from left to right:

  • First column: The pair of variables being tested, and the order the subtraction was carried out. (If you have specified more than one variable pair, this table will have multiple rows.)
  • Mean: The average difference between the two variables.
  • Standard deviation: The standard deviation of the difference scores.
  • Standard error mean: The standard error (standard deviation divided by the square root of the sample size). Used in computing both the test statistic and the upper and lower bounds of the confidence interval.
  • t: The test statistic (denoted t ) for the paired T test.
  • df: The degrees of freedom for this test.
  • Sig. (2-tailed) : The p -value corresponding to the given test statistic t with degrees of freedom df .

Decision and Conclusions

From the results, we can say that:

  • English and Math scores were weakly and positively correlated ( r = 0.243, p < 0.001).
  • There was a significant average difference between English and Math scores ( t 397 = 36.313, p < 0.001).
  • On average, English scores were 17.3 points higher than Math scores (95% CI [16.36, 18.23]).
  • << Previous: One Sample t Test
  • Next: Independent Samples t Test >>
  • Last Updated: Apr 10, 2024 4:50 PM
  • URL: https://libguides.library.kent.edu/SPSS

Street Address

Mailing address, quick links.

  • How Are We Doing?
  • Student Jobs

Information

  • Accessibility
  • Emergency Information
  • For Our Alumni
  • For the Media
  • Jobs & Employment
  • Life at KSU
  • Privacy Statement
  • Technology Support
  • Website Feedback

Icon Partners

  • Quality Improvement
  • Talk To Minitab

Understanding t-Tests: 1-sample, 2-sample, and Paired t-Tests

Topics: Hypothesis Testing , Data Analysis

In statistics, t-tests are a type of hypothesis test that allows you to compare means. They are called t-tests because each t-test boils your sample data down to one number, the t-value. If you understand how t-tests calculate t-values, you’re well on your way to understanding how these tests work.

In this series of posts, I'm focusing on concepts rather than equations to show how t-tests work. However, this post includes two simple equations that I’ll work through using the analogy of a signal-to-noise ratio.

Minitab Statistical Software offers the 1-sample t-test, paired t-test, and the 2-sample t-test. Let's look at how each of these t-tests reduce your sample data down to the t-value.

How 1-Sample t-Tests Calculate t-Values

Understanding this process is crucial to understanding how t-tests work. I'll show you the formula first, and then I’ll explain how it works.

formula to calculate t for a 1-sample t-test

Please notice that the formula is a ratio. A common analogy is that the t-value is the signal-to-noise ratio.

Signal (a.k.a. the effect size)

The numerator is the signal. You simply take the sample mean and subtract the null hypothesis value. If your sample mean is 10 and the null hypothesis is 6, the difference, or signal, is 4.

If there is no difference between the sample mean and null value, the signal in the numerator, as well as the value of the entire ratio, equals zero. For instance, if your sample mean is 6 and the null value is 6, the difference is zero.

As the difference between the sample mean and the null hypothesis mean increases in either the positive or negative direction, the strength of the signal increases.

Photo of a packed stadium to illustrate high background noise

The denominator is the noise. The equation in the denominator is a measure of variability known as the standard error of the mean . This statistic indicates how accurately your sample estimates the mean of the population. A larger number indicates that your sample estimate is less precise because it has more random error.

This random error is the “noise.” When there is more noise, you expect to see larger differences between the sample mean and the null hypothesis value even when the null hypothesis is true . We include the noise factor in the denominator because we must determine whether the signal is large enough to stand out from it.

Signal-to-Noise ratio

Both the signal and noise values are in the units of your data. If your signal is 6 and the noise is 2, your t-value is 3. This t-value indicates that the difference is 3 times the size of the standard error. However, if there is a difference of the same size but your data have more variability (6), your t-value is only 1. The signal is at the same scale as the noise.

In this manner, t-values allow you to see how distinguishable your signal is from the noise. Relatively large signals and low levels of noise produce larger t-values. If the signal does not stand out from the noise, it’s likely that the observed difference between the sample estimate and the null hypothesis value is due to random error in the sample rather than a true difference at the population level.

A Paired t-test Is Just A 1-Sample t-Test

Many people are confused about when to use a paired t-test and how it works. I’ll let you in on a little secret. The paired t-test and the 1-sample t-test are actually the same test in disguise! As we saw above, a 1-sample t-test compares one sample mean to a null hypothesis value. A paired t-test simply calculates the difference between paired observations (e.g., before and after) and then performs a 1-sample t-test on the differences.

You can test this with this data set to see how all of the results are identical, including the mean difference, t-value, p-value, and confidence interval of the difference.

Minitab worksheet with paired t-test example

Understanding that the paired t-test simply performs a 1-sample t-test on the paired differences can really help you understand how the paired t-test works and when to use it. You just need to figure out whether it makes sense to calculate the difference between each pair of observations.

For example, let’s assume that “before” and “after” represent test scores, and there was an intervention in between them. If the before and after scores in each row of the example worksheet represent the same subject, it makes sense to calculate the difference between the scores in this fashion—the paired t-test is appropriate. However, if the scores in each row are for different subjects, it doesn’t make sense to calculate the difference. In this case, you’d need to use another test, such as the 2-sample t-test, which I discuss below.

Using the paired t-test simply saves you the step of having to calculate the differences before performing the t-test. You just need to be sure that the paired differences make sense!

When it is appropriate to use a paired t-test, it can be more powerful than a 2-sample t-test. For more information, go to Overview for paired t .

How Two-Sample T-tests Calculate T-Values

The 2-sample t-test takes your sample data from two groups and boils it down to the t-value. The process is very similar to the 1-sample t-test, and you can still use the analogy of the signal-to-noise ratio. Unlike the paired t-test, the 2-sample t-test requires independent groups for each sample.

The formula is below, and then some discussion.

formula to cacalculate t for a 2-sample t-test

For the 2-sample t-test, the numerator is again the signal, which is the difference between the means of the two samples. For example, if the mean of group 1 is 10, and the mean of group 2 is 4, the difference is 6.

The default null hypothesis for a 2-sample t-test is that the two groups are equal. You can see in the equation that when the two groups are equal, the difference (and the entire ratio) also equals zero. As the difference between the two groups grows in either a positive or negative direction, the signal becomes stronger.

In a 2-sample t-test, the denominator is still the noise, but Minitab can use two different values. You can either assume that the variability in both groups is equal or not equal, and Minitab uses the corresponding estimate of the variability. Either way, the principle remains the same: you are comparing your signal to the noise to see how much the signal stands out.

Just like with the 1-sample t-test, for any given difference in the numerator, as you increase the noise value in the denominator, the t-value becomes smaller. To determine that the groups are different, you need a t-value that is large.

What Do t-Values Mean?

Each type of t-test uses a procedure to boil all of your sample data down to one value, the t-value. The calculations compare your sample mean(s) to the null hypothesis and incorporates both the sample size and the variability in the data. A t-value of 0 indicates that the sample results exactly equal the null hypothesis. In statistics, we call the difference between the sample estimate and the null hypothesis the effect size. As this difference increases, the absolute value of the t-value increases.

That’s all nice, but what does a t-value of, say, 2 really mean? From the discussion above, we know that a t-value of 2 indicates that the observed difference is twice the size of the variability in your data. However, we use t-tests to evaluate hypotheses rather than just figuring out the signal-to-noise ratio. We want to determine whether the effect size is statistically significant.

To see how we get from t-values to assessing hypotheses and determining statistical significance, read the other post in this series, Understanding t-Tests: t-values and t-distributions .

You Might Also Like

  • Trust Center

© 2023 Minitab, LLC. All Rights Reserved.

  • Terms of Use
  • Privacy Policy
  • Cookies Settings
  • How It Works

Paired Samples T Test in SPSS

Discover Paired Samples T Test in SPSS ! Learn how to perform, understand SPSS output , and report results in APA style. Check out this simple, easy-to-follow guide below for a quick read!

Struggling with Paired Samples t-test in SPSS? We’re here to help . We offer comprehensive assistance to students , covering assignments , dissertations , research, and more. Request Quote Now !

null hypothesis paired sample t test

Introduction

Welcome to our comprehensive guide on the Paired Samples T Test in SPSS . If you’re venturing into the realm of statistics, particularly when dealing with related samples, the Paired Samples T Test is a powerful tool in your analytical toolkit. This statistical method enables you to compare the means of two related groups, making it invaluable in scenarios where observations are naturally paired or when studying the impact of an intervention over time. In this post, we will unravel the intricacies of the Paired Samples T Test – from its fundamental definition to a step-by-step guide on conducting the analysis using SPSS . Whether you’re a student navigating a research project or a professional researcher, understanding how to employ and interpret the Paired Samples T Test is pivotal for robust statistical analysis.

What is the Paired Samples T Test?

Firstly, let’s explore the essence of the Paired Samples T Test . This statistical method is specifically designed for situations where each observation in one group is directly related to an observation in the other group. It’s like comparing two measurements taken from the same individuals or entities, such as before-and-after measurements in a study. It assesses whether there is a significant difference between the means of these paired observations, helping researchers determine if an intervention, treatment, or change over time has had a measurable impact. Now, let’s delve deeper into the assumptions, hypotheses, and practical application of this statistical technique.

Assumption of Paired Samples T-Test:

Before delving into the intricacies of the Paired Samples T Test, let’s outline its critical assumptions:

  • Normality : The differences between paired observations should be approximately normally distributed. This assumption is particularly important for smaller sample sizes, as deviations from normality can impact the reliability of the results.
  • Scale of Measurement : The data should be measured on at least an interval scale. This means that the numerical differences between the paired observations are meaningful and consistent.
  • Dependent Pairs : Each pair of observations should be dependent or related. In other words, the measurement or observation in one group should be linked to a specific measurement or observation in the other group.

Adhering to these assumptions enhances the validity and reliability of the Paired Samples T Test results, ensuring that the statistical analysis accurately reflects the nature of the paired data.

The Hypothesis of Paired Samples T Test

Moving on to the formulation of hypotheses in the Paired Samples T Test;

  • The null hypothesis ( H0 ): there is no significant difference between the means of the paired observations.
  • The alternative hypothesis ( H1 ): there is a significant difference between the means of the paired observations.

Crafting clear and precise hypotheses is crucial for the subsequent statistical analysis and interpretation. In the following sections, we’ll explore these assumptions and hypotheses in more detail, providing insights into their significance in the context of statistical analysis.

Example of Paired Samples T Test

To illustrate the practical application of the Paired Samples T Test, let’s consider a hypothetical scenario in a clinical setting. Imagine a study assessing the effectiveness of a new therapeutic intervention for patients with chronic pain. Pain levels are measured before the intervention (baseline) and after the completion of the treatment.

  • Null hypothesis : There is no significant difference in pain levels before and after the intervention.
  • Alternative hypothesis : There is a significant difference in pain levels before and after the intervention.

By conducting the Paired Samples T Test, researchers can determine whether the observed change in pain levels is likely due to the intervention or if it could occur by random chance alone. In this example, the Paired test serves as a powerful analytical tool for evaluating the impact of the therapeutic intervention on patients’ pain experiences.

How to Perform Paired Samples T Test in SPSS

null hypothesis paired sample t test

Step by Step: Running Paired Samples t Test in SPSS Statistics

let’s embark on a step-by-step guide on performing the Paired Samples T Test using SPSS

  • STEP: Load Data into SPSS

Commence by launching SPSS and loading your dataset, which should encompass the variables of interest – a categorical independent variable. If your data is not already in SPSS format, you can import it by navigating to File > Open > Data and selecting your data file.

  • STEP: Access the Analyze Menu

In the top menu, locate and click on “ Analyze .” Within the “Analyze” menu, navigate to “ Compare Means ” and choose ” Paired-Samples T Test .” Analyze > Compare Means> Paired-Samples T Test

  • STEP: Specify Variables 

In the dialogue box, select the variables representing the paired observations (e.g., baseline and post-treatment pain levels).

  • STEP: Generate SPSS Output

Once you have specified your variables and chosen options, click the “ OK ” button to perform the analysis. SPSS will generate a comprehensive output, including the requested frequency table and chart for your dataset.

Note: Conducting Paired Sample T Test in SPSS provides a robust foundation for understanding the key features of your data. Always ensure that you consult the documentation corresponding to your SPSS version, as steps might slightly differ based on the software version in use. This guide is tailored for SPSS version 25 , and for any variations, it’s recommended to refer to the software’s documentation for accurate and updated instructions.

SPSS Output for Paired Samples T Test

null hypothesis paired sample t test

How to Interpret SPSS Output of Paired Samples T Test

SPSS will generate output, including descriptive statistics, the t-test value, degrees of freedom, and the p-value.

Descriptive Statistics Table

  • Mean and Standard Deviation : Evaluate the means and standard deviations of each group. This provides an initial overview of the central tendency and variability within each group.
  • Sample Size (N): Confirm the number of observations in each group. Discrepancies in sample sizes could impact the interpretation.
  • Standard Error of the Mean (SE): Assess the precision of the sample mean estimates.

Correlation Table

  •   Correlation Coefficient (r): Assess the correlation between the paired observations. A high correlation suggests a strong association between the two variables.

Paired Samples Test Table:

  • t-Test Value: Evaluate the t-statistic, which measures the difference between the paired observations. A higher absolute t-value indicates a more significant difference.
  • Degrees of Freedom (df): Note the degrees of freedom associated with the t-test. This value is crucial for determining the critical t-value.
  • p-Value : Assess the p-value to determine the statistical significance of the observed difference. A p-value less than the chosen significance level (e.g., 0.05) indicates a significant result.
  • Mean Difference : Understand the actual difference between the paired observations. Positive or negative values indicate the direction of the difference.
  • 95% Confidence Interval (CI): Review the confidence interval for the mean difference. If it does not include zero, it supports the rejection of the null hypothesis.
  • Effect Size (Cohen’s d or Hedges’ g): Consider the effect size as it provides insights into the practical significance of the observed difference.

By systematically assessing these components in each table, you gain a comprehensive understanding of the results of the Paired Samples T Test, allowing for accurate interpretation and informed decision-making in your research context.

How to Report Results of Paired Samples T Test in APA

Reporting the results of a Paired Samples T Test in APA style ensures clarity and conformity to established guidelines. Begin with a succinct description of the analysis conducted, including the test name, the variables under investigation, and the nature of the paired observations.

For instance, “A Paired Samples T Test was conducted to examine the difference in pain levels before and after the therapeutic intervention.”

Present the key statistical findings, including the t-test value, degrees of freedom, and p-value. For example, “The results revealed a significant difference in pain levels between the two assessment points, t(df) = [t-test value], p = [p-value]. ”

Provide additional information such as effect size (e.g., Cohen’s d) and a confidence interval for the mean difference to offer a comprehensive overview of the results.

Conclude the report by summarizing the implications of the findings in relation to your research question or hypothesis. This structured approach to reporting Paired Samples T Test results in APA format ensures transparency and facilitates the understanding of your research outcomes.

null hypothesis paired sample t test

Get Help For Your SPSS Analysis

Embark on a seamless research journey with SPSSAnalysis.com , where our dedicated team provides expert data analysis assistance for students, academicians, and individuals. We ensure your research is elevated with precision. Explore our pages;

  • SPSS Data Analysis Help – SPSS Helper ,
  • Quantitative Analysis Help ,
  • Qualitative Analysis Help ,
  • SPSS Dissertation Analysis Help ,
  • Dissertation Statistics Help ,
  • Statistical Analysis Help ,
  • Medical Data Analysis Help .

Connect with us at SPSSAnalysis.com to empower your research endeavors and achieve impactful results. Get a Free Quote Today !

Expert SPSS data analysis assistance available.

Struggling with Statistical Analysis in SPSS? - Hire a SPSS Helper Now!

LEARN STATISTICS EASILY

LEARN STATISTICS EASILY

Learn Data Analysis Now!

LEARN STATISTICS EASILY LOGO 2

Paired T-Test: A Comprehensive Guide

You will learn the pivotal role of the paired t-test in enhancing scientific integrity and data analysis precision.

Introduction

The  paired t-test  is a statistical tool of precision employed to discern the effect of an intervention by comparing two sets of observations from the same subjects under different conditions. Its importance in research is profound, offering insights into the efficacy of treatments, the impact of educational programs, and more.

Beyond its functional application, the  paired samples t-test  is a testament to the scientific method, ensuring that findings are not merely accidental but a reflection of reality. It stands as an analytical ally in the noble pursuit of empirical truth, enabling researchers to confidently make conclusions and contribute to the collective scientific narrative that aims to reveal the inherent order and harmony of the natural world.

In statistical analysis, the  paired t-test  can provide a means to weave data threads into a coherent story about the effectiveness of a new drug, the improvement of students’ scores, or any scenario where ‘before and after’ are of the essence.

Controlling for individual variability offers a focused lens through which changes are observed, quantified, and validated, paving the way for significant advancements.

This guide invites you to explore the intricacies of the  paired samples t-test , from its theoretical foundations to practical applications, ensuring a comprehensive understanding that extends beyond numbers into the realm of ethical and impactful rese

paired t-test

  • Increased Sensitivity: The paired samples t-test uniquely reduces variability between measures, enhancing the sensitivity and precision of statistical analyses.
  • Assumptions Clarified: The paired t-test, essential for accurate application, assumes normally distributed differences between paired observations, underpinning its reliability.
  • Diverse Applications: Case studies demonstrate that its utility spans multiple disciplines, such as medicine, showcasing the test’s role in evaluating treatment efficacy.
  • Guided Execution: Comprehensive guidance on performing the paired t-test in statistical software like R, ensuring methodological soundness and data integrity.
  • Avoiding Pitfalls: This section provides practical tips for navigating common errors in conducting and interpreting paired t-tests, fostering robust and ethical statistical practices.

 width=

Ad description. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Paired T-Test Theoretical Background

The  paired t-test  operates on the premise that each subject has control, forming the basis for its theoretical underpinnings. This test compares two related samples by analyzing their mean differences, assuming the paired differences follow a normal distribution. In essence, it evaluates whether the mean difference between pairs of observations is statistically different from zero, suggesting no effect or change.

The assumptions of the  paired t-test  are critical for its valid application. These include supposing that the differences within pairs are identically distributed and independent across pairs. These differences are derived from a normally distributed population with unknown but equal variances. Such assumptions are not merely technicalities; they are the framework that ensures the reliability of the test results.

When contemplating paired comparisons, one can observe the beauty of statistical symmetry at play. The  paired t-test  harnesses the intrinsic link between paired observations, effectively controlling for variability that might obscure the true effect being measured. By focusing on the differences within each pair, the  paired samples t-test  mitigates the impact of confounding variables, allowing for a more precise measure of the effect.

The concept of paired differences is fundamental in various applications, such as in medical studies where the impact of a new treatment is assessed by comparing patient outcomes before and after the treatment. Such comparisons exemplify the balance and symmetry the  paired t-test  seeks to achieve, ensuring that the observed effects are due to the treatment and not external factors.

paired t-test

Paired T-Test Practical Applications

The  paired t-test  is a critical instrument across various scientific fields, demonstrating its adaptability and significance in research. In medicine, it is commonly used to analyze the effectiveness of a new treatment by comparing patient health metrics before and after the intervention. The test’s ability to match each patient to themselves as a control minimizes the variability arising from individual differences, thereby providing a clearer picture of the treatment’s impact.

The  paired samples t-test  is utilized in psychology to evaluate behavioral changes or cognitive function following experimental interventions. For instance, assessing the efficacy of cognitive-behavioral therapy on anxiety levels before and after treatment can be accomplished using this method, helping to ascertain the true psychological benefits of such interventions.

Educational research also benefits from the  paired t-test . It can measure the outcomes of pedagogical strategies by comparing student performance on a subject before and after a particular teaching method is implemented. This method allows educators to critically assess and refine their teaching practices based on empirical evidence.

Step-by-Step Guide to Performing a Paired T-Test

Performing a  paired t-test  involves a series of methodical steps that begin with collecting paired data and culminate in interpreting the statistical output. Here is a structured guide on conducting a  paired samples t-test  using R, focused on integrity and accurate representation of data:

1. Data Collection and Preparation

Gather paired data from two sets of related measurements, such as blood pressure readings before and after a medical intervention on the same individuals. Ensure the data is clean, matched, and without outliers that may skew the results.

2. Execution in R

  • Load your data into R, structuring it in two columns representing the  ‘before’  and  ‘after’  conditions, with each row corresponding to a matched pair.
  • Use the  ‘t.test()’  function to perform the paired t-test. An example command is  ‘t.test(before, after, paired = TRUE)’ , where  ‘before’  and  ‘after’  are your data vectors.
  • The output will include the t-statistic and the p-value, essential for interpreting the results.

3. Interpretation of Results

  • The  p-value  indicates whether the changes observed are statistically significant. A p-value less than the chosen alpha level (commonly 0.05) suggests a significant difference between the paired observations.
  • Assessing the  effect size  offers insight into the magnitude of the difference, which is crucial for determining the practical significance of the findings.

Common Pitfalls and How to Avoid Them

Conducting and interpreting a paired t-test can be straightforward, yet certain pitfalls can lead to inaccuracies. Awareness of these common errors and adherence to robust statistical practice are crucial for ethical research.

Common Mistakes in Conducting Paired T-Tests:

Mismatched Pairs : Ensure that each ‘before’ measurement is correctly paired with its ‘after’ counterpart. Incorrect pairing can lead to erroneous conclusions.

Ignoring Assumptions : The paired t-test assumes that the differences within pairs are normally distributed. Before running the test, check for normality; non-normal distributions might require a different approach, such as a non-parametric test.

Outliers : Outliers can significantly affect the mean difference and standard deviation. Investigate outliers to decide whether they are data entry errors, measurement errors, or true values.

Overlooking Sample Size : A small sample size may not provide enough power to detect a significant effect, leading to a Type II error. Ensure your study is adequately powered before conducting the test.

Data Dependency : The paired t-test is designed for dependent data. Applying it to independent samples will invalidate the results.

Tips for Ensuring Robust and Ethical Statistical Practice:

Pre-Analysis Data Checks : Conduct thorough checks for data accuracy, normality, and outliers. Utilize visualizations like histograms and Q-Q plots for normality and boxplots for outliers.

Sample Size Calculation : Perform a power analysis beforehand to determine the required sample size for detecting an effect of interest with high probability.

Reporting Transparency : The research report should include all steps taken during the analysis, such as data transformation or removing outliers.

Effect Size Reporting : Report the effect size and the p-value to provide context regarding the magnitude of the observed effect.

Replication and Validation : Whenever possible, replicate your study to confirm findings and enhance the credibility of the results.

Hypotheses and Statistical Significance

This section delves into the foundational aspects of hypotheses formulation and statistical significance interpretation within the context of the paired t-test , emphasizing the critical role these elements play in scientific inquiry.

Formulating Hypotheses

The paired samples t-test is predicated on two core hypotheses: the  null hypothesis (H₀)  and the  alternative hypothesis (H₁) .

Null Hypothesis (H₀):  This hypothesis posits that there is no significant difference between the paired observations. It suggests that any observed differences are attributable to random chance rather than a specific intervention or condition. Mathematically, it is often expressed as the mean difference (D) between the paired samples equal to zero (D = 0).

Alternative Hypothesis (H₁):  Contrary to H₀, the alternative hypothesis proposes that there is a significant difference between the paired observations. This implies that the intervention or condition has elicited a measurable effect. The nature of this hypothesis can be two-tailed (D ≠ 0), suggesting a difference in either direction or one-tailed (D > 0 or D < 0), indicating a specific direction of the effect.

Understanding Statistical Significance

Statistical significance  is intrinsically linked to the  p-value . This metric quantifies the probability of observing the collected data or something more extreme under the assumption that the null hypothesis is true.

A  low p-value  (typically ≤ 0.05) indicates that the observed data is highly unlikely under the null hypothesis, leading to its rejection in favor of the alternative hypothesis. This signifies a statistically significant difference between the paired samples, suggesting the intervention’s effect is beyond mere chance.

Conversely, a  high p-value  suggests insufficient evidence to reject the null hypothesis, implying that the observed differences could be due to random variability.

Interpreting Results

Interpreting the results of a paired t-test extends beyond merely acknowledging statistical significance. It involves a nuanced understanding of what the data reveals about the underlying phenomenon:

Statistical Significance vs. Practical Significance:  A statistically significant result does not inherently imply practical or clinical relevance. Researchers must assess the  effect size , a measure of the intervention’s magnitude, to gauge its real-world implications.

Contextual Interpretation:  Results should be interpreted within the broader context of the research question, considering the study’s design, the characteristics of the sample, and the potential impact of external factors.

Ethical Reporting:  Transparency in reporting findings, including the methodology, statistical significance levels, and effect sizes, is paramount. This ensures that the research community can critically evaluate and build upon the work, fostering a cumulative advancement of knowledge.

The paired samples t-test offers a rigorous framework for hypothesis testing in paired samples. By meticulously formulating hypotheses and judiciously interpreting statistical significance, researchers can draw meaningful inferences that contribute to the quest for truth and enhance our understanding of the natural world and its myriad phenomena.

Paired T-Test Assumptions

When delving into the  paired t-test , it’s imperative to understand and adhere to its underlying assumptions thoroughly. These assumptions are the basis of the test’s validity, ensuring the conclusions drawn are reliable and meaningful. Here, we explore each assumption in detail, supplemented by visual aids to enhance comprehension, particularly regarding normality and outlier detection.

1. Pairing of Observations

Each data point in one group must have a corresponding pair in the other group. This pairing is based on a common attribute or condition, such as the same subjects measured before and after an intervention. The essence of this assumption is to control for individual variability, allowing for a focused analysis of the effect.

2. Scale of Measurement

The data should be continuous or ordinal and measured on at least an interval scale, allowing for meaningful computation of differences between pairs.

3. Independence of Pairs

While observations within each pair are related, each pair must be independent of the others. This independence is crucial for the mathematical underpinnings of the t-test, which relies on the assumption that the selection or outcome of one pair does not influence another.

4. Normal Distribution of Differences

The paired samples t-test assumes that the differences between paired observations are normally distributed. This assumption does not necessitate the normality of the individual distributions of the two groups but rather the distribution of their differences. We can use the Shapiro-Wilk test to check the data adjustment for normality.

Visual Aid for Normality:  A histogram or a Q-Q plot can be used to assess the normality of the differences. In a histogram, a bell-shaped curve suggests normality. The distribution can be considered normal in a Q-Q plot if the points roughly follow the line.

paired t-test

Addressing Violations:

Non-normal Distribution:  If the differences between pairs do not follow a normal distribution, consider normalizing the data using transformations. A non-parametric alternative, such as the Wilcoxon signed-rank test, may be more appropriate if transformations are ineffective.

Outliers:  Outliers can disproportionately affect the paired t-test, potentially leading to misleading results.

  • Visual Aid for Outliers:  Boxplots are particularly effective for identifying outliers. Points that fall outside the whiskers of the boxplot may be considered outliers.
  • Handling Outliers:  Investigate outliers for data entry errors or measurement anomalies once identified. If outliers are legitimate observations, consider their impact on the analysis carefully. In some cases, robust statistical techniques or adjustments may be necessary to mitigate their influence.

paired t-test

Practical Considerations

Conducting preliminary analyses to verify these assumptions before proceeding with the  paired t-test  is essential. This preemptive approach bolsters the validity of your findings and aligns with the principles of rigorous and ethical scientific inquiry.

Paired T-Test Procedure and Calculation

This section provides a detailed, step-by-step guide to performing a paired t-test , focusing on calculating mean differences, standard deviations, and the t-statistic, complemented by visual examples for clarity.

Data Collection and Preparation

  • Gather Data : Collect paired data from two sets of related measurements, ensuring each ‘before’ measurement is paired with its corresponding ‘after’ measurement. This could involve pre- and post-intervention assessments on the same subjects.
  • Clean Data : Verify that the data is clean, correctly matched, and free from outliers that could skew the results. Data cleaning is crucial for the accuracy of the test results.

Execution in R

  • I nput Data : Import your data into R, arranging it into two columns representing the  ‘before’  and  ‘after’  conditions. Ensure each row corresponds to a matched pair.
  • Run Paired T-Test : Use R’s  ‘t.test()’  function to perform the paired t-test. The basic syntax is  ‘t.test(before, after, paired = TRUE)’ , where  ‘before’  and  ‘after’  represent your data vectors. This function computes the t-statistic, p-value, and confidence interval for the mean difference.

Paired T-Test Calculation Details

Mean Difference : Calculate the difference between each pair of observations. The mean of these differences ( D ) is a crucial component of the t-test.

Standard Deviation of Differences : Compute the standard deviation of the differences ( SD ) to measure the dispersion.

T-Statistic : The t-statistic is calculated using the formula:

t  =  D  / ( SD  / √ n ​)

where n is the number of pairs. This statistic measures how many standard deviations the mean difference is away from zero.

After calculating the t-statistic in a  paired t-test , the subsequent steps involve determining the p-value and considering the degrees of freedom (df) to accurately interpret the test’s results. Here’s how to proceed:

Determining the P-Value

The p-value is a crucial component in hypothesis testing, indicating the probability of obtaining test results at least as extreme as the observed results, assuming the null hypothesis is true. After calculating the t-statistic:

  • Degrees of Freedom (df) : For a paired t-test, the degrees of freedom are calculated as  df  =  n −1, where  n  is the number of pairs. The degrees of freedom account for the number of values that are free to vary in the final calculation of a statistic.
  • Refer to the T-Distribution Table : With the calculated t-statistic and degrees of freedom, refer to a t-distribution table to find the p-value. The t-distribution table provides critical values for different degrees of freedom at various significance levels (alpha levels).
  • Software Computation : Statistical software like R automatically computes the p-value when conducting a t-test. The software uses the t-statistic and degrees of freedom to calculate the probability.

Visual Examples

Mean Differences : A line graph displaying each pair’s ‘before’ and ‘after’ values can visually represent the mean difference, highlighting the intervention’s effect.

Standard Deviation : A histogram of the differences with a superimposed normal curve can help visualize the differences’ spread and normality.

paired t-test

Interpretation of Results

  • P-Value : A p-value less than the alpha level (commonly set at 0.05) indicates a statistically significant difference between the paired groups, suggesting that the observed changes are unlikely to have occurred by chance.
  • Effect Size : Calculating the effect size, such as Cohen’s d, provides insight into the magnitude of the observed difference, adding context to the statistical significance.
  • Confidence Interval : The confidence interval for the mean difference offers a range within which the true mean difference is likely to lie, measuring the result’s precision.

In this comprehensive guide, we delved into the intricacies of the  paired samples t-test . This statistical method plays a pivotal role in scientific research. This test is instrumental in comparing two sets of observations from the same subjects under different conditions, thereby providing a robust framework for evaluating the efficacy of interventions across various fields such as medicine, psychology, and education.

Key Points Summarized:

  • The  paired t-test  enhances the precision of data analysis by controlling for individual variability, making it a powerful tool for discerning the true impact of treatments or interventions.
  • Adherence to the test’s assumptions, including the normal distribution of paired differences and the independence of observations, is paramount for the validity of its outcomes.
  • The paired t-test ‘s practical applications span diverse disciplines, demonstrating its versatility and critical role in empirical research.
  • Navigating potential pitfalls, such as mismatched pairs or overlooking outliers, requires meticulous data preparation and ethical statistical practices.

Reflecting on the broader context of scientific discovery, the paired t-test exemplifies the scientific method’s rigor, offering a window into the empirical truths that underpin our understanding of the natural world. Through careful execution and interpretation, the paired samples t-test contributes to the advancement of knowledge and upholds the principles of scientific integrity.

In essence, the paired t-test is more than a mere statistical tool; it is a testament to the enduring quest for knowledge. It embodies the scientific spirit, weaving together data threads into coherent narratives illuminating interventions’ efficacy and their impact on human well-being. As we harness the power of this analytical tool, we are reminded of the broader implications of our findings, not just for the academic community but for society at large.

In the grand tapestry of scientific inquiry, the paired t-test is a crucial stitch, binding empirical evidence with the philosophical ideals of truth. Through this synthesis, we can truly appreciate the contributions of statistical methods like the paired t-test to the enriching tapestry of human knowledge, driving forward the noble endeavor of scientific exploration for the betterment of all.

Recommended Articles

Explore more insights on statistical tests and data analysis by diving into our collection of related articles on the blog.

  • What is the Difference Between T-test vs. ANOVA
  • What is the Difference Between T-Test vs. Chi-Square Test?
  • What is the difference between t-test and Mann-Whitney test?

Frequently Asked Questions (FAQs)

Q1: What is a paired t-test used for?  A paired t-test is primarily used to compare the means of two related groups to determine if there is a statistically significant difference between them. This test is ideal for ‘before and after’ studies or when measuring the same subjects under two conditions.

Q2: What is the difference between a paired t-test and ANOVA?  While a paired t-test compares the means of two related groups, ANOVA (Analysis of Variance) is used when comparing the means of three or more groups or different levels of a factor. ANOVA can handle more complex designs than a simple paired comparison.

Q3: What are the 3 types of t-tests?  The three main types of t-tests are: 1) One-sample t-test, comparing the mean of a single group against a known mean. 2) Independent two-sample t-test, comparing the means of two independent groups. 3) Paired t-test, comparing the means of the same group or matched subjects at two different times or under two different conditions.

Q4: What is the difference between a paired t-test and a one-sample t-test?  A paired t-test compares the means of the same or matched subjects under two different conditions, focusing on the difference between these paired observations. In contrast, a one-sample t-test compares the mean of a single sample to a known or hypothesized population mean.

Q5: How do you perform a Paired T-Test in R?  First, to conduct a paired t-test in R, ensure your data is structured with paired observations, typically in two columns where each row represents a pair. Using the  ‘t.test()’  function, specify your two data vectors, and set the  ‘paired’  argument to  ‘TRUE’ . The function will return the t-statistic, degrees of freedom, and p-value, among other information. Here’s a basic example, assuming ‘ before’  and  ‘after’  are your vectors of paired observations:  ‘t.test(before, after, paired = TRUE)’ . This command performs the paired t-test on your data, comparing the  ‘before’  and  ‘after’  conditions, and provides the statistical output necessary for interpretation.

Q6: Can a paired t-test be used for non-normal data?  For significantly non-normal data, non-parametric alternatives like the Wilcoxon signed-rank test are recommended, as the paired t-test assumes normally distributed differences between pairs.

Q7: How do you interpret paired t-test results?  Interpretation focuses on the p-value; if it’s below your chosen significance level (commonly 0.05), the difference between the paired groups is considered statistically significant, indicating a real effect beyond random chance.

Q8: What’s the difference between a paired t-test and an independent t-test?  A paired t-test is used for related samples or matched pairs, analyzing the difference within pairs. An independent t-test compares the means of two independent or unrelated groups, focusing on the variance between the groups.

Q9: How does a paired t-test handle missing data?  In a paired t-test, if one value in a pair is missing, the entire pair is typically excluded from the analysis. This approach prevents biases that might arise from imputing missing values. However, it can reduce the power of the test if many pairs are excluded.

Q10: Can a paired t-test be used for over two-time points?  A paired t-test is designed for comparisons between two-time points or conditions. Repeated measures ANOVA or a mixed-effects model would be more appropriate for analyses involving more than two-time points to accommodate the additional complexity.

Similar Posts

Example of Paired t-Test

Example of Paired t-Test

Master this analysis through an example of paired t-test — unveil the profound insights in your paired data studies.

ANOVA and T-test: Understanding the Differences and When to Use Each

ANOVA and T-test: Understanding the Differences and When to Use Each

Discover the critical differences between ANOVA and t-test in our comprehensive guide, and learn when to use each for practical data analysis.

T-test vs Z-test: When to Use Each Test and Why It Matters

T-test vs Z-test: When to Use Each Test and Why It Matters

Explore the differences between the t-test vs z-test, understand their assumptions, and learn when to use each test for accurate data analysis.

APA Style T-Test Reporting Guide

APA Style T-Test Reporting Guide

How to report t-test in APA style? Learn now! Tips, examples, and effect size calculation included. Learn how to report t-test results.

What is the Difference Between the T-Test vs. Chi-Square Test?

What is the Difference Between the T-Test vs. Chi-Square Test?

Explore the fundamental differences between the t-test vs. chi-square test, crucial tools in statistics and data analysis.

Two-Sample t-Test in R Explained

Two-Sample t-Test in R Explained

With our expert guide, master the two-sample t-test in R. Learn to compare group means accurately for insightful data analysis.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Save my name, email, and website in this browser for the next time I comment.

null hypothesis paired sample t test

If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

To log in and use all the features of Khan Academy, please enable JavaScript in your browser.

AP®︎/College Statistics

Course: ap®︎/college statistics   >   unit 11.

  • Hypotheses for a two-sample t test

Example of hypotheses for paired and two-sample t tests

  • Writing hypotheses to test the difference of means
  • Two-sample t test for difference of means
  • Test statistic in a two-sample t test
  • P-value in a two-sample t test
  • Conclusion for a two-sample t test using a P-value
  • Conclusion for a two-sample t test using a confidence interval
  • Making conclusions about the difference of means

Want to join the conversation?

  • Upvote Button navigates to signup page
  • Downvote Button navigates to signup page
  • Flag Button navigates to signup page

Video transcript

Dependent t-test for paired samples (cont...)

What hypothesis is being tested.

The dependent t-test is testing the null hypothesis that there are no differences between the means of the two related groups. If we get a statistically significant result, we can reject the null hypothesis that there are no differences between the means in the population and accept the alternative hypothesis that there are differences between the means in the population. We can express this as follows:

H 0 : µ 1 = µ 2

H A : µ 1 ≠ µ 2

What is the advantage of a dependent t-test over an independent t-test?

Before we answer this question, we need to point out that you cannot choose one test over the other unless your study design allows it. What we are discussing here is whether it is advantageous to design a study that uses one set of participants whom are measured twice or two separate groups of participants measured once each. The major advantage of choosing a repeated-measures design (and therefore, running a dependent t-test) is that you get to eliminate the individual differences that occur between participants – the concept that no two people are the same – and this increases the power of the test. What this means is that if you are more likely to detect a (statistically significant) difference, if one does exist, using the dependent t-test versus the independent t-test.

Can the dependent t-test be used to compare different participants?

Yes, but this does not happen very often. You can use the dependent t-test instead of using the usual independent t-test when each participant in one of the independent groups is closely related to another participant in the other group on many individual characteristics. This approach is called a "matched-pairs" design. The reason we might want to do this is that the major advantage of running a within-subject (repeated-measures) design is that you get to eliminate between-groups variation from the equation (each individual is unique and will react slightly differently than someone else), thereby increasing the power of the test. Hence, the reason why we use the same participants – we expect them to react in the same way as they are, after all, the same person. The most obvious case of when a "matched-pairs" design might be implemented is when using identical twins. Effectively, you are choosing parameters to match your participants on, which you believe will result in each pair of participants reacting in a similar way.

How do I report the result of a dependent t-test?

You need to report the test as follows:

Reporting a Dependent T-Test

where df is N – 1, where N = number of participants.

Testimonials

Should I report confidence levels?

Confidence intervals (CI) are a useful statistic to include because they indicate the direction and size of a result. It is common to report 95% confidence intervals, which you will most often see reported as 95% CI. Programmes such as SPSS Statistics will automatically calculate these confidence intervals for you; otherwise, you need to calculate them by hand. You will want to report the mean and 95% confidence interval for the difference between the two related groups.

If you wish to run a dependent t-test in SPSS Statistics, you can find out how to do this in our Dependent T-Test guide.

Paired samples t-test

Description.

The paired t-test is used to test the null hypothesis that the average of the differences between a series of paired observations is zero. Observations are paired when, for example, they are performed on the same samples or subjects.

Required input

Dialog box for paired t-test

The results windows for the paired samples t-test displays the summary statistics of the two samples. Note that the sample size will always be equal because only cases are included with data available for the two variables.

Next, the arithmetic mean of the differences ( mean difference ) between the paired observations is given, the standard deviation of these differences and the standard error of the mean difference followed by the confidence interval for the mean difference.

Differences are calculated as sample 2 − sample 1.

In the paired samples t-test the null hypothesis is that the average of the differences between the paired observations in the two samples is zero.

If the calculated P-value is less than 0.05, the conclusion is that, statistically, the mean difference between the paired observations is significantly different from 0.

Note that in MedCalc P-values are always two-sided.

Paired samples t-test results.

Logarithmic transformation

If you selected the Logarithmic transformation option, the program performs the calculations on the logarithms of the observations, but reports the back-transformed summary statistics.

For the paired samples t-test, the mean difference and confidence interval are given on the log-transformed scale.

Next, the results of the t-test are transformed back and the interpretation is as follows: the back-transformed mean difference of the logs is the geometric mean of the ratio of paired values on the original scale (Altman, 1991).

Normal distribution of differences

For the paired samples t-test, it is assumed that the differences of the data pairs follow a Normal distribution (you do not need to check for normality in the two separate samples). This assumption can be evaluated with a formal test, or by means of graphical methods.

The different formal Tests for Normal distribution may not have enough power to detect deviation from the Normal distribution when sample size is small. On the other hand, when sample size is large, the requirement of a Normal distribution is less stringent because of the central limit theorem.

To do so, you click the hyperlink "Save differences" in the results window. This will save the differences between the paired observations as a new variable in the spreadsheet. You can then use this new variable in the different distribution plots.

External links

null hypothesis paired sample t test

Teach yourself statistics

Hypothesis Test: Difference Between Paired Means

This lesson explains how to conduct a hypothesis test for the difference between paired means . The test procedure, called the matched-pairs t-test , is appropriate when the following conditions are met:

  • The sampling method for each sample is simple random sampling .
  • The test is conducted on paired data. (As a result, the data sets are not independent .)
  • The population distribution is normal.
  • The population data are symmetric , unimodal , without outliers , and the sample size is 15 or less.
  • The population data are slightly skewed , unimodal, without outliers, and the sample size is 16 to 40.
  • The sample size is greater than 40, without outliers.

This approach consists of four steps: (1) state the hypotheses, (2) formulate an analysis plan, (3) analyze sample data, and (4) interpret results.

State the Hypotheses

Every hypothesis test requires the analyst to state a null hypothesis and an alternative hypothesis . The hypotheses are stated in such a way that they are mutually exclusive. That is, if one is true, the other must be false; and vice versa.

The hypotheses concern a new variable d, which is based on the difference between paired values from two data sets.

d = x 1 - x 2

where x 1 is the value of variable x in the first data set, and x 2 is the value of the variable from the second data set that is paired with x 1 .

The table below shows three sets of null and alternative hypotheses. Each makes a statement about how the true difference in population values μ d is related to some hypothesized value D. (In the table, the symbol ≠ means " not equal to ".)

The first set of hypotheses (Set 1) is an example of a two-tailed test , since an extreme value on either side of the sampling distribution would cause a researcher to reject the null hypothesis. The other two sets of hypotheses (Sets 2 and 3) are one-tailed tests , since an extreme value on only one side of the sampling distribution would cause a researcher to reject the null hypothesis.

Formulate an Analysis Plan

The analysis plan describes how to use sample data to accept or reject the null hypothesis. It should specify the following elements.

  • Significance level. Often, researchers choose significance levels equal to 0.01, 0.05, or 0.10; but any value between 0 and 1 can be used.
  • Test method. Use the matched-pairs t-test to determine whether the difference between sample means for paired data is significantly different from the hypothesized difference between population means.

Analyze Sample Data

Using sample data, find the standard deviation, standard error, degrees of freedom, test statistic, and the P-value associated with the test statistic.

s d = sqrt [ (Σ(d i - d ) 2 / (n - 1) ]

SE = s d * sqrt{ ( 1/n ) * [ (N - n) / ( N - 1 ) ] }

SE = s d / sqrt( n )

  • Degrees of freedom. The degrees of freedom (DF) is: DF = n - 1 .

t = [ ( x 1 - x 2 ) - D ] / SE = ( d - D) / SE

  • P-value. The P-value is the probability of observing a sample statistic as extreme as the test statistic. Since the test statistic is a t statistic, use the t Distribution Calculator to assess the probability associated with the t statistic, having the degrees of freedom computed above. (See the sample problem at the end of this lesson for guidance on how this is done.)

Interpret Results

If the sample findings are unlikely, given the null hypothesis, the researcher rejects the null hypothesis. Typically, this involves comparing the P-value to the significance level , and rejecting the null hypothesis when the P-value is less than the significance level.

Test Your Understanding

Forty-four sixth graders were randomly selected from a school district. Then, they were divided into 22 matched pairs, each pair having equal IQ's. One member of each pair was randomly selected to receive special training. Then, all of the students were given an IQ test. Test results are summarized below.

Σ(d - d ) 2 = 270

Do these results provide evidence that the special training helped or hurt student performance? Use an 0.05 level of significance. Assume that the mean differences are approximately normally distributed.

The solution to this problem takes four steps: (1) state the hypotheses, (2) formulate an analysis plan, (3) analyze sample data, and (4) interpret results. We work through those steps below:

Null hypothesis: μ d = 0

Alternative hypothesis: μ d ≠ 0

  • Formulate an analysis plan . For this analysis, the significance level is 0.05. Using sample data, we will conduct a matched-pairs t-test of the null hypothesis.

s = sqrt [ (Σ(d i - d ) 2 / (n - 1) ]

s = sqrt[ 270/(22-1) ] = sqrt(12.857) = 3.586

SE = s / sqrt(n) = 3.586 / [ sqrt(22) ]

SE = 3.586/4.69 = 0.765

DF = n - 1 = 22 -1 = 21

t = [ ( x 1 - x 2 ) - D ] / SE

t = ( d - D)/ SE = (1 - 0)/0.765 = 1.307

where d i is the observed difference for pair i , d is mean difference between sample pairs, D is the hypothesized mean difference between population pairs, and n is the number of pairs.

Since we have a two-tailed test , the P-value is the probability that the t statistic having 21 degrees of freedom is less than -1.307 or greater than 1.307. We use the t Distribution Calculator to find P(t < -1.307) is about 0.103.

  • Then, we enter 1.307 as the sample mean in the t Distribution Calculator. We find the that the P(t < 1.307) is about 0.897. Therefore, P(t > 1.307) is 1 minus 0.897 or 0.103. Thus, the P-value = 0.103 + 0.103 = 0.206.
  • Interpret results . Since the P-value (0.206) is greater than the significance level (0.05), we cannot reject the null hypothesis.

Note: If you use this approach on an exam, you may also want to mention why this approach is appropriate. Specifically, the approach is appropriate because the sampling method was simple random sampling, the samples consisted of paired data, and the mean differences were normally distributed. In addition, we used the approximation formula to compute the standard error, since the sample size was small relative to the population size.

Statology

Statistics Made Easy

How to Perform a Paired Samples t-test in R

A paired samples t-test is a statistical test that compares the means of two samples when each observation in one sample can be paired with an observation in the other sample.

For example, suppose we want to know whether a certain study program significantly impacts student performance on a particular exam.

To test this, we have 20 students in a class take a pre-test. Then, we have each of the students participate in the study program each day for two weeks. Then, the students retake a test of similar difficulty.

To compare the difference between the mean scores on the first and second test, we use a paired t-test because for each student their first test score can be paired with their second test score.

How to Conduct a Paired t-test

To conduct a paired t-test, we can use the following approach: 

Step 1: State the null and alternative hypotheses.

H 0 : μ d  = 0 

H a : μ d  ≠ 0  (two-tailed) H a : μ d  > 0  (one-tailed) H a : μ d  < 0  (one-tailed)

where  μ d   is the mean difference.

Step 2: Find the test statistic and corresponding p-value.

Let a = the student’s score on the first test and b = the student’s score on the second test. To test the null hypothesis that the true mean difference between the test scores is zero:

  • Calculate the difference between each pair of scores (d i  = b i  – a i )
  • Calculate the mean difference (d)
  • Calculate the standard deviation of the differences s d
  • Calculate the t-statistic, which is T = d / (s d  / √n)
  • Find the corresponding p-value for the t-statistic with  n-1  degrees of freedom.

Step 3: Reject or fail to reject the null hypothesis, based on the significance level.

If the p-value is less than our chosen significance level, we reject the null hypothesis and conclude that there is a statistically significant difference between the means of the two groups. Otherwise, we fail to reject the null hypothesis.

How to Conduct a Paired t-test in R

To conduct a paired t-test in R, we can use the built-in t.test() function with the following syntax:

t.test (x, y, paired = TRUE, alternative = “two.sided”)

  • x,y: the two numeric vectors we wish to compare
  • paired: a logical value specifying that we want to compute a paired t-test
  • alternative: the alternative hypothesis. This can be set to “two.sided” (default), “greater” or “less”.

The following example illustrates how to conduct a paired t-test to find out if there is a significant difference in the mean scores between a pre-test and a post-test for 20 students.

Create the Data

First, we’ll create the dataset:

Visualize the Differences

Next, we’ll look at summary statistics of the two groups using the  group_by()  and  summarise ()  functions from the  dplyr library:

We can also create boxplots  using the boxplot() function in R to view the distribution of scores for the pre and post groups:

Box plots in R

From both the summary statistics and the boxplots, we can see that the mean score in the  post  group is slightly higher than the mean score in the  pre  group. We can also see that the scores for the  post  group have less variability than the scores in the  pre  group.

To find out if the difference between the means for these two groups is statistically significant, we can proceed to conduct a paired t-test.

Conduct a Paired t-test

Before we conduct the paired t-test, we should check that the distribution of differences is normally (or approximately normally) distributed. To do so, we can create a new vector defined as the difference between the pre and post scores, and perform a shapiro-wilk test for normality on this vector of values:

The p-value of the test is 0.1135, which is greater than alpha = 0.05. Thus, we fail to reject the null hypothesis that our data is normally distributed. This means we can now proceed to conduct the paired t-test.

We can use the following code to conduct a paired t-test:

From the output, we can see that:

  • The test statistic  t  is 1.588 .
  • The p-value for this test statistic with 19 degrees of freedom (df) is  0.1288 .
  • The 95% confidence interval for the mean difference is  (-0.6837, 4.9837) .
  • The mean difference between the scores for the pre and post group is  2.15 .

Thus, since our p-value is less than our significance level of 0.05 we will fail to reject the null hypothesis that the two groups have statistically significant means.

In other words, we do not have sufficient evidence to say that the mean scores between the pre and post groups are statistically significantly different. This means the study program had no significant effect on test scores.

In addition, our 95% confidence interval says that we are “95% confident” that the true mean difference between the two groups is between -0.6837 and 4.9837 .

Since the value zero is contained in this confidence interval, this means that  zero  could in fact be the true difference between the mean scores, which is why we failed to reject the null hypothesis in this case.

Additional Resources

The following tutorials explain how to perform other common operations in R:

How to Perform a One Sample T-Test in R How to Perform a Two Sample T-Test in R How to Perform a One-Way ANOVA in R

null hypothesis paired sample t test

Hey there. My name is Zach Bobbitt. I have a Master of Science degree in Applied Statistics and I’ve worked on machine learning algorithms for professional businesses in both healthcare and retail. I’m passionate about statistics, machine learning, and data visualization and I created Statology to be a resource for both students and teachers alike.  My goal with this site is to help you learn statistics through using simple terms, plenty of real-world examples, and helpful illustrations.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

t-test Calculator

When to use a t-test, which t-test, how to do a t-test, p-value from t-test, t-test critical values, how to use our t-test calculator, one-sample t-test, two-sample t-test, paired t-test, t-test vs z-test.

Welcome to our t-test calculator! Here you can not only easily perform one-sample t-tests , but also two-sample t-tests , as well as paired t-tests .

Do you prefer to find the p-value from t-test, or would you rather find the t-test critical values? Well, this t-test calculator can do both! 😊

What does a t-test tell you? Take a look at the text below, where we explain what actually gets tested when various types of t-tests are performed. Also, we explain when to use t-tests (in particular, whether to use the z-test vs. t-test) and what assumptions your data should satisfy for the results of a t-test to be valid. If you've ever wanted to know how to do a t-test by hand, we provide the necessary t-test formula, as well as tell you how to determine the number of degrees of freedom in a t-test.

A t-test is one of the most popular statistical tests for location , i.e., it deals with the population(s) mean value(s).

There are different types of t-tests that you can perform:

  • A one-sample t-test;
  • A two-sample t-test; and
  • A paired t-test.

In the next section , we explain when to use which. Remember that a t-test can only be used for one or two groups . If you need to compare three (or more) means, use the analysis of variance ( ANOVA ) method.

The t-test is a parametric test, meaning that your data has to fulfill some assumptions :

  • The data points are independent; AND
  • The data, at least approximately, follow a normal distribution .

If your sample doesn't fit these assumptions, you can resort to nonparametric alternatives. Visit our Mann–Whitney U test calculator or the Wilcoxon rank-sum test calculator to learn more. Other possibilities include the Wilcoxon signed-rank test or the sign test.

Your choice of t-test depends on whether you are studying one group or two groups:

One sample t-test

Choose the one-sample t-test to check if the mean of a population is equal to some pre-set hypothesized value .

The average volume of a drink sold in 0.33 l cans — is it really equal to 330 ml?

The average weight of people from a specific city — is it different from the national average?

Choose the two-sample t-test to check if the difference between the means of two populations is equal to some pre-determined value when the two samples have been chosen independently of each other.

In particular, you can use this test to check whether the two groups are different from one another .

The average difference in weight gain in two groups of people: one group was on a high-carb diet and the other on a high-fat diet.

The average difference in the results of a math test from students at two different universities.

This test is sometimes referred to as an independent samples t-test , or an unpaired samples t-test .

A paired t-test is used to investigate the change in the mean of a population before and after some experimental intervention , based on a paired sample, i.e., when each subject has been measured twice: before and after treatment.

In particular, you can use this test to check whether, on average, the treatment has had any effect on the population .

The change in student test performance before and after taking a course.

The change in blood pressure in patients before and after administering some drug.

So, you've decided which t-test to perform. These next steps will tell you how to calculate the p-value from t-test or its critical values, and then which decision to make about the null hypothesis.

Decide on the alternative hypothesis :

Use a two-tailed t-test if you only care whether the population's mean (or, in the case of two populations, the difference between the populations' means) agrees or disagrees with the pre-set value.

Use a one-tailed t-test if you want to test whether this mean (or difference in means) is greater/less than the pre-set value.

Compute your T-score value :

Formulas for the test statistic in t-tests include the sample size , as well as its mean and standard deviation . The exact formula depends on the t-test type — check the sections dedicated to each particular test for more details.

Determine the degrees of freedom for the t-test:

The degrees of freedom are the number of observations in a sample that are free to vary as we estimate statistical parameters. In the simplest case, the number of degrees of freedom equals your sample size minus the number of parameters you need to estimate . Again, the exact formula depends on the t-test you want to perform — check the sections below for details.

The degrees of freedom are essential, as they determine the distribution followed by your T-score (under the null hypothesis). If there are d degrees of freedom, then the distribution of the test statistics is the t-Student distribution with d degrees of freedom . This distribution has a shape similar to N(0,1) (bell-shaped and symmetric) but has heavier tails . If the number of degrees of freedom is large (>30), which generically happens for large samples, the t-Student distribution is practically indistinguishable from N(0,1).

💡 The t-Student distribution owes its name to William Sealy Gosset, who, in 1908, published his paper on the t-test under the pseudonym "Student". Gosset worked at the famous Guinness Brewery in Dublin, Ireland, and devised the t-test as an economical way to monitor the quality of beer. Cheers! 🍺🍺🍺

Recall that the p-value is the probability (calculated under the assumption that the null hypothesis is true) that the test statistic will produce values at least as extreme as the T-score produced for your sample . As probabilities correspond to areas under the density function, p-value from t-test can be nicely illustrated with the help of the following pictures:

p-value from t-test

The following formulae say how to calculate p-value from t-test. By cdf t,d we denote the cumulative distribution function of the t-Student distribution with d degrees of freedom:

p-value from left-tailed t-test:

p-value = cdf t,d (t score )

p-value from right-tailed t-test:

p-value = 1 − cdf t,d (t score )

p-value from two-tailed t-test:

p-value = 2 × cdf t,d (−|t score |)

or, equivalently: p-value = 2 − 2 × cdf t,d (|t score |)

However, the cdf of the t-distribution is given by a somewhat complicated formula. To find the p-value by hand, you would need to resort to statistical tables, where approximate cdf values are collected, or to specialized statistical software. Fortunately, our t-test calculator determines the p-value from t-test for you in the blink of an eye!

Recall, that in the critical values approach to hypothesis testing, you need to set a significance level, α, before computing the critical values , which in turn give rise to critical regions (a.k.a. rejection regions).

Formulas for critical values employ the quantile function of t-distribution, i.e., the inverse of the cdf :

Critical value for left-tailed t-test: cdf t,d -1 (α)

critical region:

(-∞, cdf t,d -1 (α)]

Critical value for right-tailed t-test: cdf t,d -1 (1-α)

[cdf t,d -1 (1-α), ∞)

Critical values for two-tailed t-test: ±cdf t,d -1 (1-α/2)

(-∞, -cdf t,d -1 (1-α/2)] ∪ [cdf t,d -1 (1-α/2), ∞)

To decide the fate of the null hypothesis, just check if your T-score lies within the critical region:

If your T-score belongs to the critical region , reject the null hypothesis and accept the alternative hypothesis.

If your T-score is outside the critical region , then you don't have enough evidence to reject the null hypothesis.

Choose the type of t-test you wish to perform:

A one-sample t-test (to test the mean of a single group against a hypothesized mean);

A two-sample t-test (to compare the means for two groups); or

A paired t-test (to check how the mean from the same group changes after some intervention).

Two-tailed;

Left-tailed; or

Right-tailed.

This t-test calculator allows you to use either the p-value approach or the critical regions approach to hypothesis testing!

Enter your T-score and the number of degrees of freedom . If you don't know them, provide some data about your sample(s): sample size, mean, and standard deviation, and our t-test calculator will compute the T-score and degrees of freedom for you .

Once all the parameters are present, the p-value, or critical region, will immediately appear underneath the t-test calculator, along with an interpretation!

The null hypothesis is that the population mean is equal to some value μ 0 \mu_0 μ 0 ​ .

The alternative hypothesis is that the population mean is:

  • different from μ 0 \mu_0 μ 0 ​ ;
  • smaller than μ 0 \mu_0 μ 0 ​ ; or
  • greater than μ 0 \mu_0 μ 0 ​ .

One-sample t-test formula :

  • μ 0 \mu_0 μ 0 ​ — Mean postulated in the null hypothesis;
  • n n n — Sample size;
  • x ˉ \bar{x} x ˉ — Sample mean; and
  • s s s — Sample standard deviation.

Number of degrees of freedom in t-test (one-sample) = n − 1 n-1 n − 1 .

The null hypothesis is that the actual difference between these groups' means, μ 1 \mu_1 μ 1 ​ , and μ 2 \mu_2 μ 2 ​ , is equal to some pre-set value, Δ \Delta Δ .

The alternative hypothesis is that the difference μ 1 − μ 2 \mu_1 - \mu_2 μ 1 ​ − μ 2 ​ is:

  • Different from Δ \Delta Δ ;
  • Smaller than Δ \Delta Δ ; or
  • Greater than Δ \Delta Δ .

In particular, if this pre-determined difference is zero ( Δ = 0 \Delta = 0 Δ = 0 ):

The null hypothesis is that the population means are equal.

The alternate hypothesis is that the population means are:

  • μ 1 \mu_1 μ 1 ​ and μ 2 \mu_2 μ 2 ​ are different from one another;
  • μ 1 \mu_1 μ 1 ​ is smaller than μ 2 \mu_2 μ 2 ​ ; and
  • μ 1 \mu_1 μ 1 ​ is greater than μ 2 \mu_2 μ 2 ​ .

Formally, to perform a t-test, we should additionally assume that the variances of the two populations are equal (this assumption is called the homogeneity of variance ).

There is a version of a t-test that can be applied without the assumption of homogeneity of variance: it is called a Welch's t-test . For your convenience, we describe both versions.

Two-sample t-test if variances are equal

Use this test if you know that the two populations' variances are the same (or very similar).

Two-sample t-test formula (with equal variances) :

where s p s_p s p ​ is the so-called pooled standard deviation , which we compute as:

  • Δ \Delta Δ — Mean difference postulated in the null hypothesis;
  • n 1 n_1 n 1 ​ — First sample size;
  • x ˉ 1 \bar{x}_1 x ˉ 1 ​ — Mean for the first sample;
  • s 1 s_1 s 1 ​ — Standard deviation in the first sample;
  • n 2 n_2 n 2 ​ — Second sample size;
  • x ˉ 2 \bar{x}_2 x ˉ 2 ​ — Mean for the second sample; and
  • s 2 s_2 s 2 ​ — Standard deviation in the second sample.

Number of degrees of freedom in t-test (two samples, equal variances) = n 1 + n 2 − 2 n_1 + n_2 - 2 n 1 ​ + n 2 ​ − 2 .

Two-sample t-test if variances are unequal (Welch's t-test)

Use this test if the variances of your populations are different.

Two-sample Welch's t-test formula if variances are unequal:

  • s 1 s_1 s 1 ​ — Standard deviation in the first sample;
  • s 2 s_2 s 2 ​ — Standard deviation in the second sample.

The number of degrees of freedom in a Welch's t-test (two-sample t-test with unequal variances) is very difficult to count. We can approximate it with the help of the following Satterthwaite formula :

Alternatively, you can take the smaller of n 1 − 1 n_1 - 1 n 1 ​ − 1 and n 2 − 1 n_2 - 1 n 2 ​ − 1 as a conservative estimate for the number of degrees of freedom.

🔎 The Satterthwaite formula for the degrees of freedom can be rewritten as a scaled weighted harmonic mean of the degrees of freedom of the respective samples: n 1 − 1 n_1 - 1 n 1 ​ − 1 and n 2 − 1 n_2 - 1 n 2 ​ − 1 , and the weights are proportional to the standard deviations of the corresponding samples.

As we commonly perform a paired t-test when we have data about the same subjects measured twice (before and after some treatment), let us adopt the convention of referring to the samples as the pre-group and post-group.

The null hypothesis is that the true difference between the means of pre- and post-populations is equal to some pre-set value, Δ \Delta Δ .

The alternative hypothesis is that the actual difference between these means is:

Typically, this pre-determined difference is zero. We can then reformulate the hypotheses as follows:

The null hypothesis is that the pre- and post-means are the same, i.e., the treatment has no impact on the population .

The alternative hypothesis:

  • The pre- and post-means are different from one another (treatment has some effect);
  • The pre-mean is smaller than the post-mean (treatment increases the result); or
  • The pre-mean is greater than the post-mean (treatment decreases the result).

Paired t-test formula

In fact, a paired t-test is technically the same as a one-sample t-test! Let us see why it is so. Let x 1 , . . . , x n x_1, ... , x_n x 1 ​ , ... , x n ​ be the pre observations and y 1 , . . . , y n y_1, ... , y_n y 1 ​ , ... , y n ​ the respective post observations. That is, x i , y i x_i, y_i x i ​ , y i ​ are the before and after measurements of the i -th subject.

For each subject, compute the difference, d i : = x i − y i d_i := x_i - y_i d i ​ := x i ​ − y i ​ . All that happens next is just a one-sample t-test performed on the sample of differences d 1 , . . . , d n d_1, ... , d_n d 1 ​ , ... , d n ​ . Take a look at the formula for the T-score :

Δ \Delta Δ — Mean difference postulated in the null hypothesis;

n n n — Size of the sample of differences, i.e., the number of pairs;

x ˉ \bar{x} x ˉ — Mean of the sample of differences; and

s s s  — Standard deviation of the sample of differences.

Number of degrees of freedom in t-test (paired): n − 1 n - 1 n − 1

We use a Z-test when we want to test the population mean of a normally distributed dataset, which has a known population variance . If the number of degrees of freedom is large, then the t-Student distribution is very close to N(0,1).

Hence, if there are many data points (at least 30), you may swap a t-test for a Z-test, and the results will be almost identical. However, for small samples with unknown variance, remember to use the t-test because, in such cases, the t-Student distribution differs significantly from the N(0,1)!

🙋 Have you concluded you need to perform the z-test? Head straight to our z-test calculator !

What is a t-test?

A t-test is a widely used statistical test that analyzes the means of one or two groups of data. For instance, a t-test is performed on medical data to determine whether a new drug really helps.

What are different types of t-tests?

Different types of t-tests are:

  • One-sample t-test;
  • Two-sample t-test; and
  • Paired t-test.

How to find the t value in a one sample t-test?

To find the t-value:

  • Subtract the null hypothesis mean from the sample mean value.
  • Divide the difference by the standard deviation of the sample.
  • Multiply the resultant with the square root of the sample size.

Coffee kick

Mean median mode.

  • Biology (100)
  • Chemistry (100)
  • Construction (144)
  • Conversion (295)
  • Ecology (30)
  • Everyday life (262)
  • Finance (570)
  • Health (440)
  • Physics (510)
  • Sports (105)
  • Statistics (182)
  • Other (182)
  • Discover Omni (40)

null hypothesis paired sample t test

SAS - The One Sample t-Test

  •   Page:
  •   1  
  • |   2  
  • |   3  
  • |   4  
  • |   5  
  • |   6  
  • |   7  
  • |   8  
  • Module 4 - The One Sample t-Test
  • Learning Objectives
  • Inferential Statistics - Hypothesis Testing
  • Components of a statistical test
  • Type I and Type II Errors
  • Standard Normal Distribution
  • Characteristics of the standard normal distribution
  • Area in tails of the distribution
  • Transformation to Standard Normal
  • Distribution of the Sample Mean
  • Using the t-table
  • One-Sample Test of Means
  • One Sample t-test Using SAS:

Paired t-test

Paired t-test using sas:, reporting results.

  • Reference Tables

A paired t-test is used when we are interested in the difference between two variables for the same subject.

Often the two variables are separated by time. For example, in the Dixon and Massey data set we have cholesterol levels in 1952 and cholesterol levels in 1962 for each subject. We may be interested in the difference in cholesterol levels between these two time points.

Null Hypothesis: H 0 : μ d = 0

Alternative Hypothesis: H 1 : μ d ≠ 0

null hypothesis paired sample t test

Test statistic:

null hypothesis paired sample t test

As before, we compare the t-statistic to the critical value of t (which can be found in the table using degrees of freedom and the pre-selected level of significance, α). If the absolute value of the calculated t-statistic is larger than the critical value of t, we reject the null hypothesis.

Confidence Intervals

We can also calculate a 95% confidence interval around the difference in means. The general form for a confidence interval around a difference in means is

null hypothesis paired sample t test

For a two-sided 95% confidence interval, use the table of the t-distribution (found at the end of the section) to select the appropriate critical value of t for the two-sided α=0.05. .

Suppose we wish to determine if the cholesterol levels of the men in Dixon and Massey study changed from 1952 to 1962. We will use the paired t-test. 

  • H 0 : The average difference in cholesterol is 0 from 1952 to 1962
  • H 1 : The average difference in cholesterol is NOT 0 from 1952 to 1962.
  • Our significance level is α = 0.05.

null hypothesis paired sample t test

 For α = 0.05 and 19 df, the critical value of t is 2.093. Since | -6.7| > 2.093, we reject H 0 and state that we have significant evidence that the average difference in cholesterol from 1952 to 1962 is NOT 0. Specifically, there was an average decrease of 69.8 from 1952 to 1962.

To perform a paired t-test in SAS, comparing variables X1 and X2 measured on the same people, you can first create the difference as we did above, and perform a one sample t-test of:

null hypothesis paired sample t test

data pairedtest; set original;

proc ttest data =pairedtest h0 =0;

Hypotheses:

First, create the difference, dchol .

data dm; set dixonmassey;

dchol=chol62-chol52;

proc ttest data =dm;

title 'Paired t-test with proc ttest, using dchol variable' ;

null hypothesis paired sample t test

Again, we reject H 0 (because p<0.05) and state that we have significant evidence that cholesterol levels changed from 1952 to 1962, with an average decrease of 69.8 units, with 95% confidence limits of (-91.6, -48.0) .

Alternatively, we can (only for a test of H 0 : μ d = 0) use proc means :

proc means data =pairedtest n mean std t prt clm ;

title 'Paired t-test with proc means ';

Note that the t option produces the t statistic for testing the null hypothesis that the mean of a variable is equal to zero, and the prt option gives the associated p-value. The clm option produces a 95% confidence interval for the mean. In this case, where the variable is a difference, dchol , the null hypothesis is that the mean difference is zero and the 95% confidence interval is for the mean difference.

proc means data =dm n mean std t prt clm ;

title 'Paired t-test with proc means' ;

null hypothesis paired sample t test

A third method is to use the original data with the paired option in proc t-test:

proc ttest data =original;

title 'Paired t-test with proc ttest, paired statement' ;

paired x1*x2;

This produces identical output to the t-test on dchol.

proc ttest data =work.dm;

paired chol62*chol52;

We conducted a paired t-test to determine whether, on average, there was a change in cholesterol from 1952 to 1962. 

  • H 0 : There is no change, on average, in cholesterol from 1952 to 1962 ( H 0 : μ d = 0 where d = chol62 – chol52).
  • H 1 : There is an average change in cholesterol from 1952 to 1962, i.e., H 0 : μ d ≠ 0 .
  • Level of significance: α=0.05
  • Cholesterol decreased between 1952 and 1962 by an average of 69.8. The 95% confidence interval for μ d is (-91.6,-48.0).
  • The test statistic is t = -6.70, with 19 degrees of freedom, and p < 0.0001. Because the p-value is less than α=0.05, we reject the null hypothesis and state that there is a difference, on average, in cholesterol between 1952 and 1962.
  • Conclusion: There is significant evidence that cholesterol decreased from 1952 to 1962 (p <0.0001). On average, the cholesterol levels in 1962 were 69.8 mg/dl (95% CI: 48.0, 91.6) units lower than the cholesterol levels in 1952.

Note that this report includes:

  • The name of the test being used
  • A statement of the null hypothesis and alternative hypothesis in terms of the population parameter of interest.
  • The magnitude, direction, and units of the effect (observed mean difference).
  • a 69.8 unit mean decrease from 1952 to 1962
  • Note, this should be reported regardless of whether or not it is statistically significant!
  • The test statistic and corresponding degrees of freedom.
  • A statement of whether the effect (observed difference) is statistically significant and the significance level (α)
  • This decrease was significant at the α = 0.05 level.
  • The p-value for the test, p < 0.0001
  • Conclusion that summarizes the results and what they mean.

return to top | previous page | next page

IMAGES

  1. Paired t-Test (Dependent Samples)

    null hypothesis paired sample t test

  2. Paired Sample T-Test

    null hypothesis paired sample t test

  3. Paired sample t test overview

    null hypothesis paired sample t test

  4. Hypothesis Testing: Upper, Lower, and Two Tailed Tests

    null hypothesis paired sample t test

  5. Paired Sample T-Test

    null hypothesis paired sample t test

  6. Null hypothesis for paired sample t-test

    null hypothesis paired sample t test

VIDEO

  1. Hypothesis t-tests on statistical data in origin

  2. Paired or Unpaired Student's T test for two samples in STATA

  3. How to do a Paired/Matched Sample T-Test

  4. Statistics 101: Single Sample Hypothesis t-test Examples

  5. t test for hypothesis testing

  6. Hypothesis testing Two Population Means

COMMENTS

  1. Paired Samples t-test: Definition, Formula, and Example

    A paired samples t-test is used to compare the means of two samples when each observation in one sample can be paired with an observation in the other sample. ... 0.05, and 0.01) then you can reject the null hypothesis. Paired Samples t-test: Assumptions. For the results of a paired samples t-test to be valid, the following assumptions should ...

  2. Paired T Test: Definition & When to Use It

    Null hypothesis: The mean of the paired differences equals zero in the population. ... For a paired sample t test, if you have at least 20 subjects, your test results will be reliable even when your data are skewed. However, when you have a smaller sample size, nonnormal data can cause the test results to be unreliable. ...

  3. T Test Overview: How to Use & Examples

    We'll use a two-sample t test to evaluate if the difference between the two group means is statistically significant. The t test output is below. In the output, you can see that the treatment group (Sample 1) has a mean of 109 while the control group's (Sample 2) average is 100. The p-value for the difference between the groups is 0.112.

  4. 10.3

    The value of the test statistic is: t = − 14.4 − 0 6.77 / 10 = − 6.73. The critical region approach tells us to reject the null hypothesis at the α = 0.01 level if t > t 0.005, 9 = 3.25 or if t < t 0.005, 9 = − 3.25. Therefore, we reject the null hypothesis because t = − 6.73 < − 3.25, and therefore falls in the rejection region.

  5. SPSS Paired Samples T-Test

    Generally, the null hypothesis for a paired samples t-test is that 2 variables have equal population means. Now, we don't have data on the entire student population. We only have a sample of N = 19 students and sample outcomes tend to differ from population outcomes. So even if the population means are really equal, our sample means may differ ...

  6. 11.5: The Paired-samples t-test

    So, to convert this to a hypothesis test, our null hypothesis is that this mean difference is zero; the alternative hypothesis is that it is not: ... ## ## Paired samples t-test ## ## Outcome variable: grade ## Grouping variable: time ## ID variable: id ## ## Descriptive statistics: ## test1 test2 difference ## mean 56.980 58.385 -1.405 ## std ...

  7. How t-Tests Work: 1-sample, 2-sample, and Paired t-Tests

    A paired t-test takes paired observations (like before and after), subtracts one from the other, and conducts a 1-sample t-test on the differences. Typically, a paired t-test determines whether the paired differences are significantly different from zero. Download the CSV data file to check this yourself: T-testData.

  8. An Introduction to t Tests

    Revised on June 22, 2023. A t test is a statistical test that is used to compare the means of two groups. It is often used in hypothesis testing to determine whether a process or treatment actually has an effect on the population of interest, or whether two groups are different from one another. t test example.

  9. Paired Samples T-Test

    The Paired Samples T-Test is a statistical test used to determine if 2 paired groups are significantly different from each other on your variable of interest. Your variable of interest should be continuous, be normally distributed, and have a similar spread between your 2 groups. Your 2 groups should be paired (often two observations from the ...

  10. SPSS Tutorials: Paired Samples t Test

    The purpose of the test is to determine whether there is statistical evidence that the mean difference between paired observations is significantly different from zero. The Paired Samples t Test is a parametric test. This test is also known as: Dependent t Test. Paired t Test. Repeated Measures t Test. The variable used in this test is known as ...

  11. Paired Sample T-Test

    Otherwise, an upper-tailed or lower-tailed hypothesis can be used to increase the power of the test. The null hypothesis remains the same for each type of alternative hypothesis. The paired sample t-test hypotheses are formally defined below: • The null hypothesis (\(H_0\)) assumes that the true mean difference (\(\mu_d\)) is equal to zero.

  12. Understanding t-Tests: 1-sample, 2-sample, and Paired t-Tests

    The paired t-test and the 1-sample t-test are actually the same test in disguise! As we saw above, a 1-sample t-test compares one sample mean to a null hypothesis value. A paired t-test simply calculates the difference between paired observations (e.g., before and after) and then performs a 1-sample t-test on the differences.

  13. Paired Sample T Test in SPSS

    The Hypothesis of Paired Samples T Test. Moving on to the formulation of hypotheses in the Paired Samples T Test; The null hypothesis (H0): there is no significant difference between the means of the paired observations. The alternative hypothesis (H1): there is a significant difference between the means of the paired observations.

  14. Paired T-Test: A Comprehensive Guide

    The paired samples t-test is predicated on two core hypotheses: the null hypothesis (H₀) and the alternative hypothesis (H₁). Null Hypothesis (H₀): This hypothesis posits that there is no significant difference between the paired observations.

  15. Example of hypotheses for paired and two-sample t tests

    First of all, if you have two groups, one testing one placebo, then it's 2 samples. If it is the same group before and after, then paired t-test. I'm trying to run a dependent sample t-test/paired sample t test through using data from a Qualtrics survey measuring two groups of people (one with social anxiety and one without on the effects of ...

  16. T Test (Student's T-Test): Definition and Examples

    The null hypothesis for the independent samples t-test is μ 1 = μ 2. So it assumes the means are equal. With the paired t test, the null hypothesis is that the pairwise difference between the two tests is equal (H 0: µ d = 0). Paired Samples T Test By hand. Example question: Calculate a paired t test by hand for the following data:

  17. Dependent t-test for paired samples (cont...)

    The dependent t-test is testing the null hypothesis that there are no differences between the means of the two related groups. If we get a statistically significant result, we can reject the null hypothesis that there are no differences between the means in the population and accept the alternative hypothesis that there are differences between ...

  18. Paired samples t-test

    In the paired samples t-test the null hypothesis is that the average of the differences between the paired observations in the two samples is zero. If the calculated P-value is less than 0.05, the conclusion is that, statistically, the mean difference between the paired observations is significantly different from 0.

  19. Hypothesis Test: Paired Means

    This lesson explains how to conduct a hypothesis test for the difference between paired means. The test procedure, called the matched-pairs t-test, is appropriate when the following conditions are met: The sampling method for each sample is simple random sampling. The test is conducted on paired data. (As a result, the data sets are not ...

  20. How to Perform a Paired Samples t-test in R

    To conduct a paired t-test, we can use the following approach: Step 1: State the null and alternative hypotheses. H0: μd = 0. where μd is the mean difference. Step 2: Find the test statistic and corresponding p-value. Let a = the student's score on the first test and b = the student's score on the second test.

  21. t-test Calculator

    A one-sample t-test (to test the mean of a single group against a hypothesized mean); A two-sample t-test (to compare the means for two groups); or. A paired t-test (to check how the mean from the same group changes after some intervention). Decide on the alternative hypothesis: Two-tailed; Left-tailed; or. Right-tailed.

  22. Paired t-test

    Paired t-test. A paired t-test is used when we are interested in the difference between two variables for the same subject. Often the two variables are separated by time. For example, in the Dixon and Massey data set we have cholesterol levels in 1952 and cholesterol levels in 1962 for each subject. We may be interested in the difference in ...

  23. Dependent and Independent t-Test: Procedures & Examples

    Dependent t-test for paired samples • Assumptions: - The data follow a normal distribution (but we have limited samples from the normal distribution and we use t to describe the limited samples) - The individual samples from each pair are independent. • Hypotheses: - Null hypothesis: the distribution of differences between the two pairs of samples has central value zero.

  24. Independent Samples T Test: Definition, Using & Interpreting

    Independent Samples T Tests Hypotheses. Independent samples t tests have the following hypotheses: Null hypothesis: The means for the two populations are equal. Alternative hypothesis: The means for the two populations are not equal.; If the p-value is less than your significance level (e.g., 0.05), you can reject the null hypothesis. The difference between the two means is statistically ...