SOP: Testing the Difference Between Two Independent Lot Means by the t-Test
GIFSQ — Global Institute for Food Safety & Quality
Principle
The t-test compares the means of two groups of observations and assesses whether the difference between them can reasonably be ascribed to chance. The null hypothesis states that there is no real difference between the two lot means; the difference is divided by the standard error of the difference, and the resulting t-value is compared with tabulated t-values to determine significance.
Materials
- Samples of sizes n₁ and n₂ from the two lots, with their means x̄₁ and x̄₂
- The book’s t-distribution table for (n₁ + n₂ − 2) degrees of freedom
Procedure
Take samples of sizes n₁ and n₂ from the two lots and compute the mean of each
↓
Compute the standard deviation of each lot from its sum of squares
↓
Compute the standard error of each mean (s/√n) and combine them into the standard error of the difference between the means
↓
Compute the t-value as the difference between the means divided by the standard error of the difference
↓
Compare the calculated t-value with the tabulated values at the 5% and 1% levels for (n₁ + n₂ − 2) degrees of freedom; if it is greater than or equal to the tabulated value, reject the null hypothesis
Calculation
Sample variance of each lot:
s² = [Σx² − (Σx)²/n] / (n − 1)
Standard error of the difference between the means:
S.E.(x̄₁ − x̄₂) = √(SE₁² + SE₂²)
t-value:
t = (x̄₁ − x̄₂) / S.E.(x̄₁ − x̄₂)
Pooled form (for the two-lot equality test):
s_pooled = √{[Σ(x₁ − x̄₁)² + Σ(x₂ − x̄₂)²] / (n₁ + n₂ − 2)}
t = (x̄₁ − x̄₂) / [s_pooled × √(1/n₁ + 1/n₂)]
Where,
- x̄₁, x̄₂ = means of the two lots
- SE₁, SE₂ = standard errors of the two means
- s_pooled = standard deviation of the pooled samples
- n₁, n₂ = sizes of the two samples
- The t-value has (n₁ + n₂ − 2) degrees of freedom
Worked example 1 — net weight from two filling lines
Ten weighings from each line (oz).
Lot A: Σx = 154, x̄ = 15.4, Σx² = 2373.20; s² = (2373.20 − 154²/10)/9 = 0.177; s = 0.4216; SE = 0.4216/√10 = 0.1333
Lot B: Σx = 157.8, x̄ = 15.78, Σx² = 2491.02; s² = (2491.02 − 157.8²/10)/9 = 0.104; s = 0.3225; SE = 0.3225/√10 = 0.102
Standard error of the difference: S.E. = √(0.1333² + 0.102²) = 0.168
t = (15.78 − 15.4)/0.168 = 2.26
With 18 degrees of freedom, a t of 2.10 is required for significance at the 5% level and 2.88 at the 1% level. The results are significant at the 5% level: there is a significant difference in the net weight filled by the two lines.
Worked example 2 — tin content from two types of tinplate
Lot 1 (n = 12): Σx = 138.0, x̄₁ = 11.5, Σ(x₁ − x̄₁)² = 30.70
Lot 2 (n = 10): Σx = 119.4, x̄₂ = 11.9 (as printed; 119.4/10 = 11.94), Σ(x₂ − x̄₂)² = 25.16
Notes: (1) the book prints “22 degrees of freedom” with a tabulated value of 1.717 for this example, but the book’s own formula gives n₁ + n₂ − 2 = 12 + 10 − 2 = 20 degrees of freedom; the two-tailed 5% tabulated value at df = 20 is 2.086 (one-tailed 1.725); (2) the printed deviation column (−1.7, −0.8, 0.6, 3.3, −0.5, 1.3, −0.5, 0.1, −1.7, 2.3) and Σ(x₂ − x̄₂)² = 25.16 are consistent with a mean of 11.7, not with the printed 11.9 (or the true 11.94, against which the squares sum to 24.58). The book’s t = 0.559 uses the printed 25.16. All carried as printed; the conclusion — 0.559 is below every applicable critical value — is unaffected.
s_pooled = √[(30.70 + 25.16)/(12 + 10 − 2)] = √2.793 = 1.6712
Standard error of the difference: 1.6712 × √(1/12 + 1/10) = 0.7156
t = (11.5 − 11.9)/0.7156 = −0.559
The calculated t-value of 0.559 is lower than the tabulated value of 1.717 with 22 degrees of freedom at the 5% level; hence the null hypothesis holds good.
Precautions
- The test assumes that the distribution is normal, the samples have been taken at random, and the variances of the two lots are not significantly different; in case of doubt, apply a test of equality of variances first.
- The t-test is not applicable when the means of more than two groups are to be compared; the F-test (analysis of variance) is used then.
- The t-test and the F-test should not be used for acceptance of lots.
References
Ranganna, S., Handbook of Analysis and Quality Control for Fruit and Vegetable Products, 2nd edition.