Paired t-Test A paired t-test is a statistical test used to compare the means of two related samples or matched pairs. It is used to test a hypothesis about the difference between the means of the two samples. It is based on the assumption that the differences between the pairs are normally distributed.

## Dependent vs Independent Samples

There are two types of two-sample t-tests: dependent and independent.

In an **independent two-sample t-test** (also known as an unpaired t-test), the samples in the two groups being compared are unrelated. The samples are drawn from two different populations or groups of subjects, and the difference between the means of the two groups is calculated using the means and variances of the two separate samples. **A separate post covers the independent two-sample t-test****.**

In a **dependent two-sample t-test **(also known as a **paired t-test**), the samples in the two groups being compared are related in some way. For example, the samples may be pairs of measurements taken on the same subjects or on subjects who are closely matched in some other way. In this case, the difference between the means of the two groups is calculated by taking the differences between the pairs of measurements and treating these differences as a single sample. **This post covers the paired t-test or dependent two-sample t-test.**The choice between a dependent or independent t-test depends on the nature of your data and the research question you are trying to answer.

## Steps in Paired t Test

To conduct a paired t-test, the following steps are typically followed:

**Specify the null and alternative hypotheses.**The null hypothesis is usually that there is no difference between the means of the two samples, while the alternative hypothesis is that there is a difference between the means.**Collect data for the two related samples or matched pairs**.- Calculate the
**differences between the pairs**and**find the mean and standard deviation of the differences**. **Calculate the test statistic,**which is the difference between the means of the two samples, divided by the standard error of the mean.**Determine the****critical value of the test statistic**based on the significance level (alpha) of the test and the degrees of freedom. The degrees of freedom are calculated as the sample size minus 1.**Compare the calculated test statistic to the critical value**to determine whether to reject or fail to reject the null hypothesis. If the calculated test statistic exceeds the critical value, the null hypothesis is rejected, and the alternative hypothesis is accepted.

## Conditions for Paired t-Test

To conduct a valid paired t-test, the following conditions must be met:

- The samples must be related or matched in some way.
- The differences between the pairs must be approximately normally distributed.
- The population standard deviation of the differences is unknown, and the sample size is small (less than 30).

## Typical Null and Alternate Hypothesis in Paired t-test

**a) Two-Tail Test: **

In a paired t-test, the null hypothesis is that there is no average difference between the two samples. This can be expressed as:

H0: μ1 - μ2 = 0

where μ1 is the mean of the first sample and μ2 is the mean of the second sample.

The alternate hypothesis is the opposite of the null hypothesis and is that there is a difference between the means of the two samples. This can be expressed as:

Ha: μ1 - μ2 ≠ 0

**b) Left Tail Test: **

A left-tailed hypothesis is one in which the mean of the first sample is less than the mean of the second sample. This can be expressed as:

H0: μ1 - μ2 >= 0

Ha: μ1 - μ2 < 0

**c) Right Tail Test: **

A right-tailed hypothesis is one in which the mean of the first sample is greater than the mean of the second sample. This can be expressed as:

H0: μ1 - μ2 <= 0

Ha: μ1 - μ2 > 0

## Calculating Test Statistic

The t-score represents the number of standard errors that the difference between the means of the two samples from zero. It is used to determine whether the difference between the means is statistically significant.

The formula for calculating the t-score in a paired t-test is as follows:

$$\LARGE{t = \frac{\bar{d}}{\frac{s_d}{\sqrt{n}}}}$$

where:

- \(\bar{d}\) is the mean of the difference scores
- \(s_d\) is the standard deviation of the difference scores
- \(n\) is the number of pairs of observations

## Paired T-Test Calculator:

Paired T Test (Dependent Samples)

## Paired T-Test Calculator

## Calculating Critical Values

The critical values for the t-score in a paired t-test depend on the degrees of freedom and the significance level of the test. The degrees of freedom are calculated as the sample size minus 1. Using these two values (significance level and degrees of freedom), you can find out the value of critical test statistic.

In addition, you can use Microsoft Excel (or other statistical software) to find out the critical value. In Excel, you can use =T.INV(probability, deg_freedom) for left tail value or =T.INV.2T(probability, deg_freedom) for two tail values.

For example, if you are performing a left-tail t-test with a 95% confidence level (that means the alpha value of 0.05) and in the experiment you had 4 pairs (that means 3 degrees of freedom), you can use =T.INV.2T(0.05, 3) to determine the critical value.

## Interpreting the Results

Once you have calculated the test statistic and critical value, you can compare them to determine whether to reject or fail to reject the null hypothesis. If the calculated test statistic is greater than the critical value, you can reject the null hypothesis and accept the alternative hypothesis. This means that there is a statistically significant difference between the means of the two samples.