Describe replicate data, separate bias from scatter, and compare two methods with a paired t-test.
Why it matters
Every analytical result is a number with uncertainty. When a lab replaces an old method with a faster one, changes an instrument, or compares its results with another lab, someone must answer: do the two methods give the same results, or is there a real difference? Answering that with an eyeball is how labs drift. Answering it with the right statistical test, and the right sample design, is a core skill for analytical chemists. This lesson builds on statistics-fundamentals and lab-data-quality.
Describing replicates
For n replicate results x1 ... xn:
- Mean (x-bar): the best estimate of the value.
- Standard deviation (s): the spread, with n - 1 in the denominator.
- Relative standard deviation (RSD, %): 100 x s / mean. Useful for comparing precision across concentrations.
- Confidence interval of the mean: mean +/- t x s / sqrt(n), where t comes from the t table for n - 1 degrees of freedom at the chosen confidence (95 % is typical).
Accuracy vs precision
- Precision is how close replicates are to each other (random error).
- Accuracy is how close the result is to the true value. Bias (systematic error) is the difference between the mean and a reference value, often measured with a certified reference material (CRM).
A method can be precise and biased at the same time. Statistical tests help you separate a real bias from random scatter.
Choosing the test
| Question | Test |
|---|---|
| Does my method's mean agree with a certified value? | One-sample t-test |
| Are two methods' precisions different? | F-test (ratio of variances) |
| Do two methods give the same mean on independent samples? | Two-sample t-test (pooled if variances are similar) |
| Do two methods give the same results on the same set of samples? | Paired t-test |
The paired design is the workhorse of method comparison. If you measure six different real samples with both methods, the samples have very different concentrations, so the between-sample spread would swamp any method difference in a two-sample test. Pairing removes that: you analyze the differences for each sample.
Worked example: a paired comparison
Six fictional samples (mg/L) by the reference method A and a new method B:
| Sample | A | B | d = B - A |
|---|---|---|---|
| 1 | 10.2 | 10.4 | 0.2 |
| 2 | 12.5 | 12.9 | 0.4 |
| 3 | 8.9 | 9.0 | 0.1 |
| 4 | 15.1 | 15.6 | 0.5 |
| 5 | 11.3 | 11.5 | 0.2 |
| 6 | 9.8 | 10.1 | 0.3 |
- Mean difference d-bar = 0.283 mg/L; s_d = 0.147 mg/L; n = 6.
- t = d-bar / (s_d / sqrt(n)) = 0.283 / 0.0601 = 4.71
- Critical t (two-tailed, 95 %, 5 degrees of freedom) = 2.571.
Because |t| = 4.71 > 2.571, the difference is statistically significant: method B reads about 0.28 mg/L high. The next question is practical: is 0.28 mg/L acceptable for the method's purpose? Statistics tells you a difference is real; the acceptance criteria (set before the study) tell you whether it matters.
Beyond the t-test
- When comparing methods across a wide concentration range, labs also use regression of B against A (slope near 1 and intercept near 0 means agreement) and Bland-Altman plots of difference vs mean. Ordinary least squares assumes A has no error; Deming or Passing-Bablok regression handle error in both methods.
- Outlier tests (Grubbs, Dixon's Q) exist, but an outlier is only rejected with a documented reason, never just because it is inconvenient (see
lab-data-quality). - In Python,
scipy.stats.ttest_relperforms a paired t-test. The activity uses only the standard library so you see the formula.
Common mistakes
- Using a two-sample test on paired data, which hides a real bias under sample-to-sample variation.
- Confusing statistical significance with practical importance.
- Running many tests and reporting only the one with p < 0.05.
- Comparing methods on too few samples, or only at one concentration.
Quick recap
- Mean, s, RSD and confidence intervals describe replicates.
- Bias is systematic; precision is random scatter.
- Same samples measured by two methods: use a paired t-test on the differences.
- Decide acceptance criteria before the study.
Try it
Open the Do tab. A Python method-comparison script is written except for the paired t statistic.