What is a Two Sample T Hypothesis Test?

Two sample t hypothesis tests, also called independent t-tests, check whether two population means differ. Use one when you compare samples from two independent groups and you don’t know the population standard deviations. The test statistic follows the t distribution.

Assumptions of Two Sample T Hypothesis Tests

  • Each sample is randomly selected from its population
  • The samples are independent of each other
  • Population standard deviations are unknown (there is no rule that each sample must be smaller than 30)
  • Each population is roughly normal. With larger samples, the test still holds up well when it is not.

When Would You Use a Two Sample T Hypothesis Tests?

Use the two sample t test to compare two process means, when the data have one nominal variable (the group) and one measurement variable. It is a hypothesis test of means. Use the two sample Z test only when both population standard deviations are known.

The two sample hypothesis t test is used to compare two population means, while analysis of variance (ANOVA) is the usual choice for more than two group means.

Run a two sample t test when the two groups are independent. If the same units are measured twice, or the groups are matched, use the paired t-test instead.

Two Types of Two Sample T Hypothesis Tests

  • Two Sample T Hypothesis Test (Equal Variance)
    • The two population variances are equal (pooled test)
  • Two Sample T Hypothesis Test (Unequal Variance)
    • The two population variances are not equal (Welch’s test)

How to Tell if the Population Variances Are Equal

Use an F-test when both samples are normal. Use Levene’s test when they are not. If unsure, use the unequal variance (Welch) test.

Hypothesis Testing

A hypothesis is a claim about a population parameter. The claim may or may not be true. In a tailed hypothesis test, the tail is where the rejection region sits. One-tailed hypothesis is a test of hypothesis where the area of rejection is only in one direction. Whereas two-tailed, the area of rejection is in two directions. The selection of one or two-tailed tests depends upon the problem.

  • Null hypothesis H0: the population means are the same, or their difference equals a hypothesized difference d. So Β΅1 = Β΅2, or Β΅1 βˆ’ Β΅2 = d
  • Alternative hypothesis H1: Β΅1 β‰  Β΅2, or Β΅1 βˆ’ Β΅2 β‰  d (two-tailed test)
  • Β΅1 < Β΅2, or Β΅1 βˆ’ Β΅2 < d (left-tailed)
  • Β΅1 > Β΅2, or Β΅1 βˆ’ Β΅2 > d (right-tailed)

Two Sample T Hypothesis Test (Equal Variance) Formula

Two Sample T Hypothesis Tests
  • Where n1 and n2 are sample sizes
  • xΜ…1 and xΜ…2 are the sample means
  • Sp is the pooled standard deviation: Sp = √[((n1 βˆ’ 1)S12 + (n2 βˆ’ 1)S22) / (n1 + n2 βˆ’ 2)]

Steps to Calculate Two Sample T Hypothesis Test (Equal Variance)

  • State the claim of the test and determine the null hypothesis and alternative hypothesis
  • Determine the level of significance
  • Calculate degrees of freedom
  • Find the critical value
  • Calculate the test statistics
  • Make a decision, the null hypothesis will be rejected if the test statistic falls in the rejection region: greater than the critical value for a right-tailed test, less than the negative critical value for a left-tailed test, or beyond either one for a two-tailed test
  • Finally, Interpret the decision in the context of the original claim.

Example of a Two Sample T Hypothesis Test (Equal Variance) in a DMAIC Project

Teams most often run a two sample t test in the Analyze phase of DMAIC. It shows whether the difference between two process means is real or just random chance. That makes it a common way to verify a root cause or critical X. The examples below show how.

Two-tailed (Equal variance)

Example: An apple grower wants to know if apple weights differ between two farms. A random sample of 15 apples from farm A averages 86 g, with a standard deviation of 7 g. A sample of 10 apples from farm B averages 80 g, with a standard deviation of 8 g. At a 95% confidence level, do the farms differ?

  • Null Hypothesis (H0) : Mean apple weight of farm A is equal to farm B
  • Alternative Hypothesis (H1) : Mean apple weight of farm A is not equal to farm B
  • n1=15
  • n2=10
  • S12=49
  • S22 =64
  • XΜ…1 =86
  • XΜ…2 = 80

Significance level: Ξ±=0.05

Degrees of freedom: df = 15 + 10 βˆ’ 2 = 23

Calculate critical value

Refer two tailed t table for 23 degrees of freedom

T-table highlighting df of 23 and two-tail alpha of 0.05 to find the critical t-value of 2.069.
One and Two Sample T Tests
Two Tailed T Test

If the calculated t value is less than βˆ’2.069 or greater than 2.069, reject the null hypothesis.

Test Statistic

Two Sample T Hypothesis Tests
Step-by-step calculation of pooled standard deviation Sp = 7.40 and test statistic t = 1.98.

Interpret the Results

Compare tcalc to tcritical. A critical value is the point on the test distribution that marks the edge of the rejection region. Here t = 1.98, which sits between βˆ’2.069 and 2.069, so you fail to reject the null hypothesis (H0). The p-value is 0.059, just above 0.05. So the data do not show a significant difference in mean apple weight between farm A and farm B. With p this close to 0.05, a larger sample is worth collecting before you rule the farms the same.

Two Sample T 2 Tailed Equal Variance template file

Unlock Additional Members-only Content!

To unlock additional content, please upgrade now to a full membership.
Upgrade to a Full Membership
If you are a member, you can log in here.

Right-Tailed (Equal Variance)

Example: A researcher claims vendor A’s ceramic tiles are slightly thicker than vendor B’s. The researcher takes a random sample of 12 tiles from each vendor (vendor 1 and vendor 2 in the table). Assuming the population variances are equal, at 95% confidence level, is there enough evidence to support the claim?

Two Sample T Hypothesis Tests
  • Null Hypothesis (H0) : Mean tile thickness of vendor A is equal to vendor B
  • Alternative Hypothesis (H1) : Mean tile thickness of vendor A is greater than vendor B
  • Significance level: Ξ±=0.05
  • n1=12
  • n2=12

Degrees of freedom: df = n1 + n2 βˆ’ 2 = 12 + 12 βˆ’ 2 = 22

Calculate mean (XΜ…) of each sample

  • XΜ…1 = (x1 + x2 + … + xn) / n = 18.67
  • XΜ…2 = (x1 + x2 + … + xn) / n = 18.50

Calculate variance (S2) of each sample

  • S12 = {(XΜ… βˆ’ x1)2 + (XΜ… βˆ’ x2)2 + … + (XΜ… βˆ’ xn)2} / (n βˆ’ 1) = 8.61
  • S22 = {(XΜ… βˆ’ x1)2 + (XΜ… βˆ’ x2)2 + … + (XΜ… βˆ’ xn)2} / (n βˆ’ 1) = 16.09

Calculate critical value

Refer one tailed t table for 22 degrees of freedom

T-table showing the critical value of 1.717 for 22 degrees of freedom at a 0.05 one-tail significance level.

If the calculated t value is greater than 1.717, then reject the null hypothesis.

Test Statistic

Two Sample T Hypothesis Tests
Calculation of pooled standard deviation (Sp = 3.514) and test statistic (t = 0.1162) for a two-sample t-test.

Interpret the results:

Two Sample T Hypothesis Tests

Compare tcalc to tcritical. Here t = 0.116 is less than 1.717, so it is not in the rejection region, and you fail to reject the null hypothesis (H0). The p-value is 0.454. So there is not enough evidence that vendor A’s tiles are thicker than vendor B’s.

Two Sample T Right Tailed Equal Variance template file

Unlock Additional Members-only Content!

To unlock additional content, please upgrade now to a full membership.
Upgrade to a Full Membership
If you are a member, you can log in here.

Left-Tailed (Equal Variance)

Example: A company samples sales of a new product in 12 similar shops in each of two US states. Is there evidence that sales in state A are lower than in state B? Assuming the population variances are equal, at 95% confidence level, is there enough evidence to support the claim?

Table of 12 sales quantities for State A (mean 44.7) and State B (mean 43.6) to perform a two-sample t-test.
  • Null Hypothesis (H0) : Mean sales in state A is equal to the state B
  • Alternative Hypothesis (H1) : Mean sales in state A is lesser than state B
  • Significance level: Ξ±=0.05
  • n1=12
  • n2=12

Degrees of freedom: df = n1 + n2 βˆ’ 2 = 12 + 12 βˆ’ 2 = 22

Calculate mean (XΜ…) of each sample

  • XΜ…1 = (x1 + x2 + … + xn) / n = 44.67
  • XΜ…2 = (x1 + x2 + … + xn) / n = 42.75

Calculate variance (S2) of each sample

  • S12 = {(XΜ… βˆ’ x1)2 + (XΜ… βˆ’ x2)2 + … + (XΜ… βˆ’ xn)2} / (n βˆ’ 1) = 53.3
  • S22 = {(XΜ… βˆ’ x1)2 + (XΜ… βˆ’ x2)2 + … + (XΜ… βˆ’ xn)2} / (n βˆ’ 1) = 28.2

Calculate critical value

Refer one tailed t table for 22 degrees of freedom

T-table showing the critical value of 1.717 for 22 degrees of freedom at a 0.05 one-tail significance level.

If the calculated t value is less than βˆ’1.717, reject the null hypothesis.

Test Statistic

Two Sample T Hypothesis Tests
Calculation showing pooled standard deviation Sp equals 6.385 and the final t-statistic equals 0.7353.

Interpret the results:

Compare tcalc to tcritical. Here t = 0.735 is greater than the critical value of βˆ’1.717, so it is not in the rejection region, and we fail to reject the null hypothesis (H0). The p-value is 0.765. In fact, state A’s mean is higher than state B’s, the opposite of the claim. So there is not enough evidence that mean sales in state A are lower than in state B.

Two Sample T Left Tailed Equal Variance template file

Unlock Additional Members-only Content!

To unlock additional content, please upgrade now to a full membership.
Upgrade to a Full Membership
If you are a member, you can log in here.

Two Sample T Hypothesis Test (Equal Variance) Videos

Two Sample T-Test for Means (Unequal Variance)

Use this version when you can’t assume the two population variances are equal. It is often called Welch’s t-test. It tests whether two means differ without pooling the variances.

Two Sample T Hypothesis Test (Unequal Variance) Formula

Two Sample T Hypothesis Tests
  • Where n1 and n2 are sample sizes
  • S12 & S22 are variances of sample 1 and sample 2
  • xΜ…1 and xΜ…2 are the sample means

Assumptions of the Unequal Variance Test

  • Observations (data):
    • Are Normally distributed.
      • Note: The method is fairly robust to non-normality, but the distributions should at least be roughly symmetric.
    • Within and between samples (groups) are independent of each other.
    • Are randomly β€œdrawn”.
    • Are continuous.
      • Depending on some conditions (e.g. wide data range and field of applications), data that is not continuous (e.g. count) may still be used.
      • Don’t use it for proportions or percentages. Use a two sample proportion test instead.
  • Variances are unknown and estimated by sample variances (S2).
  • Population variances are not assumed equal. Οƒ12 may differ from Οƒ22.

Steps to Calculate Two Sample T Hypothesis Test (Unequal Variance)

Step 1 – Calculate mean (XΜ…) of each sample

  • XΜ… = (x1 + x2 + … + xn) / n
  • Where, x1, x2, …xn are observations in each sample (β€œn1” = sample size in sample 1 and β€œn2” = sample size in sample 2)

Step 2 – Calculate variance (S2) of each sample

  • S2 = {(XΜ… βˆ’ x1)2 + (XΜ… βˆ’ x2)2 + … + (XΜ… βˆ’ xn)2} / (n βˆ’ 1)

Step 3 – Calculate t value

Two Sample T Hypothesis Tests

Step 4 – Calculate degrees of freedom (DF)

Two Sample T Hypothesis Tests
  • Round to nearest integer

Step 5: Compare t-calc with critical value in the t-distribution table.

  • Look up the critical t value in a t table, using the calculated degrees of freedom and the Ξ± (significance level) column:
    • For 1 tailed test the t-critical is based on the given Ξ±
      • The commonly used T-critical value for a 1 tailed test is in the 0.05 Ξ± column
    • For 2 tailed test the t-critical is based on the given Ξ± divided by 2
      • The commonly used T-critical value for a 2 tailed test is in the 0.025 Ξ± column

Interpretation

  • Finally, interpret the decision in the context of the original claim.

Example of a Two Sample T Hypothesis Test (Unequal Variance) in a DMAIC Project

Two-tailed (Unequal Variance)

Example: Dogs are fed with two different diets. Test if the two diets differ significantly as regards their effect on their weight. Assuming the population variance is unequal, at 95% confidence level, is there enough evidence to support the claim?

Table of weight data for 10 dogs on Diet 1 and Diet 2, providing the raw sample values for the t-test.
  • Null Hypothesis (H0) : The mean dog weights are the same with Diet 1 and Diet 2
  • Alternative Hypothesis (H1) : The mean dog weights are not the same with Diet 1 and Diet 2
  • Significance level: Ξ±=0.05
  • n1=10
  • n2=10

Calculate mean (XΜ…) of each sample

  • XΜ…1 = (x1 + x2 + ….+ xn) / n =24.4
  • XΜ…2 = (x1 + x2 + ….+ xn) / n =20.00

Calculate variance (S2) of each sample

  • S12 = {(XΜ… βˆ’ x1)2 + (XΜ… βˆ’ x2)2 + … + (XΜ… βˆ’ xn)2} / (n βˆ’ 1) = 25.6
  • S22 = {(XΜ… βˆ’ x1)2 + (XΜ… βˆ’ x2)2 + … + (XΜ… βˆ’ xn)2} / (n βˆ’ 1) = 56.22
  • S12/n1=2.56
  • S22/n2=5.62

Calculate critical value

Calculate the degrees of freedom

Formula to calculate degrees of freedom (df) for a two-sample t-test with unequal variances.
Degrees of freedom calculation formula showing df equals 15.8, which rounds to 16.

Refer two tailed t table for 16 degrees of freedom

T-table highlighting df of 16 and two-tail probability of 0.05, yielding a critical t-value of 2.120.

If the calculated t value is less than βˆ’2.120 or greater than 2.120, reject the null hypothesis.

Test Statistic

Two Sample T Hypothesis Tests
Formula calculating the test statistic t, resulting in t = 1.538, to determine if the null hypothesis is rejected.

Interpret the results:

T-distribution curve showing test statistic 1.538 falls in the do not reject region between -2.120 and +2.120.

Compare tcalc to tcritical. Here t = 1.538 falls between βˆ’2.120 and 2.120, so it is not in the rejection region, and we fail to reject the null hypothesis (H0). The p-value is 0.144. So there is not enough evidence that mean dog weights differ between Diet 1 and Diet 2.

Two Sample T 2 Tailed Unequal Variance Template File

Unlock Additional Members-only Content!

To unlock additional content, please upgrade now to a full membership.
Upgrade to a Full Membership
If you are a member, you can log in here.

Right-tailed (Unequal Variance)

Example: A researcher believes that students in school A have better computer knowledge than school B. Randomly computer marks were collected from the two schools for the same curriculum. Assuming the population variance is unequal, at 95% confidence level, is there enough evidence to support the claim?

Raw computer marks out of 40 for School A (19 students) and School B (17 students) used for the t-test example.
  • Null Hypothesis (H0) : Mean students marks in school A is equal to the school B
  • Alternative Hypothesis (H1) : Mean students marks in school A is greater than the school B
  • Significance level: Ξ±=0.05
  • n1=19
  • n2=17

Calculate mean (XΜ…) of each sample

  • XΜ…1 = (x1 + x2 + ….+ xn) / n =26.19
  • XΜ…2 = (x1 + x2 + ….+ xn) / n =20.65

Calculate variance (S2) of each sample

  • S12 = {(XΜ… βˆ’ x1)2 + (XΜ… βˆ’ x2)2 + … + (XΜ… βˆ’ xn)2} / (n βˆ’ 1) = 29.23
  • S22 = {(XΜ… βˆ’ x1)2 + (XΜ… βˆ’ x2)2 + … + (XΜ… βˆ’ xn)2} / (n βˆ’ 1) = 84.95
  • S12/n1=1.54
  • S22/n2=5.00

Calculate critical value

Calculate the degrees of freedom

Two Sample T Hypothesis Tests
Two Sample T Hypothesis Tests

Refer one tailed t table for 25 degrees of freedom

T-table highlighting df of 25 and one-tail alpha of 0.05 to find the critical t-value of 1.708.

If the calculated t value is greater than 1.708, then reject the null hypothesis.

Test Statistic

Two Sample T Hypothesis Tests
Formula calculating the t-statistic as 2.167, which exceeds 1.708 to reject the null hypothesis.

Interpret the results:

Two Sample T Hypothesis Tests

Compare tcalc to tcritical. Here t = 2.167 is greater than 1.708, so it falls in the rejection region, and we reject the null hypothesis (H0). The p-value is 0.020. So the data support the claim that school A’s mean mark is higher than school B’s.

Two Sample T Right Tailed Unequal Variance template file

Unlock Additional Members-only Content!

To unlock additional content, please upgrade now to a full membership.
Upgrade to a Full Membership
If you are a member, you can log in here.

Left-tailed (Unequal Variance)

Example: A manufacturer believes that breaking strength of plastic parts of supplier A is less than the supplier B. Operator randomly checked the breaking strength of plastic parts of two suppliers. Assuming the population variance is unequal, at 95% confidence level, is there enough evidence to support the claim?

Table of breaking strength values for 12 samples from Supplier A and B to perform the hypothesis test.
  • Null Hypothesis (H0) : Mean breaking strength of plastic parts of supplier A is equal to the supplier B
  • Alternative Hypothesis (H1) : Mean breaking strength of plastic parts of supplier A is less than supplier B
  • Significance level: Ξ±=0.05
  • n1=12
  • n2=12

Calculate mean (XΜ…) of each sample

  • XΜ…1 = (x1 + x2 + ….+ xn) / n =161.67
  • XΜ…2 = (x1 + x2 + ….+ xn) / n =158.08

Calculate variance (S2) of each sample

  • S12 = {(XΜ… βˆ’ x1)2 + (XΜ… βˆ’ x2)2 + … + (XΜ… βˆ’ xn)2} / (n βˆ’ 1) = 10.97
  • S22 = {(XΜ… βˆ’ x1)2 + (XΜ… βˆ’ x2)2 + … + (XΜ… βˆ’ xn)2} / (n βˆ’ 1) = 25.72
  • S12/n1=0.91
  • S22/n2=2.14

Calculate critical value

Calculate the degrees of freedom

Two Sample T Hypothesis Tests
Degrees of freedom calculation showing df equals 18.9, rounded to 19.

Refer one tailed t table for 19 degrees of freedom

T-table showing critical value of 1.729 at the intersection of 19 degrees of freedom and 0.05 one-tail probability.

If the calculated t value is less than βˆ’1.729, reject the null hypothesis.

Test Statistic

Two Sample T Hypothesis Tests
Calculation of test statistic t: (161.67 - 158.08) / sqrt(0.91 + 2.14) = 2.049.

Interpret the results:

Two Sample T Hypothesis Tests

Compare tcalc to tcritical. Here t = 2.049 is greater than the critical value of βˆ’1.729, so it is not in the rejection region, and we fail to reject the null hypothesis (H0). The p-value is 0.973. In fact, supplier A’s parts average stronger, not weaker. So there is not enough evidence that supplier A’s mean breaking strength is less than supplier B’s.

Two Sample T Left Tailed Unequal Variance Template File

Unlock Additional Members-only Content!

To unlock additional content, please upgrade now to a full membership.
Upgrade to a Full Membership
If you are a member, you can log in here.

Two Sample T Hypothesis Test (Unequal Variance) Videos

Additional Two Sample T Hypothesis Tests Resources

When you’re ready, there are a few ways I can help:

First, join 12,000+ other Six Sigma professionals by subscribing to my email newsletter. A short read every Monday to start your work week off correctly. Always free.

* * *

If you’re looking to pass your Six Sigma Yellow Belt, Green Belt or Black Belt exam, I’d recommend starting with my affordable study guide:

1)β†’ 🟑Pass Your Six Sigma Yellow Belt: built for ASQ, IASSC and ILSSI, 1,700+ practice questions with explanations, and six full-length mock exams for your exam

2)β†’ 🟒Pass Your Six Sigma Green Belt: a study guide organized by the exam Body of Knowledge, 1,300+ practice questions with detailed answer explanations, and 20 full-length mock exams

3)β†’ ⚫Pass Your Six Sigma Black Belt: the full Black Belt Body of Knowledge, 2,200+ practice questions with detailed answer explanations, and 20 full-length mock exams

You’ve spent so much effort learning Lean Six Sigma. Why leave passing your certification exam up to chance? This comprehensive study guide offers 1,700+ exam-like questions for Yellow Belts, 1,300+ for Green Belts and 2,200+ for Black Belts with full answer walkthroughs, access to instructors, detailed study material, and more.

​ Thousands have used this system to prepare. Join them here. 

Authors

Comments (7)

In the blood pressure question, can you please explain how you got 7.3 for s? No matter what I do, I am always getting to 7.08

Jeremy,

I added additional detail in the calculation steps.

For these equations with so many variables I find it helpful to go slowly and write out the smaller operations of each part of the calculation.

Does this make sense?

Hi,

the above states formula for Sample Variation as
S2 = {( X Bar– x1)2 + (X Bar – x2)2 + … +(X Bar – xn)2} / n

however the IASSC Reference document is stating

S2 = {( X Bar– x1)2 + (X Bar – x2)2 + … +(X Bar – xn)2} / n-1

Could you please clarify

Thanks
Maria

Thank you Maria,

When we divide by n in the sample variance S2, it is not an unbiased estimate of the population variance. Hence it is always recommended to use n-1 instead of n.

I have updated the formula

Thanks

The formula for Two Sample T Hypothesis Test (Unequal Variance) formula that you have doesn’t match the formula shown on the IASSC formula sheet. Specifically A = sqrt(s1^2/n1), B = sqrt(s2^2/n2) and the way you’ve shown it you have A = s1^2/n1, B = s2^2/n2. Please update.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.