---
title: "The Paired T-test"
slug: "paired-t-test"
updated: 2025-03-13T12:19:56Z
published: 2025-03-13T12:19:56Z
canonical: "userguide.dataclassroom.com/paired-t-test"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://userguide.dataclassroom.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Paired T-test

The standard T-test assumes that all samples are drawn at random from a population. But this may not be the case.

For example, you might select test subjects at random, but then perform **two** measurements on **each subject**, for example both before and after a medical treatment.

This is called a **Paired T-test** (or a dependent sample T-test).

This pairing makes the test more powerful than the standard T-test, as there is no random variation **between** subjects - the focus can be on the difference measured for **each** subject.

The 'Identifier' variable typeThe Paired T-test is unique in that it uses a variable type called '**Identifier**' for the column with the variable that identifies the subject.

### How to perform a Paired T-test

Your data table will need three variables, as compared to two for the standard T-test:

- The **Numeric** Dependent variable (value being measured)
- A **Categorical** Independent Variable (grouping the samples into the two groups being compared)
- An **Identifier** variable, which for each sample identifies which test subject has been measured

![](https://cdn.document360.io/62f8f41e-e041-42c4-b9bc-8ae1eb45d064/Images/Documentation/image-1675747884750.png)

These can then be visualized as a dot plot in one of two ways, either with the **Identifier** as the Z axis:

![](https://cdn.document360.io/62f8f41e-e041-42c4-b9bc-8ae1eb45d064/Images/Documentation/image-1675773311335.png)

Or with the **Identifier** as the X axis:

![](https://cdn.document360.io/62f8f41e-e041-42c4-b9bc-8ae1eb45d064/Images/Documentation/image-1675773399490.png)

Both of these visualizations can give you an idea of whether there is a visible effect of the treatment.

### Running the test

Then you can run a Graph-Driven **Paired T-test** on the data. [See how to do this here](/v1/docs/graph-driven-tests). **NOTE: you'll need to check the "Advanced ..." box**.

You can also run this test directly from the Hypothesis test option on the left-hand menu [as described here](/v1/docs/hypothesis-tests).
