Paired t-Test Principles, Calculations, and Software Analysis

Foundations and Principles of the Paired t-Test

  • Conceptual Definition:

    • A paired tt-test is a specific application and special case of the single-sample tt-test.

    • Instead of evaluating two entirely independent groups, the test evaluates two sets of measurements collected from matched samples or paired observations.

    • In most research configurations, measurements are taken on the exact same experimental unit under two distinct conditions or points in time.

    • Common experimental scenarios include:

    • Before-and-after studies (evaluating an intervention on the same subject).

    • Diurnal comparisons (such as comparing daytime measurements against nighttime measurements on the same subject).

  • Reduction to a Single-Sample Framework:

    • While frequently treated as an independent statistical procedure, the paired tt-test mathematically converts paired bivariate data into a single sample of univariate differences.

    • The core variable of interest is not the raw measurement in condition 11 or condition 22, but rather the calculated difference (DIFF\text{DIFF}) between the paired observations for each individual unit.

    • Once these differences are determined, the analysis proceeds identically to a standard one-sample tt-test performed on the newly derived sample of differences.

  • Underlying Assumptions:

    • Random sampling: The pairs of observations must represent a random sample drawn from the target population.

    • Normality of differences: The sample of differences (DIFF\text{DIFF}) must be normally distributed in the underlying population.

Experimental Design and Stair-Climbing Case Study

  • Research Question:

    • The objective is to determine whether physical exertion affects cardiovascular response, specifically asking: Does climbing stairs affect heart rate?

    • Although a directional hypothesis (e.g., climbing stairs increases heart rate) is biologically plausible and corresponds to a one-tailed test, the analysis is initially framed as a non-directional, two-tailed inquiry (does climbing stairs affect heart rate in either direction).

  • Experimental Protocol:

    • A cohort of n=8n = 8 subjects has their resting heart rates measured before physical activity.

    • Each subject climbs three flights of stairs.

    • Immediately following the stair climb, each subject's heart rate is measured a second time.

  • Baseline Data Matrix:

    • Subject 11 (Bob): Heart rate before climbing = 6262, Heart rate after climbing = 7373.

    • Subject 22 (Sally): Heart rate before climbing = 5858, Heart rate after climbing = 6666.

    • Subject 33 (Meghan): Heart rate before climbing = 7070, Heart rate after climbing = 7272.

    • Subject 44 (Bill): Heart rate before climbing = 7575, Heart rate after climbing = 7575.

    • Subject 55 (Harriet): Heart rate before climbing = 6464, Heart rate after climbing = 7878.

    • Subject 66 (Mary): Heart rate before climbing = 6060, Heart rate after climbing = 5959.

    • Subject 77 (Carl): Heart rate before climbing = 7575, Heart rate after climbing = 8181.

    • Subject 88 (Sid): Heart rate before climbing = 5858, Heart rate after climbing = 6262.

Formulation of Hypotheses and Test Setup

  • Defining the Difference Variable:

    • The difference metric is explicitly defined as:     DIFF=(Heart Rate After)−(Heart Rate Before)\text{DIFF} = (\text{Heart Rate After}) - (\text{Heart Rate Before})

    • Under this directional subtraction:

    • A positive difference (DIFF>0\text{DIFF} > 0) indicates an increase in heart rate following stair climbing.

    • A negative difference (DIFF<0\text{DIFF} < 0) indicates a decrease in heart rate following stair climbing.

    • A difference of zero (DIFF=0\text{DIFF} = 0) indicates no change in heart rate.

  • Statistical Hypotheses:

    • Null Hypothesis (H0H_0): There is no true difference in mean heart rate before and after climbing stairs across the population.     H0:μd=0H_0: \mu_d = 0

    • Alternative Hypothesis (HaH_a or H1H_1): There is a statistically significant difference in mean heart rate before and after climbing stairs.     Ha:μd≠0H_a: \mu_d \neq 0

    • Here, μd\mu_d represents the population mean of the paired differences.

  • Significance Level and Tail Configuration:

    • The significance threshold is set at α=0.05\alpha = 0.05.

    • Because the alternative hypothesis tests for any change (μd≠0\mu_d \neq 0), the test is two-tailed, splitting the rejection region into two equal tails of area α2=0.025\frac{\alpha}{2} = 0.025 each.

Hypothesis testing critical regions and tail distributions
  • General Forms of Hypothesis Tests for Means:

    • Two-tailed test:     H0:μ=μ0H_0: \mu = \mu_0     Ha:μ≠μ0H_a: \mu \neq \mu_0     Rejection regions are placed symmetrically in both tails beyond −t∗-t^* and +t∗+t^*.

  • Right-tailed (upper-tail) test:   H0:μ≤μ0H_0: \mu \le \mu_0   Ha:μ>μ0H_a: \mu > \mu_0   Rejection region is located entirely in the right tail beyond +t∗+t^*.

  • Left-tailed (lower-tail) test:   H0:μ≥μ0H_0: \mu \ge \mu_0   Ha:μ<μ0H_a: \mu < \mu_0   Rejection region is located entirely in the left tail beyond −t∗-t^*.

Critical Values, Decision Rules, and Sampling Distribution

  • Degrees of Freedom:

    • The degrees of freedom (dfdf) for a paired tt-test are determined by the number of paired differences minus one:     df=n−1=8−1=7df = n - 1 = 8 - 1 = 7

  • Critical Value Identification:

    • Evaluating the Student's tt-distribution table with df=7df = 7 and an upper tail probability of 0.0250.025 (corresponding to a two-tailed confidence level of 95%95\% or α=0.05\alpha = 0.05):     t∗=2.365t^* = 2.365

    • Because the test is two-tailed, the two critical thresholds are:     −t∗=−2.365-t^* = -2.365     +t∗=+2.365+t^* = +2.365

Student's t-distribution critical values table
  • Statistical Decision Criteria:

    • If the calculated test statistic satisfies t<−2.365t < -2.365 or t>2.365t > 2.365, the test statistic falls into the rejection region.

    • Falling in the critical region indicates that the probability of observing such extreme differences under the assumption of a true null hypothesis is less than 5%5\% (p<0.05p < 0.05).

    • Decision rule: Reject H0H_0 in favor of HaH_a if ∣t∣>2.365|t| > 2.365. Fail to reject H0H_0 if −2.365≤t≤2.365-2.365 \le t \le 2.365.

Manual Step-by-Step Mathematical Calculation

  • Test Statistic Formula:

    • The general test statistic for a sample of differences is:     t=dˉ−μ0sdnt = \frac{\bar{d} - \mu_0}{\frac{s_d}{\sqrt{n}}}

    • Where:

    • dˉ\bar{d} is the sample mean of the differences.

    • μ0\mu_0 is the hypothesized population difference under the null hypothesis (typically μ0=0\mu_0 = 0).

    • sds_d is the sample standard deviation of the differences.

    • nn is the total number of paired units (n=8n = 8).

    • sdn\frac{s_d}{\sqrt{n}} represents the estimated standard error of the mean difference (SEdˉSE_{\bar{d}}).

    • Setting μ0=0\mu_0 = 0, the formula reduces to:     t=dˉsdnt = \frac{\bar{d}}{\frac{s_d}{\sqrt{n}}}

  • Subject-Level Differences:

    • Bob: DIFF=73−62=9\text{DIFF} = 73 - 62 = 9 (recorded manually as 99)

    • Sally: DIFF=66−58=8\text{DIFF} = 66 - 58 = 8

    • Meghan: DIFF=72−70=2\text{DIFF} = 72 - 70 = 2

    • Bill: DIFF=75−75=0\text{DIFF} = 75 - 75 = 0

    • Harriet: DIFF=78−64=14\text{DIFF} = 78 - 64 = 14

    • Mary: DIFF=59−60=−1\text{DIFF} = 59 - 60 = -1

    • Carl: DIFF=81−75=6\text{DIFF} = 81 - 75 = 6

    • Sid: DIFF=62−58=4\text{DIFF} = 62 - 58 = 4

  • Manual Sample Summary Statistics:

    • Sample size: n=8n = 8

    • Sample mean difference: dˉ=5.25\bar{d} = 5.25

    • Sample standard deviation of differences: sd=5.04s_d = 5.04

  • Evaluation of the Test Statistic:

    • Standard error denominator:     SEdˉ=5.048SE_{\bar{d}} = \frac{5.04}{\sqrt{8}}

    • Substitution into the tt-ratio:     t=5.255.048=2.94t = \frac{5.25}{\frac{5.04}{\sqrt{8}}} = 2.94

  • Hypothesis Decision:

    • Comparing the calculated statistic to the critical value:     t=2.94>2.365t = 2.94 > 2.365

    • The test statistic falls deep within the upper rejection tail.

    • Conclusion: Reject H0H_0. There is statistically significant evidence at the α=0.05\alpha = 0.05 level that climbing stairs affects heart rate.

Implementation and Analysis in Microsoft Excel

  • Data Arrangement:

    • Column A: Subject identifiers (Name), rows 22 through 99.

    • Column B: Baseline measurements (Before), rows 22 through 99.

    • Column C: Post-intervention measurements (After), rows 22 through 99.

  • Software Navigation:

    • Navigate through the Excel ribbon to the Data tab.

    • Within the Analysis group, select Data Analysis.

    • From the list of analysis tools, choose t-Test: Paired Two Sample for Means and click OK.

Excel Paired Two Sample for Means dialog box configuration
  • Parameter Configuration:

    • Variable 1 Range: $C$1:$C$9 (corresponding to the After column, including header label).

    • Variable 2 Range: $B$1:$B$9 (corresponding to the Before column, including header label).

    • Hypothesized Mean Difference: leave blank or enter 0.

    • Labels: select the checkbox (indicating row 11 contains column headers).

    • Alpha: 0.05.

    • Output options: select New Worksheet Ply and title it Paired t-test results.

  • Excel Computational Output:

    • Mean: After = 70.7570.75, Before = 65.2565.25

    • Variance: After = 59.9285759.92857, Before = 51.0714351.07143

    • Observations: After = 88, Before = 88

    • Pearson Correlation: 0.750140.75014

    • Hypothesized Mean Difference: 00

    • df: 77

    • t Stat: 2.9398742.939874

    • P(T<=t) one-tail: 0.0108590.010859

    • t Critical one-tail: 1.8945791.894579

    • P(T<=t) two-tail: 0.0217170.021717

    • t Critical two-tail: 2.3646242.364624

  • Interpretation of Excel Output:

    • The two-tailed pp-value is 0.0217170.021717.

    • Because p=0.021717<0.05p = 0.021717 < 0.05, the null hypothesis is rejected.

    • The calculated tt-statistic of 2.9398742.939874 exceeds the critical threshold of 2.3646242.364624.

Implementation and Analysis in Minitab

  • Worksheet Setup:

    • Column C1-T: Name (Bob, Sally, Meghan, Bill, Harriet, Mary, Carl, Sid).

    • Column C2: Before (6262, 5858, 7070, 7575, 6464, 6060, 7575, 5858).

    • Column C3: After (7373, 6666, 7272, 7575, 7878, 5959, 8181, 6262).

  • Menu Pathway and Dialog Options:

    • Menu path: Stat -> Basic Statistics -> Paired t....

    • In the primary dialog window:

    • Choose the radio button Samples in columns.

    • Set First sample: After.

    • Set Second sample: Before.

    • (Minitab evaluates the paired test as first sample minus second sample).

    • Click the Options... sub-menu:

    • Confidence level: 95.0.

    • Test mean: 0.0.

    • Alternative: select not equal.

    • Confirm by selecting OK in both dialogs.

Minitab Paired t options dialog box configuration
  • Minitab Session Window Output:

    • Paired TT for After - Before:

    • After: N=8N = 8, Mean=70.7500\text{Mean} = 70.7500, StDev=7.7414\text{StDev} = 7.7414, SE Mean=2.7370\text{SE Mean} = 2.7370

    • Before: N=8N = 8, Mean=65.2500\text{Mean} = 65.2500, StDev=7.1464\text{StDev} = 7.1464, SE Mean=2.5266\text{SE Mean} = 2.5266

    • Difference: N=8N = 8, Mean=5.50000\text{Mean} = 5.50000, StDev=5.29150\text{StDev} = 5.29150, SE Mean=1.87083\text{SE Mean} = 1.87083

    • 95%95\% Confidence Interval for mean difference:     (1.07619,9.92381)(1.07619, 9.92381)

    • TT-Test of mean difference = 00 (vs not = 00):

    • T-Value=2.94T\text{-Value} = 2.94

    • P-Value=0.022P\text{-Value} = 0.022

Graphical Interpretation and Final Conclusions

Boxplot of differences with null hypothesis and 95 percent confidence interval
  • Visual Analysis of the Boxplot of Differences:

    • The boxplot displays the distribution of the eight difference scores along an axis spanning from −2-2 to 1414.

    • The median difference lies near 55.

    • The sample mean difference is marked at Xˉ=5.5\bar{X} = 5.5.

    • The horizontal blue interval bracket denotes the 95%95\% tt-confidence interval for the true mean difference, spanning from 1.081.08 to 9.929.92.

    • The null hypothesis value (H0=0H_0 = 0) is plotted as a red crossed circle at 00.

    • Because the null value (00) falls completely outside the 95%95\% confidence interval boundary (1.08,9.921.08, 9.92), the null hypothesis is rejected at the α=0.05\alpha = 0.05 level.

  • Synthesis of Test Results Across Methods:

    • Manual calculation: t=2.94t = 2.94, exceeding the critical value t∗=2.365t^* = 2.365.

    • Excel analysis: t=2.939874t = 2.939874, critical t=2.364624t = 2.364624, p=0.021717p = 0.021717.

    • Minitab analysis: t=2.94t = 2.94, p=0.022p = 0.022, 95%95\% CI: (1.07619,9.92381)(1.07619, 9.92381).

    • All computational methods provide consistent and conclusive statistical evidence rejecting the null hypothesis, confirming that climbing stairs produces a statistically significant change in heart rate.

Lecture

Paired t-test looks at two sets of measurements on MATCHED samples; meaning its the same measurements; kinda like a before and after, daytime and nighttime. Single sample of DIFFERENCES.

Calculating t:

  • t=xdiff‾−μ0diffsdiffnt=\frac{\overline{x_{diff}}-\mu_{0 diff}}{\frac{s_{diff}}{\sqrt{n}}}

  • μ\mu will usually be 0, so it can be dropped from the equation.

For Minitab

  • Go to Basic Statistics

  • Choose Paired T-test

  • It will subtract second sample from first sample; First sample should be for “AFTER” data, and the second sample for “BEFORE” data

  • Go into options to determine the parameters and what type of tailed test