Search topics and sections

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 QQ, I2I^2, τ2\tau^2, 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.

Homogeneous versus heterogeneous varianceHomogeneous varianceHeterogeneous varianceMeasurementMeasurementGroup AGroup BGroup CGroup AGroup BGroup C
Dot plots of three groups with equal spread (left) and unequal spread (right). In both panels the group means sit at the same heights, so homogeneity of variance depends on the spread of values around each mean and not on where the means fall.

Both main tests take as their null hypothesis that all kk groups have the same variance, σ12=σ22=⋯=σk2\sigma_1^2 = \sigma_2^2 = \dots = \sigma_k^2. 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 k−1k-1 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

  1. Take a random sample from each population and record the categorical variable.[3]
  2. Arrange the counts in a two-way table, with one row per group and one column per category, or the reverse.
  3. Work out the count expected in each cell if all groups shared the same distribution, using the shares in the combined samples.[3]
  4. Compute the statistic below and compare it with a chi-squared distribution.[3]
χ2=∑(observed−expected)2expected\chi^2 = \sum \frac{(\text{observed} - \text{expected})^2}{\text{expected}}

The sum runs over every cell of the table. The degrees of freedom are (r−1)(c−1)(r-1)(c-1), where rr is the number of rows and cc 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]

Sources of heterogeneity in a meta-analysisClinicaldiversityparticipantstreatmentsoutcomesMethodologicaldiversitydesignmeasurementrisk of biasStatisticalheterogeneityeffects differ morethan chance predicts
Clinical diversity and methodological diversity among studies both lead to statistical heterogeneity, where study effects differ more than chance alone predicts.

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]

Forest plots of homogeneous and heterogeneous studiesHomogeneousHeterogeneousStudy 1Study 2Study 3Study 4Study 5PooledStudy 1Study 2Study 3Study 4Study 5PooledNo effectEffectNo effectEffect
Two forest plots, each showing five studies with confidence intervals and a pooled estimate. On the left the intervals overlap widely, which suggests homogeneity. On the right some intervals do not overlap at all, which signals heterogeneity.

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 QQ Is there evidence of variation beyond chance? Test statistic with a P value
I2I^2 What share of the observed variation is due to real differences rather than chance? Percentage, 0% to 100%
τ2\tau^2 (and τ\tau) How much do the true effects vary? Same units as the effect (squared for τ2\tau^2)
Prediction interval Where might the true effect in a new, similar study fall? Same units as the effect

Cochran's Q

Cochran's QQ adds up each study's squared distance from the pooled estimate, weighting each study as in the meta-analysis.[6]

Q=∑i=1kwi (yi−μ^)2,wi=1vi,μ^=∑wiyi∑wiQ = \sum_{i=1}^{k} w_i\,(y_i - \hat{\mu})^2, \qquad w_i = \frac{1}{v_i}, \qquad \hat{\mu} = \frac{\sum w_i y_i}{\sum w_i}

Here kk is the number of studies, yiy_i is the estimate from study ii, viv_i is its within-study variance, and μ^\hat{\mu} is the weighted average of the estimates.[5][7]

The P value comes from comparing QQ with a chi-squared distribution with k−1k-1 degrees of freedom.[6] A large QQ 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

I2I^2 describes the percentage of the variation across studies that is due to heterogeneity rather than chance.[6] It is computed from QQ and its degrees of freedom.[6]

I2=100%×Q−(k−1)QI^2 = 100\% \times \frac{Q - (k-1)}{Q}

When QQ is smaller than k−1k-1, the formula gives a negative number, which is set to 0%, so I2I^2 lies between 0% and 100%.[6] A value of 0% means no observed heterogeneity.[6] For example, a meta-analysis of 11 studies with Q=20Q = 20 has 10 degrees of freedom, so I2=100%×(20−10)/20=50%I^2 = 100\% \times (20 - 10)/20 = 50\%.

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]

I2I^2 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 I2I^2 is very uncertain when there are few studies.[4]

Between-study variance, τ²

The between-study variance τ2\tau^2 measures how much the true effects vary from study to study. Its square root, τ\tau, is the estimated standard deviation of the true effects.[4]

Unlike I2I^2, τ2\tau^2 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 τ2\tau^2, from DerSimonian and Laird, sets the observed QQ equal to its expected value and solves for τ2\tau^2.[7]

τ^DL2=max⁡(0, Q−(k−1)∑wi−∑wi2∑wi)\hat{\tau}^2_{\text{DL}} = \max\left(0,\ \frac{Q - (k-1)}{\sum w_i - \dfrac{\sum w_i^2}{\sum w_i}}\right)

The weights wi=1/viw_i = 1/v_i are the same as in QQ.[7] Many software routines use this estimator by default.[7]

Simulation studies suggest that two other methods for estimating τ2\tau^2 perform better.[7]

  • The Paule and Mandel estimator, an iterative method that adjusts τ2\tau^2 until a weighted version of QQ 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 τ²

I2I^2 can also be written as the between-study variance divided by the total variance.[5]

I2=τ2τ2+σ2I^2 = \frac{\tau^2}{\tau^2 + \sigma^2}

Here σ2\sigma^2 is a "typical" within-study variance, which reflects how precise the individual studies are.[5] The formula shows that I2I^2 grows as studies become larger and more precise, even when the true effects, and so τ2\tau^2, stay the same.[5]

I squared depends on study precision Same spread of effects (same τ²) Small studies Large studies Effect Effect Low I² High I²
Two meta-analyses drawn with the same true spread of effects (τ2\tau^2) and the same point estimates. Small, imprecise studies have wide, overlapping confidence intervals and a low I2I^2. Large, precise studies have narrow intervals that do not overlap and a high I2I^2.

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]

μ^±tk−2 τ^2+SE(μ^)2\hat{\mu} \pm t_{k-2}\,\sqrt{\hat{\tau}^2 + \mathrm{SE}(\hat{\mu})^2}

Here μ^\hat{\mu} is the random-effects pooled estimate, SE(μ^)\mathrm{SE}(\hat{\mu}) is its standard error, and tk−2t_{k-2} is the matching percentile of the t-distribution with k−2k-2 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]

Confidence interval and prediction interval in a forest plot Study 1 Study 2 Study 3 Study 4 No effect Effect Pooled estimate (95% confidence interval) 95% prediction interval
In this forest plot, the pooled estimate's 95% confidence interval (diamond) lies entirely to one side of no effect. The 95% prediction interval (bar) has the same center but is wider because it adds the spread of true effects τ2\tau^2, so it crosses the no-effect line.

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, τ\tau, is the heterogeneity.[4]
Fixed-effect and random-effects models Fixed-effect model One true effect θ y₁ y₂ y₃ y₄ Sampling error Effect Random-effects model Average effect μ τ (spread of true effects) θ₁ y₁ y₂ θ₂ y₃ θ₃ θ₄ y₄ Sampling error Effect
In a fixed-effect model, every study estimate yiy_i differs from one true effect θ\theta only by sampling error. In a random-effects model, each study has its own true effect θi\theta_i, drawn from a normal distribution with mean μ\mu and spread τ\tau, and its estimate yiy_i also carries sampling error.

When I2I^2 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 I2I^2 thresholds to choose the model.[5]

Practical options

The Cochrane handbook lists several responses to heterogeneity.[4]

  1. Check the data again, since severe heterogeneity can come from extraction or entry errors.
  2. Do not pool the results, especially when effects point in different directions.
  3. Explore the causes with subgroup analysis or meta-regression, ideally planned before seeing the results.
  4. Use a random-effects model for heterogeneity that cannot be explained.
  5. Reconsider the effect measure, since the choice of scale can create or remove apparent heterogeneity.
  6. 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²

I2I^2 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 τ\tau, ideally through a prediction interval.[5]

Because I2I^2 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 I2I^2
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 I2I^2 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, I2I^2 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 I2=0%I^2 = 0\%, 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 QQ test does not.[4][6]

Choice of estimator

Different estimators of τ2\tau^2 and of the typical within-study variance give different values of I2I^2 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 tk−2t_{k-2} approximation can cover the true value less often than stated when studies are few.[9]

History

  • 1954: William G. Cochran proposed the QQ statistic in "The combination of estimates from different experiments" in Biometrics.[5]
  • 1986: Rebecca DerSimonian and Nan Laird introduced a moment-based estimator of τ2\tau^2 for random-effects meta-analysis.[5][7]
  • 2002: Julian Higgins and Simon Thompson introduced I2I^2, as an alternative to the QQ test, whose interpretation depends on the number of studies, and τ2\tau^2, whose interpretation depends on the measurement scale.[5]
  • 2003: A BMJ paper by Higgins, Thompson, Deeks, and Altman promoted I2I^2, which Cochrane reviews had started to report.[6][5]
  • 2008: The Cochrane handbook adopted overlapping ranges for interpreting I2I^2 to curb strict use of thresholds.[5]
  • 2009: Higgins, Thompson, and Spiegelhalter proposed prediction intervals for random-effects meta-analysis.[5][9]

References

  1. Bartlett's Test, NIST/SEMATECH e-Handbook of Statistical Methods, NIST, 2012.
  2. Levene Test for Equality of Variances, NIST/SEMATECH e-Handbook of Statistical Methods, NIST, 2012.
  3. Test of Homogeneity, Concepts in Statistics, Lumen Learning, 2023.
  4. Chapter 10: Analysing data and undertaking meta-analyses, Cochrane Handbook for Systematic Reviews of Interventions, Cochrane, 2024.
  5. Reflections on the I-squared index for measuring inconsistency in meta-analysis, Higgins and López-López, Research Synthesis Methods, 2025.
  6. Measuring inconsistency in meta-analyses, Higgins, Thompson, Deeks and Altman, BMJ, 2003.
  7. Methods to estimate the between-study variance and its uncertainty in meta-analysis, Veroniki et al., Research Synthesis Methods, 2016.
  8. Interpretation of random effects meta-analyses, Riley, Higgins and Deeks, BMJ, 2011.
  9. Prediction intervals for random-effects meta-analysis: a confidence distribution approach, Nagashima, Noma and Furukawa, arXiv, 2018.

Figure