Monthly beauty: Porsche 911 Carrera S
Source: porsche.com

# qMindset.com - the quality management portal

qMindset.com launched! Check out our Knowledge Base, News, Company Database and more...
Everything about quality management, quality products and quality companies.
Events / News
Quality knowledge base - article QA-0059
Updated on 23-06-2017

# T-test

Introduction
T-test is a statistical hypothesis test, used for the comparison of two data sets. In other words, t-test shows us whether the difference between two population’s averages is real or only by chance due to a random variation. T-test can also be used to analyse the mean of a population compared to a reference value. The latter is called one sample t-test.
Under the pseudonym "Student", William Sealy Gosset, a chemist and statistician, working for Guiness in Dublin, Ireland started to apply the t-test for statistical analysis, and published it in 1908. He used this statistical technique to evaluate the quality of the beer in serial production.
T-test is an inferential statistic, which means inferences can be drawn from the results and can be forwarded to the whole population of products. That's why it is very useful in quality management. According to StatTrek.com, the t distribution (Student's t-distribution) is a probability distribution that is used to estimate population parameters when the sample size is small (below 30) and / or when the population variance is unknown (Remark: Otherwise we can use z-test). The t statistic produced can be associated with a unique cumulative probability. This cumulative probability represents the likelihood of finding a sample mean less than or equal to a reference mean or another group's mean.
Such as in other statistical tests, we set up our null-hypothesis and alternative hypothesis with a given confidence level. "A t-value of 0 indicates that the sample results exactly equal the null hypothesis. As the difference between the sample data and the null hypothesis increases, the absolute value of the t-value increases." - Minitab
Hypothesis 0 (null-hypothesis): we have no statistical evidence to reject the null hypothesis, so...
• [one-sample test] there is no evidence, that the mean of the data set is statistically far from the reference value
• [two-sample test] the means of the two population are statistically equal, as we see no statistical difference between the two groups (two data sets)
Hypothesis A (alternative hypothesis): we reject the null hypothesis, so...
• [one-sample test] the mean of the tested data set is statistically far from the reference value
• [two-sample test] the two population means differ from each other, as we see statistical difference between the two groups (two data sets)
The truth is, no hypothesis test is 100% reliable and certain, as two types of errors are possible. These are called Type I and Type II errors.
Type I error occurs, when we reject the null hypothesis, although it is true. From quality and manufacturing point of view, it means we scrap a product, because we think it is defective, but finally it is not!
Having a Type II error is the inverse of Type I: we do not reject the false null hypothesis. In quality standpoint it means that we do not reject the product, even it is defective. To make it more visible and understandable, the following table summarizes the situation possibilities.
 Type I and Type II errors Null Hypothesis is True (alternative hypothesis is False) Null Hypothesis is False (alternative hypothesis is True) Fail to reject H0 Correct Decision (True Negative) - fail to reject H0 when it is true (probability = 1 - α) "We accept the good product" Type II Error (False Negative) - fail to reject H0 when it is false (probability = β) "We accept the defective product, meaning we have an inefficient test coverage" Rejecting H0 Type I Error (False Positive) - rejecting H0 when it is true (probability = α) "We reject the good product, meaning we have an overreacting test / measurement system" Correct Decision (True Positive) - rejecting H0 when it is false (probability = 1 - β) "We reject the defective product"
The α value means the significance of the test. If we choose alpha = 0.05, it means we are willing to take 5% risk to make a Type I error. The β value represents the chance of having a Type II error, meaning the power of the test is equal to 1 - β.
Source: qMindset.com; minitab.com; encyclopedia.com; encyclopediaofmath.org; ocw.mit.edu; stattrek.com
Key Features
Benefits of t-test for quality are clear. For example you can use it for comparing samples from different production time-frames, substantiating your decision.
T-test calculates with the difference of means (or difference between the group mean and the reference in case of one-sample test), the variance of the groups (S2) and the sample size (n).
One-sample t-test
The purpose of one-sample t-test is to check if the mean of the group is statistically the same as the reference value (null-hypothesis), or it is different (alternative hypothesis).
Calculation formulae of one-sample t-test (Source: qMindset.com)
Example: we check if the data set is statistically different from the reference value. The reference height of our part is 10.00 mm.
The measured values are:
 Measured values 10.01 10.02 9.99 10.10 10.05 9.98 10.04 10.10 9.97 9.99 10.10 10.01 10.03 10.02 9.95 10.02 10.01 10.10 10.06 9.98
 Group statistics Statistic Value Reference value (µ) 10.00 mm Standard deviation of data set (S) 0.046143 Sample size (n) 20 Degrees of freedom (df = n – 1) 19 Mean of data set (x̄) 10.0265 mm T value 2.57 P value 0.019
Interpreting the results: based on the two-tailed test, with 5% significance, there is a 95% chance that the true mean is between 10.005 and 10.048. According to the T-test table, the T value should be less, than 2.093 (with degrees of freedom = 19 and significance level = 0.05). As our T value is 2.57 (bigger than 2.093) and our p value is less than 0.05, we can state, that the mean of the data set is significantly different from the reference value (10.0265 mm vs 10.00 mm).
Two-sample unpaired test (independent samples)
The purpose of two-sample t-test is to check if the means of two groups are reliably (significantly) different. With this test we compare two groups that are independent from each other. During the test, we calculate with the means (x̄1; x̄2), the standard deviations (S1; S2), the sample sizes (n1; n2), and the pooled variance (Sp2), by using the following formula:
Calculation formulae of two-sample unpaired t-test (Source: qMindset.com)
Example: we check if the two independent groups (data sets) are statistically different from each other.
The measured values are:
 Measured values of group 1 10 12 12 11 14 9 10 11 12 10
 Measured values of group 2 11 10 11 12 12 13 10 9 10 10
 Group statistics Group 1 Group 2 Standard deviation of data set (S) 1.4491 1.2293 Sample size (n) 10 10 Degrees of freedom (df = n1 + n2 - 2) 18 Mean of data set (x̄) 11.1 10.8 T value 0.4992 P value 0.624
Interpreting the results: our absolute T value is small (0.4992), being under the critical T value, which is 2.1009, and our P value is 0.624 (so being above 0.05), which gives no statistical evidence to reject the null-hypothesis. In practice this means that there is no significant difference between the group averages (means), so the two groups are statistically similar.
Two-sample paired test (dependent samples)
The purpose of two-sample t-test is to check if the means of two groups are reliably (significantly) different. With the paired test we compare two dependent data sets (e.g. evaluating the same parts "before" and "after", or on "temperature 1" and "temperature 2"). During the test, we calculate with the mean of differences between pairs (d̄), the standard deviation of differences (Sd), and the sample size (n), by using the following formula:
Calculation formulae of two-sample paired t-test (Source: qMindset.com)
Example: we check if the two dependent groups (data sets) are statistically different from each other.
The measured values are:
 Measured values of group 1 10 10 11 11 14 10 10 11 12 10
 Measured values of group 2 12 12 13 13 16 12 13 13 14 12
 Paired differences 2 2 2 2 2 2 3 2 2 2
 Group statistics Group 1 Group 2 Standard deviation of data set (S) 1.2867 1.2472 Standard deviation of paired differences (Sd) 0.3162 Sample size (n) 10 10 Degrees of freedom (df = n - 1) 9 Mean of data set (x̄) 10.9 13.0 Observed difference (absolute) 2.1 T value -21.0018 P value 0.001
Interpreting the results: our absolute T value is large (21.0018), being over the critical T value, which is 2.262, and our P value is below 0.001 (so being under 0.05), which gives a clear statistical evidence to reject the null-hypothesis and conclude the acceptance of alternative hypothesis. In practice this means that there is a significant difference between the group averages (means), so the two groups are statistically different.
Source: qMindset.com
Hints
The t-distribution varies based on degrees of freedom. As the degrees of freedom is based on the sample size, it drastically affects your T value. Larger sample size is better, as it increases the reliability of the test.
The probability density function of the T-distribution (Source: minitab.com)
You can use t-test for various purposes in quality management:
• One-sample t-test for evaluating the bias of your measurement gauge, in the frame of Measurement System Analysis (MSA).
• Two-sample unpaired t-test for comparing different sub-groups, produced in different time-frames in your production.
• Two-sample paired t-test for comparing the values of the same group, measured under different conditions (e.g. different temperature or before / after comparison, etc.).
Source: qMindset.com; minitab.com
Summary
• T-test is a statistical hypothesis test, used for the comparison of two data sets (two-sample t-test).
• T-test can also be used to analyse the mean of a population compared to a reference value (one-sample t-test).
• William Sealy Gosset, a chemist and statistician, working for Guiness in Dublin, Ireland started to apply the t-test for statistical analysis, and published it in 1908. He used the t-test to analyse the quality of beer in serial production.
• The T value formula is different for various t-test types (one-sample, two-sample paired, two-sample unpaired).
• T-test is an inferential statistic, which means inferences can be drawn from the results and can be forwarded to the whole population of products.
• T-test calculates with the difference of means (or difference between the group mean and the reference in case of one-sample test), the variance of the groups (S2) and the sample size (n).
• The t-distribution varies based on degrees of freedom, so a larger sample size gives more reliable conclusion.
Source: qMindset.com; minitab.com
Relevant Topics
Process Control and Analysis
Measurement System Analysis (MSA)
Process Control and Analysis
Measurement Capability (Cg, Cgk)
Process Control and Analysis
Gage Repeatability and Reproducibility (GR&R)
Process Control and Analysis
Statistical Process Control (SPC)
Process Control and Analysis
Machine- and Process Capability
Process Control and Analysis
F-test
Process Control and Analysis
Analysis of Variance (ANOVA)
Process Control and Analysis
Sampling Test
Process Control and Analysis
Acceptance Quality Limit (AQL)
Fact sheet
Information about the usage of T-test in quality control.

Topic / Article: T-test
Term Category: Process Control and Analysis