Homogeneity and heterogeneity (statistics)
In statistics, homogeneity means that some property, such as an average, a spread, or a treatment effect, is the same across groups, samples, or studies. Heterogeneity means that the property differs.
Every sample varies a little by chance. So the practical question is whether observed differences are bigger than chance alone would produce.
The idea comes up throughout statistics:
- Several common tests assume equal spread across groups.
- The chi-squared test of homogeneity checks whether groups share the same mix of categories.
- In meta-analysis, which pools the results of many studies, heterogeneity affects whether a single combined answer makes sense and how it should be calculated.
The basic idea
A property is homogeneous across groups when any differences between them can be explained by sampling error. Sampling error is the random variation that comes from studying a sample instead of a whole population.
A property is heterogeneous when the groups truly differ, beyond what sampling error explains.
Statistical tests of homogeneity take "no real difference" as their null hypothesis. They ask whether the data are consistent with it.
The word applies to many different properties. The table lists three settings, each covered in a section below. A categorical variable is one whose values are categories, such as answers or group names.
| What is compared | Groups being compared | Typical tools |
|---|---|---|
| Spread (variance) of a measurement | Samples or treatment groups | Bartlett's test, Levene's test |
| Mix of answers on a categorical variable | Two or more populations | Chi-squared test of homogeneity |
| Treatment effect | Studies in a meta-analysis | Cochran's , , , prediction intervals |
Homogeneity of variance
Equal variances across samples are called homogeneity of variance.[1] Some tests, such as analysis of variance (ANOVA), assume this property, so analysts often check it first.[1] The same idea in regression is covered under homoscedasticity and heteroscedasticity.
Both main tests take as their null hypothesis that all groups have the same variance, . The alternative is that at least one pair differs.[1][2]
- Bartlett's test compares each group's variance with the pooled variance (the combined variance of all groups). It checks the result against a chi-squared distribution, the reference pattern used to judge whether a chi-squared result is unusually large, with degrees of freedom.[1] It is sensitive to data that do not follow the bell-shaped normal distribution, so it may end up testing for non-normality instead.[1]
- Levene's test runs an ANOVA-like comparison on each value's absolute distance from its group center. It is less sensitive to non-normal data than Bartlett's test.[2]
- The Brown and Forsythe version of Levene's test measures distances from the group median instead of the mean. The NIST handbook recommends it because it holds up well across many kinds of non-normal data while keeping good power, meaning a good chance of detecting a real difference.[2]
If the data are known to be normal or nearly normal, Bartlett's test performs better.[2]
Chi-squared test of homogeneity
The chi-squared test of homogeneity checks whether two or more populations have the same distribution of a single categorical variable.[3] For example, it can test whether the share of athletes who use steroids is the same in three sports divisions.[3] The name comes from the null hypothesis, which states that the distributions are the same (homogeneous) across groups.[3]
How the test works
- Take a random sample from each population and record the categorical variable.[3]
- Arrange the counts in a two-way table, with one row per group and one column per category, or the reverse.
- Work out the count expected in each cell if all groups shared the same distribution, using the shares in the combined samples.[3]
- Compute the statistic below and compare it with a chi-squared distribution.[3]
The sum runs over every cell of the table. The degrees of freedom are , where is the number of rows and the number of columns.[3] The chi-squared approximation is a good fit when the samples are random and every expected count is 5 or more.[3]
Homogeneity versus independence
The calculations are the same as in the chi-squared test of independence, but the study design differs.[3]
| Test | Samples taken | Variables recorded | Null hypothesis |
|---|---|---|---|
| Independence | One random sample from one population | Two | The two variables are independent |
| Homogeneity | A separate random sample from each group | One | The variable has the same distribution in every group |
The table follows the course notes by Lumen Learning.[3]
Heterogeneity in meta-analysis
Studies brought together in a systematic review will always differ in some ways, and any such variation can be called heterogeneity.[4] The Cochrane handbook splits it into three kinds.[4]
- Clinical diversity: differences in the participants, treatments, and outcomes studied.
- Methodological diversity: differences in study design, measurement tools, and risk of bias (the chance that a study's methods push its results in one direction).
- Statistical heterogeneity: differences in the treatment effects themselves, so that results differ more than chance alone would predict. It is a result of clinical or methodological diversity, or both.
Usually, "heterogeneity" on its own means statistical heterogeneity.[4]
Heterogeneity that comes only from methodological diversity suggests that studies suffer from different amounts of bias. It does not show that the true effect varies.[4]
Seeing it on a forest plot
A forest plot draws each study's estimate as a point with a horizontal line for its confidence interval. When the intervals overlap poorly, statistical heterogeneity is generally present.[4] When they overlap well, the results are consistent with one another.[5]
Measuring heterogeneity in meta-analysis
Four quantities are widely reported. They answer different questions, so they are best read together.[5]
In the table below, a test statistic is a number calculated from the data to weigh the evidence in a test. A P value is the probability of getting results at least this extreme if the null hypothesis were true.
| Quantity | Question it answers | Scale |
|---|---|---|
| Cochran's | Is there evidence of variation beyond chance? | Test statistic with a P value |
| What share of the observed variation is due to real differences rather than chance? | Percentage, 0% to 100% | |
| (and ) | How much do the true effects vary? | Same units as the effect (squared for ) |
| Prediction interval | Where might the true effect in a new, similar study fall? | Same units as the effect |
Cochran's Q
Cochran's adds up each study's squared distance from the pooled estimate, weighting each study as in the meta-analysis.[6]
Here is the number of studies, is the estimate from study , is its within-study variance, and is the weighted average of the estimates.[5][7]
The P value comes from comparing with a chi-squared distribution with degrees of freedom.[6] A large relative to its degrees of freedom is evidence of heterogeneity.[4]
The test's usefulness depends on how many studies there are.[4] Power here means the chance of detecting heterogeneity that is really there.
| Situation | Problem with the test | What the result does not show |
|---|---|---|
| Few or small studies (common) | Low power | A non-significant result is not evidence of no heterogeneity. Some analysts use a P value cut-off of 0.10 instead of 0.05 for this reason. |
| Many studies | High power to detect small amounts of heterogeneity | A significant result may reflect heterogeneity that does not matter clinically. |
The table follows the Cochrane handbook.[4]
A meta-analysis of eight trials of amantadine for preventing influenza shows the low-power problem. The odds of an event are its probability of happening divided by its probability of not happening.
Across the eight trials, the reduction in odds of influenza ranged from 16% to 93%, and some confidence intervals did not overlap. Yet the test gave P = 0.09.[6]
The I² statistic
describes the percentage of the variation across studies that is due to heterogeneity rather than chance.[6] It is computed from and its degrees of freedom.[6]
When is smaller than , the formula gives a negative number, which is set to 0%, so lies between 0% and 100%.[6] A value of 0% means no observed heterogeneity.[6] For example, a meta-analysis of 11 studies with has 10 degrees of freedom, so .
The Cochrane handbook gives a rough guide for meta-analyses of randomized trials (trials that assign participants to groups by chance), with deliberately overlapping ranges.[4]
| Rough reading | |
|---|---|
| 0% to 40% | Might not be important |
| 30% to 60% | May represent moderate heterogeneity |
| 50% to 90% | May represent substantial heterogeneity |
| 75% to 100% | Considerable heterogeneity |
The handbook stresses that the importance of a given value depends on the size and direction of the effects and on the strength of evidence for heterogeneity.[4] It warns that thresholds can mislead, and notes that is very uncertain when there are few studies.[4]
Between-study variance, τ²
The between-study variance measures how much the true effects vary from study to study. Its square root, , is the estimated standard deviation of the true effects.[4]
Unlike , is expressed on the scale of the effect, such as a mean difference or a log odds ratio.[5] A log odds ratio is the logarithm of the odds ratio, the odds of an event in one group divided by the odds in another.
An Estimator is a method that uses data to estimate an unknown quantity. The classic estimator of , from DerSimonian and Laird, sets the observed equal to its expected value and solves for .[7]
The weights are the same as in .[7] Many software routines use this estimator by default.[7]
Simulation studies suggest that two other methods for estimating perform better.[7]
- The Paule and Mandel estimator, an iterative method that adjusts until a weighted version of equals its expected value.
- Restricted maximum likelihood (REML), for continuous data (numerical measurements that can take a range of values, not category labels).
How I² relates to τ²
can also be written as the between-study variance divided by the total variance.[5]
Here is a "typical" within-study variance, which reflects how precise the individual studies are.[5] The formula shows that grows as studies become larger and more precise, even when the true effects, and so , stay the same.[5]
Prediction intervals
A prediction interval gives a range for the true effect in a new study similar to those already analyzed.[5] It is centered on the pooled estimate and is wider than the confidence interval, because it adds the spread of true effects to the uncertainty in the average.[8] A common version, due to Higgins, Thompson, and Spiegelhalter, is:[9]
Here is the random-effects pooled estimate, is its standard error, and is the matching percentile of the t-distribution with degrees of freedom (the 97.5th percentile for a 95% interval).[9] The interval can be calculated with at least three studies, though it may be very wide with so few.[8]
The Cochrane handbook encourages prediction intervals when there are a reasonable number of studies (for example, five or more) and no clear funnel plot asymmetry, which is a sign that small studies with certain results may be missing or differ systematically.[4] Prediction intervals rely heavily on the assumption that true effects are normally distributed and can be too wide or too narrow when studies are few.[4]
Dealing with heterogeneity
Fixed-effect and random-effects models
The choice of model reflects an assumption about whether the true effect is the same in every study.
- A fixed-effect meta-analysis usually assumes one true effect shared by all studies, so all differences between results are due to chance.[4] It ignores heterogeneity, and if heterogeneity is present its confidence interval is too narrow.[4]
- A random-effects meta-analysis assumes the studies estimate different but related effects that follow a distribution, usually a normal distribution.[4] The center of that distribution is the average effect and its width, , is the heterogeneity.[4]
When is above zero, the random-effects confidence interval is wider than the fixed-effect one.[4]
When heterogeneity is present, the random-effects model also gives relatively more weight to small studies. This can pull the result toward their findings if there is also funnel plot asymmetry.[4]
Cochrane advises that the choice between the two models should never be based on a statistical test for heterogeneity.[4] Higgins and López-López also discourage using thresholds to choose the model.[5]
Practical options
The Cochrane handbook lists several responses to heterogeneity.[4]
- Check the data again, since severe heterogeneity can come from extraction or entry errors.
- Do not pool the results, especially when effects point in different directions.
- Explore the causes with subgroup analysis or meta-regression, ideally planned before seeing the results.
- Use a random-effects model for heterogeneity that cannot be explained.
- Reconsider the effect measure, since the choice of scale can create or remove apparent heterogeneity.
- Run analyses with and without outlying studies as a sensitivity check, instead of simply dropping them.
A random-effects model is not a substitute for investigating heterogeneity.[4] Explanations found only after seeing the data should be treated as hypotheses.[4]
Limits and debates
Misreading I²
is often misread as the absolute amount of heterogeneity, which it is not.[5] It is a relative measure of inconsistency between results, and it says nothing about how much the effects vary on the scale of the outcome.[5] To describe the actual spread of effects, Higgins and López-López recommend reporting , ideally through a prediction interval.[5]
Because rises with precision, very large studies can produce very high values for small real differences.[5] Typical values differ a lot by type of meta-analysis.[5]
| Type of meta-analysis | Effect measure | Median |
|---|---|---|
| 134 meta-analyses of Prevalence studies (how common a condition is) | Prevalence | 96.9% |
| Cochrane meta-analyses of trials with binary outcomes (two possible values, such as yes or no) | Log odds ratio | 22% |
| Cochrane meta-analyses of trials with continuous outcomes | Standardized mean difference | 40% |
A standardized mean difference is the difference between two group averages, expressed in standard-deviation units. The figures in the table come from Higgins and López-López.[5]
Thresholds and small samples
The 2003 paper that popularized suggested 25%, 50%, and 75% as rough labels for low, moderate, and high.[6] It warned that such a simple grouping would not suit all circumstances.[6]
These labels were meant for randomized trials but have been widely applied far beyond them.[5]
With few studies, can swing widely, and it may be biased when the number of studies is very small.[5]
In an analysis of 509 Cochrane meta-analyses, almost half (250) had , and about a quarter had values over 50%.[6] A value of 0% in a small meta-analysis does not prove the studies are homogeneous, for the same reason that a non-significant test does not.[4][6]
Choice of estimator
Different estimators of and of the typical within-study variance give different values of for the same data.[5] For 13 trials of BCG vaccine against tuberculosis, the values ranged from 47.4% to 94.2%, with the standard method giving 92.1%.[5]
Prediction intervals based on the approximation can cover the true value less often than stated when studies are few.[9]
History
- 1954: William G. Cochran proposed the statistic in "The combination of estimates from different experiments" in Biometrics.[5]
- 1986: Rebecca DerSimonian and Nan Laird introduced a moment-based estimator of for random-effects meta-analysis.[5][7]
- 2002: Julian Higgins and Simon Thompson introduced , as an alternative to the test, whose interpretation depends on the number of studies, and , whose interpretation depends on the measurement scale.[5]
- 2003: A BMJ paper by Higgins, Thompson, Deeks, and Altman promoted , which Cochrane reviews had started to report.[6][5]
- 2008: The Cochrane handbook adopted overlapping ranges for interpreting to curb strict use of thresholds.[5]
- 2009: Higgins, Thompson, and Spiegelhalter proposed prediction intervals for random-effects meta-analysis.[5][9]
References
- Bartlett's Test, NIST/SEMATECH e-Handbook of Statistical Methods, NIST, 2012.
- Levene Test for Equality of Variances, NIST/SEMATECH e-Handbook of Statistical Methods, NIST, 2012.
- Test of Homogeneity, Concepts in Statistics, Lumen Learning, 2023.
- Chapter 10: Analysing data and undertaking meta-analyses, Cochrane Handbook for Systematic Reviews of Interventions, Cochrane, 2024.
- Reflections on the I-squared index for measuring inconsistency in meta-analysis, Higgins and López-López, Research Synthesis Methods, 2025.
- Measuring inconsistency in meta-analyses, Higgins, Thompson, Deeks and Altman, BMJ, 2003.
- Methods to estimate the between-study variance and its uncertainty in meta-analysis, Veroniki et al., Research Synthesis Methods, 2016.
- Interpretation of random effects meta-analyses, Riley, Higgins and Deeks, BMJ, 2011.
- Prediction intervals for random-effects meta-analysis: a confidence distribution approach, Nagashima, Noma and Furukawa, arXiv, 2018.
