PracticeVideosBlogFlashcards

2.2 Hypothesis Testing, ANOVA, and Statistical Quality Control

Key Takeaways

  • Hypothesis testing compares a null hypothesis H_0 against an alternative hypothesis H_1, subject to Type I (alpha) and Type II (beta) errors.

  • Student's t-tests compare means: one-sample t-test for comparison with a baseline, two-sample independent t-test for two groups, and paired t-test for dependent measurements.

  • One-way ANOVA tests equality of means across three or more groups by comparing the variance between treatments to the variance within treatments using the F-statistic.

  • Expected value analysis guides decision making under uncertainty, while outlier detection identifies suspect data points using Dixon's Q-test or Grubbs' test.

  • Shewhart control charts monitor process stability: the X-bar chart tracks process centering, while the R chart tracks process dispersion.

Last updated: July 2026

Hypothesis Testing and Decision Errors

Chemical engineers must make decisions based on experimental data that are subject to uncertainty. Statistical hypothesis testing provides a mathematical framework required to distinguish random noise from true physical effects, such as catalyst enhancements, reactor performance variations, or product specification drifts.

A hypothesis test is a formal procedure to decide between two competing claims about a population parameter:

  • Null Hypothesis (H0H_0): The status quo or default assumption that there is no difference, change, or effect (e.g., a new catalyst yields the same mean conversion as the old catalyst, H0:μ=μ0H_0: \mu = \mu_0).
  • Alternative Hypothesis (H1H_1 or HaH_a): The claim the engineer wants to prove (e.g., the new catalyst increases mean conversion, H1:μ>μ0H_1: \mu > \mu_0, which is a one-tailed test; or the conversion is simply different, H1:μ≠μ0H_1: \mu \neq \mu_0, which is a two-tailed test).

When conducting hypothesis tests, two types of decision errors can occur:

  • Type I Error (α\alpha): Rejecting the null hypothesis when it is actually true (false positive). The probability of a Type I error is the significance level α\alpha, typically set at 0.050.05 or 0.010.01.
  • Type II Error (β\beta): Failing to reject the null hypothesis when it is actually false (false negative). The probability of a Type II error is denoted by β\beta.
  • Power of the Test (1−β1 - \beta): The probability of correctly rejecting the null hypothesis when it is false. Increasing the sample size nn generally increases the power of the test.

Student's t-Tests for Means Comparison

To compare sample means when the population standard deviation is unknown, Student's t-tests are applied. The choice of the test depends on the experimental design:

  • One-Sample t-Test: Compares the sample mean Xˉ\bar{X} to a known reference value μ0\mu_0: tcalc=Xˉ−μ0s/nt_{\text{calc}} = \frac{\bar{X} - \mu_0}{s / \sqrt{n}} where ss is the sample standard deviation and nn is the sample size. The calculated value is compared to critical values from the t-distribution table with ν=n−1\nu = n-1 degrees of freedom. If ∣tcalc∣>tα/2,n−1|t_{\text{calc}}| > t_{\alpha/2, n-1} (for a two-tailed test), the difference is statistically significant.
  • Two-Sample Independent t-Test (Equal Variances): Compares the means of two independent groups (Xˉ1\bar{X}_1 and Xˉ2\bar{X}_2). The pooled standard deviation sps_p is calculated as: sp=(n1−1)s12+(n2−1)s22n1+n2−2s_p = \sqrt{\frac{(n_1 - 1)s_1^2 + (n_2 - 1)s_2^2}{n_1 + n_2 - 2}} The test statistic is: tcalc=Xˉ1−Xˉ2sp1n1+1n2t_{\text{calc}} = \frac{\bar{X}_1 - \bar{X}_2}{s_p \sqrt{\frac{1}{n_1} + \frac{1}{n_2}}} with degrees of freedom ν=n1+n2−2\nu = n_1 + n_2 - 2.
  • Paired t-Test: Used when comparing dependent observations (e.g., measuring reactor concentration before and after a catalyst change on the same system). The differences di=X1,i−X2,id_i = X_{1,i} - X_{2,i} are calculated, and the test statistic is tcalc=dˉ−μdsd/nt_{\text{calc}} = \frac{\bar{d} - \mu_d}{s_d / \sqrt{n}} with ν=n−1\nu = n-1 degrees of freedom, where dˉ\bar{d} is the mean of the differences and sds_d is their standard deviation.

Analysis of Variance (ANOVA)

Analysis of Variance (ANOVA) generalizes the comparison of means to three or more treatment groups (e.g., comparing reactor yields under three different temperature regimes). One-way ANOVA tests the null hypothesis that all group means are equal: H0:μ1=μ2=⋯=μkH_0: \mu_1 = \mu_2 = \dots = \mu_k against the alternative H1H_1: at least one group mean is different.

ANOVA partitions the total variation in the data set into two components:

  1. Sum of Squares for Treatments (SSTreatmentsSS_{\text{Treatments}} or SSBetweenSS_{\text{Between}}): Measures variation between the group means and the grand mean.
  2. Sum of Squares for Error (SSErrorSS_{\text{Error}} or SSWithinSS_{\text{Within}}): Measures variation within each group due to random noise.

The total sum of squares is SSTotal=SSTreatments+SSErrorSS_{\text{Total}} = SS_{\text{Treatments}} + SS_{\text{Error}}. Mean squares (MSMS) are calculated by dividing the sum of squares by their respective degrees of freedom (dfdf): MSTreatments=SSTreatmentsk−1MS_{\text{Treatments}} = \frac{SS_{\text{Treatments}}}{k-1} and MSError=SSErrorn−kMS_{\text{Error}} = \frac{SS_{\text{Error}}}{n-k}, where kk is the number of groups and nn is the total number of observations. The test statistic is the F-ratio:

Fcalc=MSTreatmentsMSErrorF_{\text{calc}} = \frac{MS_{\text{Treatments}}}{MS_{\text{Error}}}

If FcalcF_{\text{calc}} is greater than the critical value Fα,k−1,n−kF_{\alpha, k-1, n-k} from the F-distribution table in the FE Reference Handbook, the null hypothesis is rejected, indicating a statistically significant difference between the means.

Expected Value in Decision Analysis

Chemical engineers often face economic decisions under uncertainty, such as selecting a process design route, purchasing redundant equipment, or sizing emergency backup units. The expected value E(X)E(X) of a discrete random variable is the probability-weighted average of all possible outcomes:

E(X)=∑i=1mxiP(xi)E(X) = \sum_{i=1}^{m} x_i P(x_i)

where xix_i represents the value of outcome ii and P(xi)P(x_i) is the probability of that outcome.

For example, when evaluating whether to install a backup cooling water pump, the engineer compares the guaranteed cost of installation to the expected cost of production downtime caused by main pump failure:

Expected Cost of Failure=P(Failure)×Cost of Halt\text{Expected Cost of Failure} = P(\text{Failure}) \times \text{Cost of Halt}

If the backup pump costs $15,000 to install, and the expected cost of not installing it is 0.12×100,000=12,0000.12 \times 100,000 = 12,000 USD, then on a purely expected value basis, the installation cost exceeds the expected failure cost, and the plant should not install the backup pump. However, engineers must often balance expected value calculations with safety margins and risk-averse strategies.

Outlier Testing (Q-Test and Grubbs' Test)

Outliers are extreme observations that deviate significantly from the rest of the data. They can arise from experimental error, equipment malfunction, or transcription mistakes. Engineers must test whether to statistically discard these points rather than let them bias calculations.

  • Dixon's Q-Test: Used for small data sets (3≤n≤303 \le n \le 30) to test a single suspect outlier. The data are arranged in ascending order, and the Q-ratio is calculated as: Q=gaprange=∣xsuspect−xnearest∣xmax−xminQ = \frac{\text{gap}}{\text{range}} = \frac{|x_{\text{suspect}} - x_{\text{nearest}}|}{x_{\text{max}} - x_{\text{min}}} If Qcalc>QcriticalQ_{\text{calc}} > Q_{\text{critical}} (from the Q-table at a given confidence level, typically 95%), the outlier is discarded.
  • Grubbs' Test: Recommended for larger samples to detect a single outlier. The Grubbs test statistic GG is: G=∣xsuspect−Xˉ∣sG = \frac{|x_{\text{suspect}} - \bar{X}|}{s} If Gcalc>GcriticalG_{\text{calc}} > G_{\text{critical}} from Grubbs' table, the suspect data point is rejected. Once discarded, the mean and standard deviation must be recalculated using the remaining n−1n-1 data points.

Statistical Quality Control and Control Charts

Statistical Quality Control (SQC) uses control charts to monitor a process over time to detect whether variation is due to common causes (random noise) or assignable causes (process drifts, feed changes, or equipment wear). For continuous variables (such as product viscosity or moisture content), engineers use Shewhart Control Charts, specifically the Xˉ\bar{X} (mean) chart to monitor process centering and the RR (range) chart to monitor process dispersion.

  • Subgroup Sampling: Samples of size nn are taken at regular intervals. For each subgroup, the mean Xˉj\bar{X}_j and range RjR_j are calculated.
  • Center Lines (CL): Grand Mean Xˉˉ=1m∑j=1mXˉjandAverage Range Rˉ=1m∑j=1mRj\text{Grand Mean } \bar{\bar{X}} = \frac{1}{m} \sum_{j=1}^{m} \bar{X}_j \quad \text{and} \quad \text{Average Range } \bar{R} = \frac{1}{m} \sum_{j=1}^{m} R_j
  • Control Limits: 3-sigma control limits are established using standard control chart factor tables from the FE Reference Handbook:
    • Xˉ\bar{X} Chart Limits: UCLXˉ=Xˉˉ+A2Rˉ\text{UCL}_{\bar{X}} = \bar{\bar{X}} + A_2 \bar{R} and LCLXˉ=Xˉˉ−A2Rˉ\text{LCL}_{\bar{X}} = \bar{\bar{X}} - A_2 \bar{R}
    • RR Chart Limits: UCLR=D4Rˉ\text{UCL}_R = D_4 \bar{R} and LCLR=D3Rˉ\text{LCL}_R = D_3 \bar{R} where A2A_2, D3D_3, and D4D_4 are constants dependent on the subgroup sample size nn. If any subgroup mean or range falls outside these limits, the process is considered "out of control," prompting investigation.
Test Your Knowledge

A chemical company wants to test if a new catalyst increases the mean yield of a reaction compared to the standard catalyst. The historical mean yield is 72.0%. For a sample of 9 runs with the new catalyst, the mean yield is 74.5% with a sample standard deviation of 1.5%. Under a one-tailed test with significance level alpha = 0.05, which is the calculated t-statistic and the decision?

A

t = 1.67, fail to reject the null hypothesis

B

t = 5.00, fail to reject the null hypothesis

C

t = 1.67, reject the null hypothesis

D

t = 5.00, reject the null hypothesis

Test Your Knowledge

An online process refractometer measures the refractive index of a liquid stream. Every hour, a sample of size n = 4 is taken. The grand mean of the subgroup means is 1.3330 and the average subgroup range is 0.0040. For a sample size of n = 4, the control chart factors are A_2 = 0.729, D_3 = 0, and D_4 = 2.282. What is the Upper Control Limit (UCL) for the mean (X-bar) chart?

A

1.3359

B

1.3370

C

1.3330

D

1.3301

Test Your Knowledge

A chemical plant is deciding whether to install a backup cooling water pump. The pump costs $15,000 to install. If a backup is NOT installed and the main pump fails, the production halt will cost $100,000. The probability of the main pump failing during the plant's lifetime is estimated to be 0.12. What is the expected cost of NOT installing the backup pump, and should the plant install it based purely on expected value?

A

$12,000, install the pump

B

$88,000, do not install the pump

C

$12,000, do not install the pump

D

$15,000, install the pump

Sections you finish are checked off in the contents.