- Home
- Appointment Information
- Workshops
- Information for Staff
- Stats ResourcesToggle Dropdown
- Stats with SPSSToggle Dropdown
- Independent-Samples t-Test
- Paired-Samples t-Test
- Mann Whitney U-Test
- Wilcoxon Signed-Ranks Test
- One-Way Between-Subjects ANOVA
- One-Way Repeated-Measures ANOVA
- Two-Way Mixed ANOVA
- One-Way Between-Subjects ANCOVA
- Kruskal Wallis H-Test
- Friedman's ANOVA
- Pearson's 'r' Correlation
- Spearman's Rho Correlation
- Simple Linear Regression
- Multiple Linear Regression
- Chi-Squared (χ2) Test of Association
- Shapiro-Wilk Test of Normality
- Cronbach's Alpha

- Stats with R
- Stats with JamoviToggle Dropdown
- Maths ResourcesToggle Dropdown
- Numeracy ResourcesToggle Dropdown
- Stats/Maths Software
- A-Z of Terminology
- Meet the Team

A Paired-Samples t-Test compares the means between two related groups, such as comparing the difference between pre-intervention and post-intervention test results.

It is considered a parametric test and is only suitable for parametric data. To check if your data is parametric, please check out the dedicated guide: **Parametric or Not Guide (PDF)**

If your data is non-parametric you should consider using a **Wilcoxon Test**.

This is used for when the data is structured using a grouping variable. A grouping variable is a categorical variable indicating which scores belong to different groups.

Data:

The first argument entered in the t.test() function is a formula that takes the following structure:

dependent variable ~ independent variable

The second argument is the data frame.

The third argument needs to be “paired = TRUE”. The t.test() function runs an independent-samples t-test by default, this is why we need to specify the option in order for it to run a paired-samples t-test.

`t.test(test_score ~ test_time, before_after1, paired = TRUE)`

```
##
## Paired t-test
##
## data: test_score by test_time
## t = -2.5965, df = 19, p-value = 0.01772
## alternative hypothesis: true mean difference is not equal to 0
## 95 percent confidence interval:
## -7.7662346 -0.8337654
## sample estimates:
## mean difference
## -4.3
```

This method is used when your data is structured into two separate variables. Both of your variables should be numeric.

Data:

Put both of your variables in the t.test() function in any order. The first variables will be subtracted from the second one in order to calculate the mean difference. If you have your variables stored in a data frame, use the following structure to indicate the variable: data_frame$variable_name

The third argument needs to be “paired = TRUE”. The t.test() function runs an independent-samples t-test by default, this is why we need to specify the option in order for it to run a paired-samples t-test.

`t.test(before_after2$before, before_after2$after, paired = TRUE)`

```
##
## Paired t-test
##
## data: before_after2$before and before_after2$after
## t = -2.5965, df = 19, p-value = 0.01772
## alternative hypothesis: true mean difference is not equal to 0
## 95 percent confidence interval:
## -7.7662346 -0.8337654
## sample estimates:
## mean difference
## -4.3
```

R will generate largely the same output for both formula and variables methods.

The results show the mean differece between the two conditions, but no means and standard deviations for each condition. As they are are commonly reported, please check our guide on **descriptive statistics**.

This table shows the specific test results including the t-statistic (t), the degrees of freedom (df) the two-tailed significance or p-value (Two-Sided p), and the 95% Confidence Interval (95% Confidence Interval of the Difference).

As both variables are measurements coming from the same sample at different times (repeated measures), we assume that the variances are equal by default.

*M* = 73.30, *SD* = 11.91) after the intervention than before (*M *= 69.00, *SD* = 6.64). A Paired-Samples t-Test indicated this difference, *d̄ =* 4.30, 95%*CI *[0.83, 7.77] was statistically significant, *t *(19) = 2.60, *p *= .018.

- Last Updated: Apr 12, 2024 5:49 PM
- URL: https://guides.library.lincoln.ac.uk/mash
- Print Page

© University of Lincoln