Assumptions & Data Transformations
A biologist measures bacterial colony counts across two growth media. She runs a The Two-Sample t-Test. The p-value comes back significant. But the raw data are skewed. One group's variance is triple the other's. Three colonies produced counts of 400 while most produced fewer than 40. Is the significant result real, or an artifact of broken assumptions? Every parametric test carries a fine print of assumptions. The t-test's fine print is normality and equal variance. These are not bureaucratic footnotes. They are the mathematical conditions under which the t-statistic actually follows a t-distribution. When data violate them badly, reported p-values become unreliable. Sometimes too liberal (false positives inflate), sometimes too conservative (real effects get missed). Count data, size data, and proportion data routinely violate these assumptions in predictable, biologically explicable ways. Variance often scales with the mean. Measurement scales are bounded or multiplicative rather than additive. This article teaches how to diagnose assumption violations. It uses residual plots, formal tests, and visual judgment. It also teaches how to fix many of them with a small toolkit of transformations — log, square root, and arcsine. These are chosen not arbitrarily, but because they match specific known relationships between mean and variance in biological data. The payoff is a defensible p-value: one that reflects a true biological signal rather than a statistical artifact of skew or heteroscedasticity.
- The two-sample t-test assumes normally distributed data (or large samples) and equal variances between groups.
- Diagnose violations with histograms, Q-Q plots, and residual-vs-fitted plots — not by staring at raw means.
- Variance that scales with the mean (common in counts, sizes, concentrations) signals the need for a transformation.
- Log transform tames right-skew and multiplicative variation; square-root suits Poisson-like count data; arcsine-square-root suits proportions/percentages.
- Transform, then test, then back-transform for reporting — but interpret effects on the transformed scale (e.g., as ratios for log data).
- When no transformation works, or data are ordinal/rank-based, move to Non-Parametric Tests: Mann-Whitney & Wilcoxon or to Analysis of Variance (ANOVA) with robust variants.
A t-test is only as trustworthy as its assumptions of normality and equal variance — and many biological measurements need a log, square-root, or arcsine transform before those assumptions hold.
The core idea
The two-sample t-test compares means using a statistic built from the difference between sample means divided by a standard error. That statistic follows a t-distribution only if two conditions hold (approximately, for large samples; more strictly for small ones). First, normality: within each group, the measured variable is normally distributed, or at least symmetric without heavy outliers. Second, homogeneity of variance (homoscedasticity): the two groups have equal population variances, so that pooling them into a single standard error estimate is valid. A third, always-required condition — independence of observations — is a design issue, not something a transformation can fix, and is assumed satisfied here. These assumptions matter because the t-distribution's shape is derived mathematically from the assumption that sample means, drawn from normal populations, follow a known sampling distribution. If the underlying data are strongly skewed, the sample mean is a poor summary of "central tendency" and its sampling distribution deviates from the theoretical t-distribution, especially at small sample sizes. If variances are unequal, the standard pooled-variance t-test can be badly miscalibrated — usually too liberal (inflated Type I error) when the larger sample has the smaller variance, and too conservative when the larger sample has the larger variance.
Transformation is a change of measurement scale — replacing each observation x with some function f(x), such as log(x) or √x — chosen so that the transformed data better satisfy normality and equal-variance assumptions. This is not "cooking the data": biological measurement scales are often arbitrary. Whether you measure enzyme activity in original units or log units is a choice, not a fact of nature, and many biological processes are inherently multiplicative (growth, dilution, concentration) rather than additive — meaning the log scale is the more natural scale, not a trick imposed on the data.
Mechanism — diagnosing and fixing assumption violations
Step 1: Look at the raw data before testing anything. Plot histograms or, better, Q-Q plots (quantile-quantile plots) for each group separately. A Q-Q plot orders the data and plots each value against the value a normal distribution would predict at that rank; points falling on a straight diagonal line indicate normality, while systematic curvature indicates skew, and S-shaped bends indicate heavy or light tails.
Step 2: Formalize with residual diagnostics. For the t-test, the relevant "residuals" are each observation's deviation from its own group mean. A Shapiro-Wilk test can formally test normality of these residuals; a Levene's test (or Brown-Forsythe, a more robust variant using deviations from the median) formally tests equality of variance across groups. These tests have limitations: with small samples they lack power to detect real violations, and with very large samples they can flag trivial deviations as "significant," so visual judgment always supplements them.
Step 3: Recognize the classic mean-variance signatures. Biological data violate assumptions in patterned ways:
| Data type | Typical distribution | Mean-variance relationship |
|---|---|---|
| Counts (colonies, offspring, cells) | Poisson-like, right-skewed | variance ≈ mean |
| Concentrations, sizes, masses | Log-normal, right-skewed | variance ∝ mean² (constant coefficient of variation) |
| Proportions/percentages (0–1) | Binomial-like | variance ∝ p(1−p), compressed near 0 and 1 |
Recognizing which pattern applies tells you which transformation to reach for — this is not guesswork but matched to the generating process.
Step 4: Apply the matching transformation.
- Log transform (usually natural log, ln, or log₁₀; use log(x+1) if zeros are present): converts multiplicative variation into additive variation. If a variable's standard deviation is roughly proportional to its mean (constant coefficient of variation) across groups — common for concentrations, body sizes, enzyme rates — the log transform stabilizes variance and symmetrizes right-skew.
- Square-root transform (√x, or √(x+0.5) for small counts with zeros): suited to count data following an approximately Poisson distribution, where variance equals the mean. Taking the square root stabilizes this mean-dependent variance because the transformation's derivative shrinks variability more where counts (and hence variance) are large.
- Arcsine-square-root transform (arcsine(√p), the "angular transformation"): suited to proportions or percentages bounded between 0 and 1, where variance is naturally compressed near the boundaries (p(1−p) shrinks toward 0 as p→0 or p→1). The arcsine-square-root spreads out the compressed tails, making variance roughly constant across the range of p.
Step 5: Re-check assumptions on the transformed scale, then run the t-test on transformed values. If assumptions now hold reasonably well, the resulting p-value is trustworthy.
Step 6: Interpret carefully. A test on log-transformed data tests equality of geometric means, and a significant difference is naturally reported as a fold-change (ratio) by back-transforming the difference in log-means: exponentiating a difference in ln-units gives a multiplicative ratio. A test on arcsine-transformed proportions is testing on the angular scale; conclusions about "difference in proportions" should be drawn cautiously, often supplemented by reporting the back-transformed proportions with confidence intervals for readability.
Alternative fixes when transformation doesn't work: If no transformation achieves reasonable normality and equal variance — common with heavily zero-inflated counts or highly discrete data — two escape routes exist. First, Welch's t-test (unequal-variance t-test), which adjusts the degrees of freedom using the Welch-Satterthwaite equation, handles unequal variances directly without touching normality; it is increasingly recommended as a default over the classic pooled-variance test. Second, when normality fails badly even after transformation, rank-based Non-Parametric Tests: Mann-Whitney & Wilcoxon sidestep distributional assumptions altogether by testing on ranks rather than raw values.
The evidence
Unlike a single famous "aha" experiment, the case for checking assumptions and using transformations rests on a convergence of theoretical statistics and decades of applied simulation studies. Two lines of evidence are foundational.
Student and Fisher's derivation of the t-distribution (early 1900s). William Sealy Gosset (publishing as "Student") derived the t-distribution in 1908 by working out, algebraically, the exact sampling distribution of the mean divided by the sample standard deviation — but only under the explicit assumption that the parent population is normally distributed. Ronald Fisher later formalized the degrees-of-freedom framework and clarified the assumptions rigorously (1925). This is not empirical evidence in the sense of a wet-lab experiment; it is a mathematical proof, and it directly tells you the price of departing from its premises: once the parent distribution is not normal, the t-statistic no longer exactly follows Student's distribution, and the exactness of the resulting p-value is lost — though the Central Limit Theorem provides some rescue for large samples, since sample means tend toward normality as sample size grows regardless of the underlying distribution's shape.
Box and Cox's 1964 paper "An Analysis of Transformations." George Box and David Cox provided the theoretical and practical machinery for choosing transformations systematically. They showed, using a family of power transformations (later called the Box-Cox family, of which log and square root are special cases), that an appropriately chosen transformation could simultaneously improve normality, stabilize variance, and make effects additive — the three properties that classical linear models (including the t-test as a two-group special case) require. Their method estimates the optimal power transformation from the data itself via maximum likelihood, giving an empirical, data-driven justification for choices like "take the log" rather than leaving it to intuition.
Simulation studies on Type I error robustness (accumulating through the 1970s–2000s). A large body of Monte Carlo simulation work — notably by Glass, Peckham, and Sanders (1972) reviewing dozens of studies, and later work by Rand Wilcox and others — repeatedly generated synthetic datasets with known violations (skewed distributions, unequal variances, unequal sample sizes) and ran thousands of simulated t-tests to see how often a nominal α = 0.05 test actually rejected a true null hypothesis. The consistent finding: the standard pooled-variance t-test's actual Type I error rate can inflate substantially above 5% when variances are unequal and sample sizes are unequal (especially when the smaller sample has the larger variance), while Welch's unequal-variance t-test kept error rates much closer to nominal across almost all conditions tested. This body of simulation evidence is why many statisticians (and software like R's default `t.test()`) now recommend Welch's test as the standard, rather than the classical Student's pooled-variance version.
Applied field evidence: log transforms in ecology and toxicology. Field studies repeatedly confirm the log-normal signature in biological measurements — for example, classic work on species-abundance distributions (Preston, 1948) showed that abundances across species in a community are well described by a log-normal distribution, directly motivating log transformation before parametric comparison. Similarly, LD50 dose-response toxicology data are conventionally analyzed on a log-dose scale because dose-response relationships are approximately linear and variance is approximately homogeneous only after the log transform — a practice validated across thousands of published bioassays.
Worked examples
Example 1 — Bacterial colony counts (a count/Poisson scenario). A microbiologist plates E. coli on two media (control vs. antimicrobial-supplemented agar) and counts colonies on 6 plates per group:
| Control | Supplemented |
|---|---|
| 88, 102, 95, 110, 91, 99 | 4, 12, 2, 25, 8, 3 |
Raw means: control ≈ 97.5, supplemented ≈ 9.0. Raw variances: control ≈ 60.7 (SD ≈ 7.8), supplemented ≈ 68.6 (SD ≈ 8.3). Variances look deceptively similar — but Levene's test and a Q-Q plot reveal the supplemented group is strongly right-skewed (one point, 25, is far from the rest), consistent with a low-count Poisson process where variance should scale with the mean (mean ≈ 9, so expected Poisson variance ≈ 9, far below the observed 68.6 — evidence of overdispersion, common in biological counts). Apply √(x + 0.5) to stabilize the count-based variance (adding 0.5 handles the low counts gracefully):
| Group | √(x+0.5) values | Mean | Variance |
|---|---|---|---|
| Control | 9.41, 10.12, 9.77, 10.51, 9.57, 9.97 | 9.89 | 0.16 |
| Supplemented | 2.12, 3.54, 1.58, 5.05, 2.92, 1.87 | 2.85 | 1.47 |
Variances are now much closer in relative terms given the transform, and the extreme skew of the supplemented group is tamed (25 → 5.05, no longer a wild outlier on this scale). Running the two-sample t-test on the transformed data gives a clean, defensible comparison: t ≈ 10.9, df ≈ 6.3 (Welch-adjusted), p < 0.001 — a genuine, robust effect, not an artifact of one inflated count.
Example 2 — Proportion of seeds germinating under two watering regimes. An agronomist tests germination proportion in 10 trays of 50 seeds each, under low-water and high-water regimes:
| Regime | Germination proportions (10 trays) |
|---|---|
| Low water | 0.04, 0.08, 0.02, 0.10, 0.06, 0.02, 0.12, 0.04, 0.06, 0.08 |
| High water | 0.94, 0.88, 0.96, 0.90, 0.92, 0.98, 0.86, 0.90, 0.94, 0.92 |
Both groups sit near a boundary (0 or 1), where binomial variance p(1−p) is naturally compressed — low-water proportions near 0 have variance ≈ p(1−p) ≈ 0.06×0.94 ≈ 0.056, while a hypothetical mid-range proportion (p = 0.5) would have variance ≈ 0.25, roughly 4-5× larger. This mean-dependent, boundary-compressed variance is the classic arcsine-square-root signature. Apply arcsine(√p) (in radians):
| Regime | Transformed mean (radians) | Transformed variance |
|---|---|---|
| Low water | 0.263 | 0.00047 |
| High water | 1.253 | 0.00068 |
The transformed variances are now far closer in magnitude relative to their scale, and a t-test on the arcsine-transformed values (t ≈ 46, df = 18, p < 0.0001) gives a valid, assumption-respecting comparison. Back-transforming, the practical conclusion is reported plainly: germination rose from ~6% to ~92% under high water — a result any agronomist can act on, obtained through a test that was actually valid to run.
Common misconceptions & traps
| Misconception | Reality |
|---|---|
| "My sample size is decent, so I don't need to check assumptions." | The Central Limit Theorem helps normality with large n, but does nothing for unequal variances — variance problems don't disappear with sample size. |
| "If Shapiro-Wilk isn't significant, my data are normal." | Failing to reject normality just means the test lacked power to detect a deviation (common in small samples) — absence of evidence isn't evidence of normality. |
| "Transforming the data is 'cheating' or manipulating results." | Transformation only changes the measurement scale; many biological quantities are naturally multiplicative, so the transformed scale can be the more honest one. |
| "Any transformation that makes the p-value smaller is the right one." | The correct transform is chosen based on the known mean-variance relationship of the data type, not by p-hacking toward significance. |
| "I should always use log, since it's the 'default' transform." | Log is for multiplicative/mean-proportional variance (sizes, concentrations); Poisson counts want √x, and bounded proportions want arcsine(√p) — mismatched transforms can make things worse. |
| "Equal variances means equal standard deviations look similar by eye." | Formal tests (Levene's, Brown-Forsythe) and variance ratios are needed; visual impressions of spread are unreliable, especially with small or skewed samples. |
The scientist behind it
The transformation toolkit traces to statisticians solving very practical agricultural and industrial problems, not abstract theory for its own sake. Ronald Fisher, working at Rothamsted Experimental Station in the 1920s, confronted skewed and unequal-variance yield data from field trials constantly, and it was in this applied soil that the demand for both rigorous test theory and practical transformations grew. But the transformation methodology proper is most associated with George E. P. Box, a British statistician who spent much of his career at Imperial Chemical Industries and later the University of Wisconsin, working on industrial quality control and design of experiments — contexts saturated with skewed, ratio-scaled, and boundary-constrained measurements (yields, concentrations, defect rates) that cried out for a systematic transformation theory. Box's collaboration with David Cox, a distinguished British statistician renowned for the Cox proportional hazards model in survival analysis, produced the 1964 Box-Cox paper that placed transformation selection on a rigorous likelihood footing: rather than trial-and-error, the "best" power transformation could be estimated directly from the data, unifying log, square-root, reciprocal, and untransformed analyses as special cases of one family.
Origins · 1 minGeorge Edward Pelham Box and how this was discovered
Where this matters today
In clinical trials and biomedical research, lab values like viral load, cytokine concentrations, and enzyme activities are routinely log-transformed before parametric analysis, because these measurements typically follow log-normal distributions across patients — a mismatch ignored in early trial designs led to underpowered or miscalibrated tests, a lesson now built into standard biostatistics guidelines (e.g., FDA statistical review guidance often expects justification of transformation choices). In ecology and conservation biology, count data — number of individuals per quadrat, nests per hectare, pathogen loads per host — are so reliably overdispersed relative to a simple Poisson model that modern practice increasingly favors generalized linear models with a negative binomial or Poisson-log link rather than transform-then-t-test, but the underlying diagnostic logic (checking mean-variance relationships) is identical, and simple transformations remain a valid quick-and-dirty first pass for smaller studies and undergraduate research projects. In agricultural science, germination rates, infection incidence, and disease prevalence are still commonly analyzed via arcsine transformation in classical field-trial designs, especially where sample sizes are modest and full generalized linear mixed model infrastructure is unavailable or unnecessary. In microbiology and virology, serial dilution assays (plaque counts, colony-forming units, TCID50 titers) are essentially always analyzed on the log scale, since dilution series are inherently multiplicative — a tenfold dilution changes concentration by a constant ratio, not a constant amount, making the log scale the natural, not merely convenient, choice. Finally, in pharmacology and toxicology, dose-response curve fitting (LD50, EC50 estimation) is built entirely around log-dose scales, and the transformation logic taught here is the direct ancestor of the log-logistic and probit models used in regulatory toxicology today.
Ask the tutor: How do I decide between transforming my data versus just switching to a non-parametric test?
Why can't I just always use Welch's test and skip checking normality?
Welch's test only relaxes the equal-variance assumption — it still assumes each group's data are reasonably normal, or that sample sizes are large enough for the Central Limit Theorem to make group means approximately normal regardless of the underlying distribution. If data are strongly skewed with a small sample (say, n < 15 per group) and contain outliers, Welch's test can still be unreliable. In that situation, transformation to improve normality remains valuable even after switching to Welch's test for variance robustness — the two fixes address different assumptions and are often used together, not as substitutes for one another.
If I transform the data, what exactly am I testing — the original means or something else?
You are testing equality of a summary statistic on the transformed scale, which back-transforms to a different quantity than the arithmetic mean. For log-transformed data, the mean of the logs back-transforms to the geometric mean, so a significant t-test on log-data is technically a test of equal geometric means, and differences are best reported as ratios (fold-changes) rather than raw differences. For arcsine-transformed proportions, the test operates on an angular scale with no simple closed-form back-transformed "mean," so results are often reported as the transformed test statistic alongside untransformed descriptive proportions for interpretability.
How many observations do I need before I can trust a normality test like Shapiro-Wilk?
There's no fixed magic number, but the deeper issue is that Shapiro-Wilk's power to detect real non-normality is low for small samples (n < 20) and very high for large samples (n > 200), where it can flag trivial, practically irrelevant deviations as statistically significant. The practical approach: for small samples, rely heavily on Q-Q plots and biological knowledge of the measurement's typical distribution (e.g., "concentrations are usually log-normal") rather than the formal test alone; for large samples, don't panic over a significant Shapiro-Wilk result if the Q-Q plot looks close to linear by eye.
What if a transformation fixes normality but makes variances unequal, or vice versa?
This happens, and there's no universal transformation that guarantees both properties simultaneously for every dataset — the Box-Cox procedure searches for the power transformation that best balances both criteria via maximum likelihood, but a perfect fix isn't always achievable. In practice, prioritize equalizing variance if the two groups' distributional shapes are otherwise similar (since Welch's test can further buffer residual variance inequality), or consider that the sample size and effect size may make a modest violation tolerable. If nothing works well, non-parametric alternatives like Non-Parametric Tests: Mann-Whitney & Wilcoxon avoid the distributional battle altogether.
Can I apply different transformations to the two groups being compared?
No — this breaks the logic of the comparison. A transformation must be applied identically to all observations across both groups (and ideally justified by the data type as a whole, not tuned separately per group) so that the two transformed samples remain comparable on a common, shared scale. Choosing per-group transformations that happen to make each group individually "look normal" is a form of data manipulation that invalidates the resulting test, since the meaning of the compared statistic would differ between groups.
Does checking assumptions and transforming apply to ANOVA too, not just the t-test?
Yes, directly — Analysis of Variance (ANOVA) is a direct generalization of the t-test to more than two groups, and it carries the identical assumptions: normally distributed residuals within each group and homogeneity of variance across all groups (tested via Levene's test extended to multiple groups). The same diagnostic tools (Q-Q plots of residuals, residual-vs-fitted plots) and the same transformation toolkit (log, square-root, arcsine) apply essentially unchanged when moving from comparing two group means to comparing three or more.
Is it legitimate to transform data, run the test, and then report untransformed means in a paper's summary table?
It's common and generally acceptable, but the two must be kept conceptually distinct: the inferential test (p-value, confidence interval) should be computed and reported on the scale where assumptions hold, while descriptive summary tables can present untransformed (or back-transformed) values for readability, since raw units are more intuitive to readers. What is not acceptable is silently reporting an untransformed mean difference alongside a p-value that was actually computed on log-transformed or arcsine-transformed data without clarifying this in the methods — that conflates two different quantities and misleads readers about what was actually tested.