Statistics tutorial · Chapter 01
Principles of statistics
This chapter lays the foundations on which every other chapter of the tutorial rests: what we describe when we summarize data, the probability distributions used by the tests, what a confidence interval and a P value are exactly, why running many tests is a problem, which conditions each test assumes and how to check them. Whenever Variance makes a computational choice (definition of percentiles, method for the interval of a proportion, corrections for multiple comparisons, display of P values), the choice is stated and the formula used is given.
Conventions of this chapter: n is the number of values, x₁ … xₙ the values, x₍₁₎ ≤ … ≤ x₍ₙ₎ the same values sorted (order statistics), m the sample mean and s its standard deviation.
Populations, samples and inference#
A study measures a sample in order to learn something about a population: all the mice of this strain raised under these conditions, all the patients meeting the inclusion criteria, all the possible repetitions of an experiment. Population values (mean μ, standard deviation σ, proportion π) are parameters, fixed but unknown; values computed from the sample (m, s, p) are statistics, which vary from one sample to the next. Statistical inference draws conclusions about the parameters from the statistics, taking this sampling variability into account.
This reasoning is valid only if:
- the sample is representative of the target population (random sampling, or at least no selection related to what is measured);
- the observations are independent, or their dependence is taken into account by the analysis (paired, repeated or nested measurements);
- the experimental unit is correctly identified: it is the smallest entity to which the treatment is independently assigned (the animal, the cage, the culture dish, the patient). The n of an analysis is the number of experimental units, not the number of technical measurements.
The observed variability has several sources: biological variability between units, measurement error, and sometimes mistakes (data entry, handling). Statistics quantify the first two; they do not correct the third.
Two distinct quantities follow. The standard deviation (SD) describes the scatter of individual values; it does not shrink as n grows. The standard error of a statistic describes how much that statistic varies from sample to sample; the standard error of the mean (SEM = SD/√n) shrinks as n grows. The central limit theorem guarantees that, for large enough n, the mean of a sample is approximately normally distributed whatever the distribution of the values, which underlies many methods; "large enough" depends on the skewness of the distribution: a few values suffice for a symmetric distribution, several dozen may be needed for a very skewed one.
Types of variables#
The type of variable determines which summaries and tests are possible:
| Type | Examples | Summaries | Typical tests |
|---|---|---|---|
| Continuous quantitative | concentration, weight, reaction time | mean, SD, median, quartiles | t, ANOVA, regression, Mann-Whitney |
| Discrete quantitative (counts) | number of colonies, of cells | mean, median; Poisson distribution | Poisson regression, nonparametric tests |
| Ordinal | pain score 0–10, stage | median, quartiles, frequencies | rank tests (Mann-Whitney, Kruskal-Wallis, Spearman) |
| Nominal (categorical) | genotype, sex, blood group | counts, proportions | chi-square, Fisher's exact test |
| Binary | diseased / healthy, 1 / 0 | proportion | Fisher, chi-square, logistic regression |
| Time to event | survival, time to relapse | Kaplan-Meier curve, median survival | log-rank, Cox model |
For quantitative variables, an interval scale (arbitrary zero: temperature in °C) is distinguished from a ratio scale (zero means absence: mass, concentration). Ratios, the coefficient of variation and geometric means only make sense on a ratio scale.
Censored data (subject lost to follow-up or still alive at the end of the study) only give a lower bound of the survival time; they require survival methods, never an average of the observed times.
In Variance, the type of variable translates into the type of table: One factor (one grouping variable, each column is a group), XY (one X variable and one or more Y), Two factors (two grouping variables, rows × columns), Contingency (counts crossing groups and outcomes), Survival (time and event code, 1 = event, 0 = censored), Parts of whole (categories of a whole), Multivariable (one row per individual, one column per variable, categorical ones included) and Nested (subcolumns nested within groups). The analyses offered by the Analyze menu depend on the type of the active table.
Descriptive statistics#
Descriptive statistics summarize a sample by its location, its spread and its shape. In Variance they are computed by Analysis › Describe and Explore › Descriptive Statistics (One factor, XY, Two factors, Nested and Multivariable tables) and, for a pasted list of values, by Tools › Calculators… › "Descriptive statistics". Only finite numeric values are used: empty cells, text and excluded values are ignored. The details of the analysis (options, result rows) are given in the chapter "Describing and exploring"; here are the exact definitions.
Location#
Mean m = (x₁ + x₂ + … + xₙ) / n
Median x₍(n+1)/2₎ if n is odd;
(x₍n/2₎ + x₍n/2+1₎) / 2 if n is even
Percentiles (quartiles included) have several definitions in the literature; Hyndman and Fan (1996) list nine, which give different results in small samples. Variance uses the "(n + 1)p" method, known as type 6 of Hyndman and Fan (or the NIST method), the most common one in biostatistics software:
h = (n + 1) × p p = 0.25 for Q1, 0.75 for Q3, 0.10, 0.90…
if h ≤ 1: Pp = x₍₁₎
if h ≥ n: Pp = x₍ₙ₎
otherwise: Pp = x₍k₎ + (h − k) × (x₍k+1₎ − x₍k₎) with k = integer part of h
For p = 0.5 this definition gives back the median. A spreadsheet often uses another definition (type 7, h = (n − 1)p + 1): its quartiles may therefore differ slightly from those of Variance without either being wrong.
Spread#
Range x₍ₙ₎ − x₍₁₎
Variance s² = Σ (xᵢ − m)² / (n − 1)
Standard deviation (SD) s = √s²
Standard error (SEM) SEM = s / √n
Coefficient of CV = s / m (shown in %, × 100)
variation
Interquartile range IQR = Q3 − Q1
MAD median of the |xᵢ − median|
The denominator n − 1 (not n) makes s² unbiased for σ²: since the mean m is computed from the same data, only n − 1 independent deviations remain (degrees of freedom). At least two values are needed to compute an SD.
Points to note:
- Variance shows "Std. Deviation" (SD) and "Standard error of the mean" (SEM), but not the variance, which is simply SD².
- The SEM is not a measure of the scatter of the data: it measures the precision of the mean. It is used to build the confidence interval of the mean.
- The CV ("Coefficient of variation (%)") only makes sense for positive values on a ratio scale; it is negative if the mean is.
- The IQR is not a row of the results: it is derived from the rows "25% Percentile" and "75% Percentile".
- The MAD shown ("Median absolute deviation") is the median of the absolute deviations from the median, not rescaled. To estimate σ robustly when the data are normal, multiply it by 1.4826 (= 1/Φ⁻¹(0.75)).
Shape: skewness and kurtosis#
Variance computes the adjusted coefficients G1 and G2 (Joanes and Gill, 1998), those of most statistical software and spreadsheets:
zᵢ = (xᵢ − m) / s
Skewness G1 = n / ((n − 1)(n − 2)) × Σ zᵢ³ (n ≥ 3)
Kurtosis G2 = n(n + 1) / ((n − 1)(n − 2)(n − 3)) × Σ zᵢ⁴
− 3(n − 1)² / ((n − 2)(n − 3)) (n ≥ 4)
G1 is 0 for a symmetric distribution; it is positive when the right tail is the longer one (typical of concentrations, times, counts). G2 is the excess kurtosis: 0 for a normal distribution, positive for heavier tails (more extreme values), negative for a "flatter" distribution. In small samples both coefficients are very imprecise: interpret them with caution below a few dozen values.
Geometric, harmonic and quadratic means#
Geometric mean GM = exp( mean of the ln xᵢ ) (all xᵢ > 0)
Geometric SD factor GSD = exp( SD of the ln xᵢ )
Harmonic mean H = 1 / ( mean of the 1/xᵢ ) (all xᵢ > 0)
Quadratic mean Q = √( mean of the xᵢ² )
The geometric mean is the appropriate mean for lognormal data (concentrations, titers, ratios): it is the mean computed on the logarithmic scale, brought back to the original scale. The geometric SD factor ("Geometric SD factor") has no unit and is used by multiplication and division: for lognormal data, about 68% of the values lie between GM/GSD and GM × GSD. If a value is zero or negative, these quantities (and the harmonic mean) are not computed and the cell stays empty. For any positive, non-constant data, H < GM < m.
Confidence intervals shown by Descriptive Statistics#
CI of the mean m ± t(1 − α/2; n − 1) × SEM
CI of the geometric mean exp( CI of the mean of the ln xᵢ )
CI of the harmonic mean 1 / bounds of the CI of the mean of the 1/xᵢ (bounds swapped;
not computed if the lower bound of that CI is ≤ 0)
CI of the quadratic mean √ of the bounds of the CI of the mean of the xᵢ² (lower ≥ 0)
The CI of the median is nonparametric, based on order statistics. The number of values below the population median follows a binomial distribution B(n; 1/2). Variance looks for the largest rank l such that P(B ≤ l − 1) ≤ α/2, with B ~ B(n; 1/2):
CI of the median [ x₍l₎ ; x₍n−l+1₎ ]
Actual level 1 − 2 × P(B ≤ l − 1) (≥ requested level)
Because the binomial distribution is discrete, the actual level is usually higher than the requested one; Variance shows it ("Actual confidence level of median CI (%)"). If no rank qualifies (n ≤ 5 for 95%), the interval is [x₍₁₎ ; x₍ₙ₎] and its actual level, 1 − 2 × 0.5ⁿ, is then lower than the requested level (93.75% for n = 5).
Worked example: the "Wild type" column#
In the Start window, choose a One factor table, then "an example" › Two groups (t test). The "Wild type" column holds 12 values; sorted:
4.432 4.836 5.128 5.206 5.235 5.238 5.303 5.348 5.378 5.584 5.605 5.718
By hand:
n = 12 Σx = 63.011 m = 63.011 / 12 = 5.25092
Σ(x − m)² = 1.343101 s² = 1.343101 / 11 = 0.122100
s = 0.34943 SEM = 0.34943 / √12 = 0.10087
Median = (x₍₆₎ + x₍₇₎)/2 = (5.238 + 5.303)/2 = 5.2705
Q1: h = 13 × 0.25 = 3.25 → 5.128 + 0.25 × (5.206 − 5.128) = 5.1475
Q3: h = 13 × 0.75 = 9.75 → 5.378 + 0.75 × (5.584 − 5.378) = 5.5325
P10: h = 1.3 → 4.432 + 0.3 × (4.836 − 4.432) = 4.5532
t(0.975; 11) = 2.20099
95% CI of the mean = 5.25092 ± 2.20099 × 0.10087 = 5.0289 to 5.4729
CI of the median: P(B ≤ 2) = 79/4096 = 0.0193 ≤ 0.025 but P(B ≤ 3) = 0.0730
→ l = 3 → [x₍₃₎ ; x₍₁₀₎] = [5.128 ; 5.584], actual level 1 − 2 × 0.0193 = 96.14%
CV = 0.34943 / 5.25092 = 6.655%
MAD: sorted |x − 5.2705|, median of the 6th and 7th = (0.1075 + 0.1425)/2 = 0.125
Variance gives the same values: mean 5.251, SD 0.3494, SEM 0.1009, CI 5.029 to 5.473, CV 6.655%, skewness −1.115, kurtosis 1.839, geometric mean 5.24 (factor 1.071), harmonic mean 5.228, quadratic mean 5.262, MAD 0.125. With 4 significant digits (default setting of "Significant digits", "Options" tab), the quartiles are shown as 5.147, 5.271 and 5.532: the exact values 5.1475, 5.2705 and 5.5325 fall halfway and are rounded according to their binary representation; increase the number of digits to see them in full. The negative skewness (−1.12) comes from the value 4.432, clearly lower than the others: an example of a value that deserves checking (see the section on outliers) rather than removal.
Probability distributions used by the tests#
A test compares a statistic computed from the data with its distribution under the null hypothesis; a confidence interval uses the quantiles of a distribution. The following distributions appear throughout the tutorial:
| Distribution | Parameters | Mean | Variance | Used in Variance by |
|---|---|---|---|---|
| Normal N(μ; σ²) | μ, σ > 0 | μ | σ² | z approximations (Mann-Whitney, Wilcoxon, Dunn), Wilson CI, CI of r (Fisher's z), QQ plots, simulations |
| Lognormal | μ and σ of ln X | exp(μ + σ²/2) | (exp(σ²) − 1) exp(2μ + σ²) | "Lognormal" options of the t tests and ANOVA (computed on log10), geometric mean |
| Student's t(ν) | ν degrees of freedom | 0 (ν > 1) | ν/(ν − 2) (ν > 2) | t tests, CIs of means and differences, test of r, multiple comparisons, Grubbs, ROUT |
| Chi-square χ²(ν) | ν | ν | 2ν | chi-square, Kruskal-Wallis, Friedman, log-rank, Bartlett, D'Agostino-Pearson, likelihood ratios |
| F(ν₁; ν₂) | ν₁, ν₂ | ν₂/(ν₂ − 2) (ν₂ > 2) | see textbooks | ANOVA, F test of variances, Brown-Forsythe, Welch, extra sum-of-squares F test |
| Binomial B(n; π) | n, π | nπ | nπ(1 − π) | binomial test, CI of the median, Clopper-Pearson CI (through the beta distribution) |
| Poisson P(λ) | λ > 0 | λ | λ | counts: Poisson regressions, "Poisson" error of the simulations |
| Hypergeometric | N, K, n | nK/N | n(K/N)(1 − K/N)(N − n)/(N − 1) | Fisher's exact test |
Their definitions:
Normal density f(x) = exp(−(x − μ)² / (2σ²)) / (σ √(2π))
Lognormal X is lognormal if ln X ~ N(μ; σ²); median = exp(μ)
Student's t T = Z / √(V/ν) with Z ~ N(0; 1), V ~ χ²(ν) independent
Chi-square V = Z₁² + … + Z_ν² (sum of ν squared standard normal variables)
F F = (V₁/ν₁) / (V₂/ν₂) with V₁ ~ χ²(ν₁), V₂ ~ χ²(ν₂) independent
Binomial P(X = k) = C(n, k) π^k (1 − π)^(n − k) k = 0 … n
Poisson P(X = k) = e^(−λ) λ^k / k! k = 0, 1, 2…
Hypergeometric P(X = k) = C(K, k) C(N − K, n − k) / C(N, n)
(k successes in n draws without replacement from N items, K successes)
As ν grows, t(ν) tends to N(0; 1); its heavier tails reflect the extra uncertainty due to estimating σ by s. Variance computes the distribution functions with the regularized incomplete beta and gamma functions, and computes the upper-tail probability directly (instead of 1 − F(x)), which keeps full relative precision for very small P values.
Some critical values (two-sided at 5%, except χ² and F, right tail at 5%):
| Distribution | Critical value |
|---|---|
| z | 1.960 (2.576 at 1%) |
| t, ν = 2 / 5 / 9 / 11 / 20 / 30 / 100 | 4.303 / 2.571 / 2.262 / 2.201 / 2.086 / 2.042 / 1.984 |
| χ², ν = 1 / 2 | 3.841 / 5.991 |
| F, ν₁ = 2, ν₂ = 21 | 3.467 |
Confidence intervals#
Definition and interpretation#
A 95% confidence interval (CI) is the result of a procedure which, applied to a large number of samples drawn from the same population, would produce intervals containing the true parameter in 95% of cases, if the assumptions of the computation are true. For a given interval, the parameter is either inside or not; "95%" qualifies the method, not this particular interval.
What a 95% CI is not:
- it does not contain 95% of the individual values (that is the role of a prediction or tolerance interval, much wider);
- strictly speaking, it does not give a 95% probability that the parameter lies within it (that reading is the one of a Bayesian credible interval);
- it only accounts for sampling error: a bias (selection, measurement, confounding) leaves it narrow but wrong.
The width of a CI depends on the scatter of the data, on n (it varies as 1/√n: about four times more data are needed to halve it) and on the chosen level. In Variance, the level is set by "Confidence level (%)" ("Options" tab, 95% by default, from 50 to 99.99%). The CIs shown are two-sided; in the t tests, the CI remains two-sided even when a one-tailed P value is chosen.
A 95% CI of a difference excludes 0 exactly when the corresponding two-sided test gives P < 0.05, if both are computed by the same method (for example the t test and the t-based CI). This no longer holds when the CI and the test rely on different methods (Mann-Whitney P and Hodges-Lehmann CI, Fisher's exact P and CI of a relative risk…).
CI of a mean#
CI = m ± t(1 − α/2; n − 1) × s / √n
It assumes independent observations and, for small n, a roughly normal population. For n = 12, s = 0.349 and 95%: t = 2.201, half-width 0.222 (see the "Wild type" example). Tools › Calculators… › "CI of a mean" computes it from the mean, SD and n (rows "SEM", "95% CI", "Margin of error").
CI of a proportion#
For x successes in n trials (p = x/n), Variance offers three methods; z = Φ⁻¹(1 − α/2) (1.960 for 95%):
Wilson score (without continuity correction)
center = (p + z²/(2n)) / (1 + z²/n)
half-width = z / (1 + z²/n) × √( p(1 − p)/n + z²/(4n²) )
CI = center ± half-width, bounded to [0; 1]
Clopper-Pearson ("exact")
lower bound = α/2 quantile of the Beta(x; n − x + 1) distribution (0 if x = 0)
upper bound = 1 − α/2 quantile of the Beta(x + 1; n − x) distribution (1 if x = n)
Wald
CI = p ± z √( p(1 − p)/n ), bounded to [0; 1]
The Wilson interval (1927) is the one recommended by Brown, Cai and DasGupta (2001): its coverage stays close to the stated level even for small n or proportions close to 0 or 1. Clopper-Pearson guarantees a coverage at least equal to the stated level, at the price of wider (conservative) intervals. Wald covers poorly when n is small or p extreme, and even shrinks to a single point when x = 0 or x = n: it is offered only for comparison.
Where these methods are used: Contingency Table Tests, list "Method for proportions" ("Wilson score (recommended)", "Clopper-Pearson (exact)", "Wald") for the sensitivity, specificity and predictive values of a 2 × 2 table; ROC Curve ("Wilson score" or "Clopper-Pearson"); Share of Total (option "Compute binomial confidence intervals (column totals)", Wilson method); the proportion of simulations meeting the criterion in Monte Carlo Simulation (Wilson); Help › Calculators… › "CI of a proportion", which shows all three.
Example (sample Contingency table "Treatment and outcome (2×2)"): 15 diseased out of 100 treated subjects, p = 0.15.
z² = 3.8415
center = (0.15 + 3.8415/200) / (1 + 3.8415/100) = 0.169207 / 1.038415 = 0.16295
half-width = (1.95996 / 1.038415) × √(0.15 × 0.85/100 + 3.8415/40000)
= 1.88746 × √0.00137104 = 1.88746 × 0.037028 = 0.06989
Wilson : 0.0931 to 0.2328
Clopper-Pearson : 0.0865 to 0.2353
Wald : 0.0800 to 0.2200
With 0 successes out of 20, Wald gives the absurd "0 to 0", Wilson 0 to 0.161 and Clopper-Pearson 0 to 0.168.
Hypothesis tests and P values#
Null hypothesis and test statistic#
A hypothesis test starts from a null hypothesis H0, usually the absence of an effect (the population means are equal, the proportion is 0.5, two variables are independent), and an alternative hypothesis H1 (the means differ). It computes a test statistic (t, F, χ², U, z…) that measures the discrepancy between the data and H0 in units of its uncertainty, and whose distribution is known when H0 and the conditions of the test are true.
Exact definition of the P value#
The P value is the probability, computed assuming that H0 is true (as well as all the assumptions of the model: independence, shape of the distributions…), of obtaining a test statistic at least as far from H0 as the one observed, in the direction(s) specified by H1.
Direct consequences:
- P is not the probability that H0 is true, nor the probability that the result is due to chance; these probabilities would require knowing the prior probability of H0 (Bayesian approach).
- 1 − P is not the probability that the effect is real nor that the experiment will replicate.
- A small P means that the data would be surprising if H0 were true: either H0 is false, or a rare event happened, or an assumption of the test is violated.
- P depends both on the size of the effect and on n: a tiny effect becomes "significant" with a very large n, a large effect may not be with a small n.
- Under H0 (for a continuous test whose conditions are met), P is uniformly distributed between 0 and 1: under H0, a P of 0.04 is no "rarer" than a P of 0.73.
One-tailed or two-tailed test#
A two-tailed P counts equally extreme deviations in both directions; a one-tailed P counts only one. In Variance, the "P value" list ("Options" tab) offers "Two-tailed", "One-tailed (second group greater)" and "One-tailed (second group smaller)". The two-tailed P is computed as twice the smaller of the two tail probabilities, capped at 1:
two-tailed P = min( 1 ; 2 × min( P(T ≥ t_obs) ; P(T ≤ t_obs) ) )
For a symmetric distribution (t, z), this is twice the one-tailed P in the observed direction. Exact discrete two-sided tests work differently: Fisher's exact test and the binomial test add the probabilities of all outcomes no more likely than the observed one. F and χ² tests only use the right tail of their distribution but detect deviations in every direction.
A one-tailed test is justified only if the direction was fixed before seeing the data and if an effect in the other direction, even a large one, would have been treated as no effect. When in doubt, use a two-tailed test.
Threshold α, statistical significance and decision#
The threshold α** ("Significance level (alpha)", 0.05 by default) is set in advance. If P < α, the result is called "statistically significant" and H0 is rejected; otherwise H0 cannot be rejected, which **does not prove it is true. The rows of the form "Difference significant at α = 0.05" in Variance's results compare the exact (unrounded) P with α and answer "Yes" or "No".
| H0 true | H0 false | |
|---|---|---|
| P < α (H0 rejected) | type I error (false positive), probability α | correct decision, probability 1 − β (power) |
| P ≥ α (H0 kept) | correct decision, probability 1 − α | type II error (false negative), probability β |
Power (1 − β) is the probability of detecting an effect of a given size; it increases with the size of the effect, with n and with α, and decreases as variability increases.
Effect size#
A test answers "is the effect distinct from zero?"; it does not say whether it is large. Always report the effect size with its CI, in the units of the data when possible. What Variance shows:
| Analysis | Effect size |
|---|---|
| t tests | difference between means (± SEM) and its CI; "R squared (eta squared)" = t²/(t² + df); Cohen's d and Hedges' g with an approximate CI (normal data); ratio of geometric means (lognormal option) |
| Mann-Whitney, Wilcoxon | difference between medians; Hodges-Lehmann estimate and its CI |
| ANOVA | "R squared" (fraction of variance explained); mean differences and their CIs in the multiple comparisons |
| Correlation, regression | r, r², slope and their CIs |
| 2 × 2 tables | relative risk, risk difference, NNT, odds ratio, sensitivity, specificity, with CIs |
| Survival | median survival times, hazard ratio and CI |
| ROC | area under the curve and CI |
Cohen's standardized difference, d = (m₂ − m₁)/s_pooled, is not shown; for two independent groups it follows from the unpaired t: d = t × √(1/n₁ + 1/n₂). The "small, medium, large" benchmarks (0.2; 0.5; 0.8) proposed by Cohen are generic: the importance of an effect is judged first in its biological or clinical context.
Worked example: a t test on the "Two groups (t test)" sample#
On the sample table (Wild type, n = 12; Knock-out, n = 10), run Analysis › Compare Groups › Two-Group Comparisons with the default options (unpaired, parametric test, same SD, two-tailed).
m_A = 5.25092 s_A = 0.34943 n_A = 12
m_B = 6.52760 s_B = 0.57837 n_B = 10
Pooled variance s_p² = (11 × 0.122100 + 9 × 0.334513) / 20 = 0.217686
SE of the difference √(0.217686 × (1/12 + 1/10)) = 0.19977
Difference B − A 1.27668
t = 1.27668 / 0.19977 = 6.391 df = 12 + 10 − 2 = 20
two-tailed P = 2 × P(T₂₀ ≥ 6.391) = 3.1 × 10⁻⁶
95% CI = 1.27668 ± 2.08596 × 0.19977 = 0.860 to 1.693
R² = 6.391² / (6.391² + 20) = 0.671 Cohen's d = 6.391 × √(1/12 + 1/10) = 2.74
Variance shows "P value" <0.0001, "Significance code" ****, "t" 6.391 with "df" 20, the difference 1.277 with its SEM 0.1998, the CI 0.86 to 1.693 and "R squared (eta squared)" 0.6713. Reading: if both populations had the same mean, samples of this size would show a difference at least as large (in either direction) with a probability of about 3 in a million; the CI indicates that the true difference most likely lies between 0.86 and 1.69 units.
Multiple comparisons#
The problem#
Each test performed at threshold α has a probability α of giving a false positive when H0 is true. With m independent tests whose null hypotheses are all true, the probability of at least one false positive, the familywise error rate (FWER), is:
FWER = 1 − (1 − α)^m
| Number of tests m | 1 | 3 | 6 | 10 | 20 | 45 | 100 |
|---|---|---|---|---|---|---|---|
| FWER (α = 0.05) | 0.05 | 0.14 | 0.26 | 0.40 | 0.64 | 0.90 | 0.99 |
Comparing 10 groups pairwise means 45 comparisons: without correction, at least one false positive is almost certain. Before any correction, define the family: the set of comparisons that answer the same question and whose conclusions will be read together. Two strategies exist: control the FWER (the probability of at least one false conclusion) or control the false discovery rate (FDR, the expected proportion of false discoveries among the results declared positive), less strict and suited to large numbers of tests.
An adjusted P ("Adjusted P Value") is the smallest familywise α at which the comparison would be declared significant with the chosen procedure; a q value ("q value") is the smallest FDR at which it would be a discovery. They are compared directly with α or Q.
Controlling the FWER#
With m raw P values sorted P₍₁₎ ≤ P₍₂₎ ≤ … ≤ P₍ₘ₎, Variance computes:
Bonferroni P_adj = min(1 ; m × P)
Šidák P_adj = 1 − (1 − P)^m
Holm P_adj₍ᵢ₎ = max over j ≤ i of min(1 ; (m − j + 1) × P₍ⱼ₎)
Holm-Šidák P_adj₍ᵢ₎ = max over j ≤ i of 1 − (1 − P₍ⱼ₎)^(m − j + 1)
Equivalent thresholds: Bonferroni declares significant any P ≤ α/m; Šidák any P ≤ 1 − (1 − α)^(1/m) (0.00512 instead of 0.005 for m = 10). Holm is a step-down procedure: P₍₁₎ is compared with α/m, P₍₂₎ with α/(m − 1)… stopping at the first non-significant P; it controls the FWER like Bonferroni but rejects at least as many hypotheses. Bonferroni and Holm are valid whatever the dependence between tests; Šidák and Holm-Šidák assume independent (or positively dependent) tests and are then slightly more powerful.
After an ANOVA, procedures specific to comparisons of means use the known dependence between comparisons: Tukey (all pairs, studentized range distribution, Tukey-Kramer version when the n differ), Dunnett (each group against a control), Games-Howell and Dunnett T3 (unequal SDs). Fisher's LSD corrects nothing; Newman-Keuls does not control the FWER and is offered only for compatibility. They are described in the chapter "Comparing groups".
Controlling the false discovery rate#
If V is the number of false discoveries among R discoveries, FDR = E[V/R] (with V/R = 0 if R = 0). With Q the target FDR:
Benjamini-Hochberg (BH)
q₍ᵢ₎ = min over j ≥ i of min(1 ; m × P₍ⱼ₎ / j)
discoveries: q ≤ Q (i.e. the largest k with P₍ₖ₎ ≤ k Q / m, and all ranks ≤ k)
Benjamini-Yekutieli (BY)
c(m) = 1 + 1/2 + 1/3 + … + 1/m
q₍ᵢ₎ = min over j ≥ i of min(1 ; c(m) × m × P₍ⱼ₎ / j)
Two-stage step-up of Benjamini, Krieger and Yekutieli (BKY)
Q' = Q / (1 + Q)
stage 1: BH procedure at level Q' → r₁ discoveries
r₁ = 0: no discovery; r₁ = m: everything is a discovery
stage 2: m̂₀ = m − r₁ (estimated number of true null hypotheses);
discoveries = ranks 1 … k, k the largest with P₍ₖ₎ ≤ k Q' / m̂₀
q (BKY) = smallest Q at which the hypothesis is a discovery
(Variance computes it by bisection)
BH controls the FDR for independent or positively dependent tests; BY controls it for any dependence structure, at the price of a large loss of power; BKY is an adaptive procedure: by estimating the number of true null hypotheses, it gains power when many effects are real (validity proven for independent tests). Its q values can be smaller than the raw P value.
Worked example: a stack of ten P values#
Enter these ten P values in one column of a One factor table and run Analysis › Describe and Explore › Multiple P Values (FDR) ("Approach", "Desired FDR Q or alpha (%)" = 5). Variance's results for each method:
| Raw P | Bonferroni | Šidák | Holm | Holm-Šidák | BH (q) | BY (q) | BKY (q) |
|---|---|---|---|---|---|---|---|
| 0.0008 | 0.0080 | 0.0080 | 0.0080 | 0.0080 | 0.0080 | 0.0234 | 0.0081 |
| 0.0040 | 0.0400 | 0.0393 | 0.0360 | 0.0354 | 0.0200 | 0.0586 | 0.0183 |
| 0.0090 | 0.0900 | 0.0864 | 0.0720 | 0.0698 | 0.0300 | 0.0879 | 0.0246 |
| 0.0150 | 0.1500 | 0.1403 | 0.1050 | 0.1004 | 0.0375 | 0.1098 | 0.0309 |
| 0.0210 | 0.2100 | 0.1912 | 0.1260 | 0.1196 | 0.0420 | 0.1230 | 0.0309 |
| 0.0320 | 0.3200 | 0.2776 | 0.1600 | 0.1501 | 0.0533 | 0.1562 | 0.0388 |
| 0.0430 | 0.4300 | 0.3557 | 0.1720 | 0.1612 | 0.0614 | 0.1799 | 0.0390 |
| 0.1200 | 1 | 0.7215 | 0.3600 | 0.3185 | 0.1500 | 0.4393 | 0.0638 |
| 0.3800 | 1 | 0.9916 | 0.7600 | 0.6156 | 0.4222 | 1 | 0.1450 |
| 0.7400 | 1 | 1.0000 | 0.7600 | 0.7400 | 0.7400 | 1 | 0.1765 |
| ≤ 0.05 | 2 | 2 | 2 | 2 | 5 | 1 | 7 |
Checks by hand: Holm for the 2nd P, max(10 × 0.0008 ; 9 × 0.004) = 0.036; BH for the 5th, min(10 × 0.021/5 ; 10 × 0.032/6 ; 10 × 0.043/7 ; …) = min(0.042 ; 0.0533 ; 0.0614 ; …) = 0.042. BKY: Q' = 0.05/1.05 = 0.047619; in stage 1, the 5th P (0.021 ≤ 5 × 0.0047619 = 0.0238) is the last one below its threshold, so r₁ = 5 and m̂₀ = 5; in stage 2, the thresholds become k × 0.047619/5 = k × 0.0095: the 7th P (0.043 ≤ 0.0667) passes, the 8th (0.12 > 0.0762) does not, hence 7 discoveries.
The same set of P values gives 1 to 7 "positive" results depending on the question asked: FWER (no false conclusion tolerated) or FDR (a controlled proportion of false discoveries accepted).
Where Variance offers these corrections#
| Analysis | Corrections offered |
|---|---|
| One-way ANOVA, Nested One-way ANOVA ("Multiple Comparisons" tab, "Test" list) | Tukey, Šídák, Bonferroni, Holm-Šídák, Dunnett, Fisher's LSD, Newman-Keuls, Games-Howell, Dunnett T3, FDR (BKY, BH, BY) |
| Kruskal-Wallis and Friedman (Dunn's test) | Bonferroni, Šídák, Holm-Šídák, FDR (BKY, BH, BY), none ("Fisher's LSD (no correction)") |
| Two-way ANOVA | Tukey, Šídák, Bonferroni, Holm-Šídák, Fisher's LSD, FDR (BKY, BH); one family per row or one overall ("Family") |
| Row-by-Row t Tests | FDR (BKY, BH, BY), Holm-Šídák, Šídák-Bonferroni, Bonferroni-Dunn, none |
| Survival Curves (Kaplan-Meier), pairwise comparison of curves | Bonferroni, Holm-Šídák, FDR (BKY), none |
| Multiple P Values (FDR) | FDR (BKY, BH, BY), Bonferroni, Šídák, Holm, Holm-Šídák |
Example on the sample table Three groups (one-way ANOVA): the comparison Control vs. Treated A has a raw P of 3.5 × 10⁻⁵; its adjusted P is 1.00 × 10⁻⁴ with Tukey and 1.05 × 10⁻⁴ (= 3 × 3.5 × 10⁻⁵) with Bonferroni, and its 95% CI of the difference widens from −9.65 to −4.16 (Fisher's LSD, no correction) to −10.23 to −3.58 (Tukey) and −10.34 to −3.47 (Bonferroni): simultaneous confidence intervals also take multiplicity into account.
Advice for choosing:
- decide on the family and the method before seeing the results;
- a few planned comparisons: Bonferroni, Šidák or Holm-Šidák;
- all pairs after an ANOVA: Tukey; each group against a control: Dunnett;
- dozens or thousands of exploratory tests (genes, proteins, voxels): FDR (BKY or BH; BY if the dependence between tests is strong and unknown);
- always state the method, the size of the family and the threshold (α or Q).
Assumptions of the tests and how to check them#
Every test relies on a model. If its assumptions are false, the P values and CIs can be wrong, in either direction. Three assumptions come up again and again.
Independence#
It is the most important one and the only one that no test can check: it follows from the experimental design. Values are independent if knowing one tells nothing about the deviation of another from its mean. It is violated by repeated measurements on the same subject, technical replicates of the same sample, animals of the same litter or cage, cells of the same dish, successive measurements over time. The solution is not to ignore them but to model them: paired design, repeated measures, nested data (Nested tables), or one mean per experimental unit.
Normality#
Parametric tests (t, ANOVA, least-squares regressions) assume that the residuals (deviations of each value from the mean of its group, or from the curve) follow a normal distribution. They are fairly robust to moderate deviations, especially with groups of equal size and n of a few dozen (central limit theorem), but not to strong skewness or to extreme values with small n.
Variance offers four normality tests in Analysis › Describe and Explore › Normality Tests; the "Residuals" tab of the parametric t tests and of one-way ANOVA applies the first three to the residuals:
| Test | Statistic | n required | P value |
|---|---|---|---|
| D'Agostino-Pearson omnibus | K² = z₁² + z₂² (skewness and kurtosis transformed into z) | ≥ 8 | χ² with 2 df |
| Anderson-Darling | A²* = A² × (1 + 0.75/n + 2.25/n²), mean and SD estimated | ≥ 8 | formulas of D'Agostino and Stephens (1986) |
| Shapiro-Wilk | W | 3 to 5000 | Royston's algorithm AS R94 (1995) |
| Kolmogorov-Smirnov | D, largest distance between distribution functions | ≥ 5 | Dallal-Wilkinson approximation of the Lilliefors distribution; shown as ">0.1000" above 0.10 |
In each case H0 is "the data come from a normal distribution"; the row "Consistent with normality at α = 0.05" answers "Yes" when P exceeds α. What these tests do not tell you:
- "Passed" does not prove normality: with 5 to 10 values they have almost no power and let very skewed distributions through;
- with hundreds of values they reject tiny deviations, harmless for a t test;
- they do not say whether the deviation is serious enough to distort the planned analysis;
- applied to the raw data of groups with different means, they mix the effect under study and the shape of the distribution: test the residuals, or each group separately.
The QQ plot is often more informative. Variance produces the output table "QQ plot" (sorted observed values in X, values predicted by a normal distribution with the same mean and SD in Y) and, for residuals, "Residuals: QQ plot". The theoretical quantiles use Blom's plotting positions:
zᵢ = Φ⁻¹( (i − 0.375) / (n + 0.25) ) i = 1 … n (rank of the sorted value)
predicted value = m + s × zᵢ ("QQ plot" table)
"Residuals: QQ plot": observed residual in X, zᵢ itself in Y
Points lying on the straight line are consistent with a normal distribution; a regular curvature indicates skewness, an S shape tails that are too heavy or too light, a few isolated points at the ends extreme values.
For lognormal data (concentrations, titers, durations…), check "Lognormal distribution": the tests then apply to ln x (zero or negative values are left out). The option "Compute the relative likelihood of normal vs lognormal" compares the maximum likelihoods of the two models, which both have two parameters:
σ̂² = Σ (xᵢ − m)² / n (and σ̂²_ln, m_ln on the ln xᵢ)
ℓ_normal = −(n/2) × (ln(2π σ̂²) + 1)
ℓ_lognormal = −(n/2) × (ln(2π σ̂²_ln) + 1) − Σ ln xᵢ
Probability of normal = e^ℓ_normal / (e^ℓ_normal + e^ℓ_lognormal)
If the data are lognormal, analyze them on the logarithmic scale: options "Lognormal: test on logarithms (ratio)" of the t test, "Lognormal: ANOVA on logarithms" of the ANOVA, or Analysis › Prepare Data › Transform.
Equal variances#
The classical unpaired t test and ordinary ANOVA assume that the populations have the same SD; with groups of very different sizes, unequal SDs clearly distort the P values. Variance shows:
- in the unpaired t test, "F test of the variances": F = larger variance / smaller variance, with (n − 1) df for each group, two-tailed P = 2 × P(F ≥ F_obs) capped at 1;
- in one-way ANOVA, the Brown-Forsythe test (an ANOVA on the absolute deviations |x − group median|, robust to non-normality) and Bartlett's test:
Bartlett: χ² = [ (N − k) ln s_p² − Σ (nᵢ − 1) ln sᵢ² ] / C df = k − 1
C = 1 + ( Σ 1/(nᵢ − 1) − 1/(N − k) ) / (3(k − 1))
s_p² = Σ (nᵢ − 1) sᵢ² / (N − k)
Bartlett's test is very sensitive to non-normality; Brown-Forsythe is preferable. Rather than choosing the test according to a preliminary test of variances (which changes the error rates), choose from the start a method that does not assume equal SDs when this is doubtful: "Welch's t test (unequal SDs)" for the t test, "Unequal SDs: Brown-Forsythe and Welch ANOVA" for ANOVA, Games-Howell or Dunnett T3 for multiple comparisons.
Parametric and nonparametric tests#
Parametric tests assume a family of distributions (usually normal) and test its parameters (means). Variance's nonparametric tests (Mann-Whitney, Wilcoxon, Kruskal-Wallis, Friedman, Spearman, Dunn) replace the values by their ranks: they do not assume normality, but still assume independent observations (or pairs).
What they test: Mann-Whitney tests the hypothesis that the two distributions are identical; it is mostly sensitive to the tendency of one group to take larger values than the other (P(X > Y) ≠ 1/2). It is a test of medians only if both distributions have the same shape and spread (a pure shift). The same holds for Kruskal-Wallis.
Ranks and ties. Variance gives tied values the average of the ranks they occupy (midranks): 10, 20, 10, 30 get the ranks 1.5; 3; 1.5; 4. Ties reduce the variance of the statistic; the formulas are corrected by the term Σ(t³ − t), summed over the groups of t equal values:
Mann-Whitney (normal approximation)
U_A = R_A − n_A(n_A + 1)/2 (R_A: sum of the ranks of group A)
z = (U_A − n_A n_B / 2) / √( n_A n_B / 12 × ( (N + 1) − Σ(t³ − t) / (N(N − 1)) ) )
Kruskal-Wallis
H = [ 12 / (N(N + 1)) × Σ Rᵢ²/nᵢ − 3(N + 1) ] / [ 1 − Σ(t³ − t) / (N³ − N) ]
P from the χ² distribution with k − 1 df
Exact or approximate P. Mann-Whitney gives an exact P (enumerated distribution of U) when there are no ties and each group has at most 50 values; otherwise it uses the normal approximation above, without continuity correction. The Wilcoxon signed-rank test is exact when the differences taken into account (at most 50) contain neither ties nor zeros. By default, zero differences are removed before the computation; with Pratt's method (option "Wilcoxon: handle zero differences with Pratt's method"), they take part in the ranking and are then left out of the sums, and the P value is then approximate. Kruskal-Wallis and Friedman always use the χ² approximation ("P value method": "Approximate").
Advantages and limits:
- with normal data, Mann-Whitney and Wilcoxon keep about 95% of the efficiency of the t test (asymptotic relative efficiency 3/π); with heavy tails they can be much more powerful;
- with very small samples they cannot reach small P values: with 3 values per group, the smallest exact two-tailed P of Mann-Whitney is 2/20 = 0.10, never significant at 5%;
- they estimate a shift (Hodges-Lehmann) rather than a difference between means, and do not lend themselves to complex designs (several factors, covariates).
Choosing a nonparametric test because a normality test is "significant" with small n is an unreliable rule; rely instead on the nature of the data (ordinal scores, bounded data, expected extreme values) or on a suitable transformation (logarithm for lognormal data).
Paired and unpaired designs#
A design is paired (or repeated measures) when each value of one group is linked to a specific value of the other: the same subject before and after treatment, pairs of twins, an experiment repeated on a given day on a control and a treated sample, samples matched on age and sex. Pairing must be decided by the design, before the measurements, not from the data.
The paired analysis works on the within-pair differences, which removes the variability between subjects:
Var(B − A) = s_A² + s_B² − 2 r s_A s_B
The stronger the correlation r between the pairs, the smaller the SD of the differences and the more powerful the test. Ignoring the pairing loses this power; conversely, pairing independent values wastes degrees of freedom.
Example: sample One factor table "Paired data (before/after)", 10 subjects measured before and after (one row per subject).
| Analysis | t | df | P | Difference (After − Before) and 95% CI |
|---|---|---|---|---|
| Paired t test ("Paired") | −9.748 | 9 | 4.4 × 10⁻⁶ | −7.31 (−9.01 to −5.61) |
| Unpaired t test (wrongly) | −2.799 | 18 | 0.0119 | −7.31 (−12.80 to −1.82) |
The SDs before and after are 5.59 and 6.08, but the correlation between the two measurements of the same subject is r = 0.921: the SD of the differences is only 2.37 (= √(5.587² + 6.080² − 2 × 0.921 × 5.587 × 6.080)). Variance shows it under "Effectiveness of the pairing" ("Correlation coefficient (r)" and its one-tailed P value).
In Variance, paired data are entered in a One factor table, one row per subject (or per pair, per experiment); then choose "Experimental design" › "Paired" (t test), "Paired or repeated measures (one subject per row)" (one-way ANOVA) or the repeated-measures options of two-way ANOVA. A pair with a missing value is left out of the paired t test; repeated-measures ANOVA can use a mixed model when values are missing.
Outliers#
An outlier is a value so far from the others that it seems to come from another population or from a mistake. Before any statistical method, look for a cause: typing or unit error, incident noted in the lab notebook, degraded sample. An extreme but genuine value is part of the data; a skewed (lognormal) distribution naturally produces high values that are not outliers at all.
Variance offers two approaches (Analysis › Prepare Data › Outlier Detection, One factor table; ROUT is also available in nonlinear regression):
Grubbs' test ("Grubbs (one outlier)"; "Iterative Grubbs"). It assumes that the other values follow a normal distribution and tests the value farthest from the mean:
G = max |xᵢ − m| / s
critical G = ((n − 1)/√n) × √( t² / (n − 2 + t²) )
with t = 1 − α/(2n) quantile of the t distribution with n − 2 df (two-sided)
the value is an outlier if G > critical G
The iterative version removes the value detected and starts again until nothing more is found; it is prone to masking (two close outliers inflate s and hide each other). The threshold is "Grubbs alpha" (0.05 by default).
ROUT method (Motulsky and Brown, 2006; "ROUT (default)"). It first fits a robust model, little influenced by extreme values, then decides with a false-discovery-rate type approach:
1. Robust fit; for a column: location by Cauchy M-estimation
(iteratively reweighted least squares, started at the median, weights 1/(1 + (r/c)²),
c = 2.385 × P68 of the |residuals|)
2. RSDR = P68 × N / (N − K) P68: 68.27th percentile of the |residuals|,
K: number of parameters (1 for a column)
3. For the i-th largest |residual|: t = |rᵢ| / RSDR,
P = two-tailed P of the t distribution with N − K df, compared with Q × (N − i + 1) / N
4. All points up to the last rank whose P falls below its threshold are outliers
Q ("ROUT coefficient Q (%)", 1% by default) sets the severity: the larger Q, the more outliers are detected, true or false.
Example: in 10.1; 9.9; 10.0; 10.2; 9.8; 10.1; 9.9; 15.0 (n = 8), m = 10.625 and s = 1.7726; G = (15.0 − 10.625)/1.7726 = 2.468; with α = 0.05, t(1 − 0.05/16; 6) = 4.115 and critical G = (7/√8) × √(4.115²/(6 + 4.115²)) = 2.127: 15.0 is declared an outlier, and ROUT (Q = 1%) detects it too. In the "Wild type" column of the "Two groups" sample, the value 4.432 gives G = 2.344 < 2.412 (critical value for n = 12): not an outlier for Grubbs, nor for ROUT with Q = 1%; ROUT flags it with Q = 10%.
Sample size and power#
The sample size is computed before the experiment. It requires:
- α and whether the test is one- or two-tailed;
- the desired power (often 80% or 90%);
- the smallest effect size that would be of scientific or clinical interest (Δ), set by biological reasoning and not by the data;
- the expected variability (σ, from a pilot study or the literature);
- the design (paired or not, number of groups) and the planned test.
Usual formulas (normal approximation, two-tailed test; z₁₋α/₂ = 1.960 for α = 0.05; z₁₋β = 0.842 for 80% power, 1.282 for 90%):
Two means, independent groups (n per group)
n = 2 (z₁₋α/₂ + z₁₋β)² σ² / Δ²
Paired design (n pairs; σ_d: SD of the differences)
n = (z₁₋α/₂ + z₁₋β)² σ_d² / Δ²
Two proportions p₁ and p₂ (n per group; p̄ = (p₁ + p₂)/2, q = 1 − p)
n = [ z₁₋α/₂ √(2 p̄ q̄) + z₁₋β √(p₁q₁ + p₂q₂) ]² / (p₁ − p₂)²
For small n, the normal approximation slightly underestimates the sample size: the exact computation for the t test (noncentral t distribution) usually adds one or two units per group. Examples, α = 0.05 two-tailed, 80% power:
Δ/σ = 1 : n = 2 × (1.960 + 0.842)² / 1 = 15.7 → 16 per group (approximation);
exact computation: 16 per group give 78.1%, 17 give 80.7%
Δ/σ = 0.5 : n = 62.8 per group (approximation); 64 per group give 80.1%
p₁ = 0.15 versus p₂ = 0.32: n = 96.5 → 97 per group
For a t test, Tools › Calculators… › "Power and sample size (t test, proportions)" does the exact calculation (noncentral t distribution, two-sided test): independent groups or paired data, difference to detect Δ, SD (of the groups, or of the differences for paired data), α, sample size and target power. It displays the effect size Δ/SD, the power with the sample size entered and the sample size needed for the target power (Δ = 1, SD = 1: 17 per group for 80%, as above). The "Two proportions" choice applies the formula for two proportions above (normal approximation without continuity correction): 0.15 against 0.32 needs 97 subjects per group for 80%.
For any other test or design, Variance estimates power by simulation: Analysis › Simulate › Random Groups (for example 2 data sets of 17 values, "Means" 0, 1, Gaussian error with SD 1), analysis of the simulated data (the planned t test), then Analysis › Simulate › Monte Carlo Simulation on the results of the simulation, with the criterion "P value" < 0.05. The row "Proportion meeting the criterion" estimates the power, with its CI ("95% CI of the proportion (Wilson score)"). With 1000 simulations the precision is about ± 2.5 points around 80%. See the chapter "Simulate".
How Variance displays P values, and reporting results#
P value styles#
Each analysis has, in its "Options" tab, a "P value format" list and a "Significant digits" setting (4 by default, from 1 to 15). The styles:
| Style (label in the list) | Display rule | Asterisks |
|---|---|---|
Standard: 4 decimals, * to **** | 4 decimals; "<0.0001" below 0.0001 | up to **** |
Detailed: 6 decimals, * to **** | 6 decimals; "<0.000001" below 0.000001 | up to **** |
APA: no leading zero, * to *** | no leading zero; 3 decimals if 0.001 ≤ P < 0.1, 2 decimals from 0.1 on, "<.001" below 0.001 | up to *** |
NEJM: 2 or 3 decimals, * to *** | as APA, with the leading zero; "<0.001" | up to *** |
Actual display examples:
| Exact P | Standard | Detailed | APA | NEJM |
|---|---|---|---|---|
| 0.1234 | 0.1234 | 0.123400 | .12 | 0.12 |
| 0.0498 | 0.0498 | 0.049800 | .050 | 0.050 |
| 0.0332 | 0.0332 | 0.033200 | .033 | 0.033 |
| 0.0021 | 0.0021 | 0.002100 | .002 | 0.002 |
| 0.0002 | 0.0002 | 0.000200 | <.001 | <0.001 |
| 0.00004 | <0.0001 | 0.000040 | <.001 | <0.001 |
The default style of new analyses is set in Tools › Preferences…, section "Analysis" ("Significant digits", "P value format"); that of an existing results sheet with Format › Decimal Places… ("Decimal Places of Results" window); the "Save these settings as the default for future analyses" check box of the parameters dialog remembers the choices of an analysis. On a graph, Objects › Significance Brackets… draws the comparisons of an analysis with asterisks or P values ("Show:" "Asterisks" or "P values", prefix, "Only when P ≤") in the style of the analysis.
Reporting results#
State:
- the question, the test and its options (paired or not, Welch's correction, one- or two-tailed, multiple comparison method and size of the family), the threshold α;
- the descriptive statistics with n per group: mean ± SD for roughly normal data, median [Q1; Q3] otherwise, always saying what "±" stands for;
- the effect size with its 95% CI;
- the test statistic with its degrees of freedom, and the exact P (P = 0.012; P < 0.001 for very small P values) rather than "P < 0.05" or "ns";
- the software and its version (Help › Citing Variance).
Model sentence: "The level was higher in knock-out mice (6.53 ± 0.58, n = 10) than in wild type mice (5.25 ± 0.35, n = 12; means ± SD); difference 1.28 (95% CI 0.86 to 1.69), two-tailed unpaired t test, t(20) = 6.39, P < 0.001."
Common misconceptions#
- "P > 0.05: no effect." Absence of evidence is not evidence of absence (Altman and Bland, 1995). Look at the CI: if it contains important effects, the study is simply inconclusive.
- P-hacking. Trying several tests, transformations, exclusions of values or subgroups, or adding data until 0.05 is crossed, multiplies false positives without it showing (Simmons et al., 2011). Set the analysis in advance and report everything that was done.
- SD and SEM. The SD describes the scatter of the data, the SEM the precision of the mean (SEM = SD/√n). SEM bars look small and do not show variability; always say what the error bars represent.
- Overlapping error bars. Slightly overlapping 95% CIs do not rule out P < 0.05; non-overlapping SEM bars do not imply P < 0.05 (Cumming et al., 2007). Only the test of the difference answers the question.
- Significance and importance. A tiny P can come with a negligible effect (huge n); judge the size of the effect and its CI.
- Comparing significances. "Significant in group A, not in group B" does not show that A and B differ (Gelman and Stern, 2006): test the difference or the interaction directly.
- Pseudoreplication. Treating repeated measurements on the same experimental unit (wells, sections, cells of the same animal) as independent observations inflates n and produces false positives (Hurlbert, 1984; Lazic, 2010). Analyze one value per unit or use Nested t Test and Nested One-way ANOVA.
- Strict dichotomy. P = 0.049 and P = 0.051 provide practically the same evidence; the 0.05 limit is a convention.
- Observed power. It merely restates the P value (see the previous section).
- Correlation and causation. An association, even a highly significant one, does not demonstrate a causal link (confounding factors, reverse causation).
References#
- Altman DG. Practical Statistics for Medical Research. Chapman & Hall, 1991.
- Altman DG, Bland JM. Absence of evidence is not evidence of absence. BMJ 1995;311:485.
- Benjamini Y, Hochberg Y. Controlling the false discovery rate: a practical and powerful approach to multiple testing. Journal of the Royal Statistical Society, Series B 1995;57:289-300.
- Benjamini Y, Krieger AM, Yekutieli D. Adaptive linear step-up procedures that control the false discovery rate. Biometrika 2006;93:491-507.
- Benjamini Y, Yekutieli D. The control of the false discovery rate in multiple testing under dependency. Annals of Statistics 2001;29:1165-1188.
- Brown LD, Cai TT, DasGupta A. Interval estimation for a binomial proportion. Statistical Science 2001;16:101-133.
- Brown MB, Forsythe AB. Robust tests for the equality of variances. Journal of the American Statistical Association 1974;69:364-367.
- Clopper CJ, Pearson ES. The use of confidence or fiducial limits illustrated in the case of the binomial. Biometrika 1934;26:404-413.
- Cohen J. Statistical Power Analysis for the Behavioral Sciences, 2nd ed. Lawrence Erlbaum, 1988.
- Cumming G, Fidler F, Vaux DL. Error bars in experimental biology. Journal of Cell Biology 2007;177:7-11.
- D'Agostino RB, Belanger A, D'Agostino RB Jr. A suggestion for using powerful and informative tests of normality. The American Statistician 1990;44:316-321.
- D'Agostino RB, Stephens MA (eds). Goodness-of-Fit Techniques. Marcel Dekker, 1986.
- Dallal GE, Wilkinson L. An analytic approximation to the distribution of Lilliefors's test statistic for normality. The American Statistician 1986;40:294-296.
- Gelman A, Stern H. The difference between "significant" and "not significant" is not itself statistically significant. The American Statistician 2006;60:328-331.
- Greenland S, Senn SJ, Rothman KJ, Carlin JB, Poole C, Goodman SN, Altman DG. Statistical tests, P values, confidence intervals, and power: a guide to misinterpretations. European Journal of Epidemiology 2016;31:337-350.
- Grubbs FE. Procedures for detecting outlying observations in samples. Technometrics 1969;11:1-21.
- Hoenig JM, Heisey DM. The abuse of power: the pervasive fallacy of power calculations for data analysis. The American Statistician 2001;55:19-24.
- Holm S. A simple sequentially rejective multiple test procedure. Scandinavian Journal of Statistics 1979;6:65-70.
- Hsu JC. Multiple Comparisons: Theory and Methods. Chapman & Hall, 1996.
- Hurlbert SH. Pseudoreplication and the design of ecological field experiments. Ecological Monographs 1984;54:187-211.
- Hyndman RJ, Fan Y. Sample quantiles in statistical packages. The American Statistician 1996;50:361-365.
- Joanes DN, Gill CA. Comparing measures of sample skewness and kurtosis. Journal of the Royal Statistical Society, Series D (The Statistician) 1998;47:183-189.
- Lazic SE. The problem of pseudoreplication in neuroscientific studies: is it affecting your analysis? BMC Neuroscience 2010;11:5.
- Motulsky HJ. Intuitive Biostatistics, 4th ed. Oxford University Press, 2018.
- Motulsky HJ, Brown RE. Detecting outliers when fitting data with nonlinear regression – a new method based on robust nonlinear regression and the false discovery rate. BMC Bioinformatics 2006;7:123.
- Royston P. Remark AS R94: A remark on algorithm AS 181: the W-test for normality. Applied Statistics 1995;44:547-551.
- Shapiro SS, Wilk MB. An analysis of variance test for normality (complete samples). Biometrika 1965;52:591-611.
- Šidák Z. Rectangular confidence regions for the means of multivariate normal distributions. Journal of the American Statistical Association 1967;62:626-633.
- Simmons JP, Nelson LD, Simonsohn U. False-positive psychology: undisclosed flexibility in data collection and analysis allows presenting anything as significant. Psychological Science 2011;22:1359-1366.
- Sokal RR, Rohlf FJ. Biometry, 4th ed. W. H. Freeman, 2012.
- Wasserstein RL, Lazar NA. The ASA's statement on p-values: context, process, and purpose. The American Statistician 2016;70:129-133.
- Wilson EB. Probable inference, the law of succession, and statistical inference. Journal of the American Statistical Association 1927;22:209-212.
- Zar JH. Biostatistical Analysis, 5th ed. Pearson Prentice Hall, 2010.