Chip Foundry Services Request Assessment

T-Test

A t-test asks whether a difference between sample means is large compared with the variation expected from sampling. The correct formula depends on how the observations were collected. For two independent groups, Welch's t-test is a sound default because it does not require the groups to have equal variances.

Welch's two-sample t-test

For independent samples with sizes $n_1,n_2$, sample means $\bar{x}_1,\bar{x}_2$, and sample standard deviations $s_1,s_2$, calculate:

$$t = \frac{\bar{x}_1-\bar{x}_2}{\sqrt{\frac{s_1^2}{n_1}+\frac{s_2^2}{n_2}}}$$

The denominator is the standard error of the difference in means. Welch's degrees of freedom, used to select the reference $t$ distribution, are approximated by the Welch-Satterthwaite equation:

$$\nu = \frac{\left(\frac{s_1^2}{n_1}+\frac{s_2^2}{n_2}\right)^2}{\frac{\left(s_1^2/n_1\right)^2}{n_1-1} + \frac{\left(s_2^2/n_2\right)^2}{n_2-1}}$$

For a two-sided test of equal population means, the p-value is $p=2P(T_\nu \ge |t|)$, where $T_\nu$ follows a $t$ distribution with $\nu$ degrees of freedom. A $100(1-\alpha)\%$ confidence interval for the mean difference is:

$$\left(\bar{x}_1-\bar{x}_2\right) \pm t_{1-\alpha/2,\nu} \sqrt{\frac{s_1^2}{n_1}+\frac{s_2^2}{n_2}}$$

For example, suppose group 1 has $n_1=25$, $\bar{x}_1=10$, and $s_1=2$, while group 2 has $n_2=16$, $\bar{x}_2=12$, and $s_2=3$. The standard error is $\sqrt{2^2/25+3^2/16}=0.85$, so $t=(10-12)/0.85\approx-2.353$ and $\nu\approx23.556$. The negative sign means the first sample mean is lower; evidence and uncertainty are assessed using the $t$ distribution with the calculated degrees of freedom.

The equal-variance form

The classical pooled two-sample t-test assumes the two populations have the same variance. Its pooled variance estimate and test statistic are:

$$s_p^2 = \frac{(n_1-1)s_1^2+(n_2-1)s_2^2}{n_1+n_2-2}, \qquad t = \frac{\bar{x}_1-\bar{x}_2}{s_p\sqrt{1/n_1+1/n_2}}, \qquad \nu=n_1+n_2-2$$

Use this form when equal population variances are justified by the study design or subject-matter knowledge. Do not select it just because a preliminary variance test was not significant. Welch's test generally avoids that extra assumption and is usually a safer default.

The paired t-test

Use a paired test when each measurement in one condition is naturally matched to a measurement in the other, such as before-and-after readings on the same wafer or device. Compute each pair's difference $d_i$, then test the mean of those differences:

$$t = \frac{\bar{d}}{s_d/\sqrt{n}}, \qquad \nu=n-1$$

Here, $\bar{d}$ and $s_d$ are the mean and standard deviation of the $n$ paired differences. The analysis depends on the differences, not on treating the two columns as independent samples.

Choosing and reading the test

  • Independent groups: use Welch's test unless equal variances are a justified design assumption.
  • Matched or repeated measurements: use the paired test on within-pair differences.
  • Direction: the sign of $t$ follows the order of subtraction. Reversing the groups reverses the sign, but not a two-sided p-value.
  • Assumptions: observations or pairs must be independent of other observations. The sampling distribution of the mean difference should be reasonably well behaved; strong outliers or very small samples need particular care.
  • Interpretation: a small p-value is evidence against the equal-means null under the chosen model. It does not measure effect size or engineering importance. Report the estimated difference and its confidence interval too.

The formula must match the data layout. Treating matched readings as independent discards useful pairing; pooling variances without justification can misstate uncertainty.