- Introduced by
- Jinfeng Wang
- Year
- 2010
- Type
- Geographical detection and stratification method
- Family
- Spatial Analysis
What does it do?
Spatial Stratified Heterogeneity, usually called Geodetector, is a framework introduced by Jinfeng Wang and colleagues in 2010 for detecting spatial stratified heterogeneity in an outcome and testing which candidate factors explain it.
Its central statistic, q, measures how much of the spatial variation in an outcome is accounted for by stratifying the study area by a given variable. It has been applied in environmental health and ecology, among other fields, where candidate factors are categorical or spatially structured.
The intuition behind the method
The idea is that if a variable genuinely explains an outcome's spatial pattern, then grouping observations by that variable's strata should leave little variance within each group compared with the variance across the whole study area. Geodetector turns this into the q statistic, which compares the within-stratum variances with the overall variance. Because it compares strata rather than fitting a single global regression line, it does not require one linear relationship to hold across the entire study area. Categorical variables can serve as strata directly, while continuous variables must first be grouped into classes.
History
Jinfeng Wang and colleagues introduced the geographical detector approach in their 2010 paper on health risk assessment for neural tube defects in the Heshun region of China. The approach comprises four detectors. The risk detector identifies where the risk areas are. The factor detector identifies which factors are responsible for the risk. The ecological detector compares the relative importance of the factors. The interaction detector reveals whether risk factors interact or act independently on the disease. A later paper by Wang, Zhang and Fu (2016), 'A measure of spatial stratified heterogeneity', is devoted to a measure of spatial stratified heterogeneity.
When to use it
Choose Geodetector when the question is which of several candidate factors best accounts for the spatial pattern of an outcome, and the factors can be expressed as strata: categorical classes such as land-use types, geological units or administrative areas, or continuous variables grouped in advance. It suits environmental health, ecological and geographical studies where the link between a factor and the outcome may differ across space and a single global regression is doubtful. Do not use it when the strata cannot be justified before looking at the data, or when the goal is to estimate the size of an effect or to adjust for confounders, since regression-based methods are better suited to those tasks. Geodetector is not designed to model spatial dependence directly, so it is a poor fit when the spatial dependence of the outcome is itself the object of study.
Limitations and considerations
- Results depend on how the strata are drawn; a different partition of the same variable can give a different q.
- q indicates how much variation a stratification explains, not the size or direction of an effect, so it cannot replace a regression coefficient.
- Spatial dependence in the outcome can make significance results harder to interpret, so significance should be read with caution.
- Large samples can make small differences between strata statistically significant, so significance should be read alongside the magnitude of q.
- Continuous variables must be grouped before analysis, and the binning choice can change the conclusions.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Gives a single measure, q, of how much of the outcome's spatial variation a stratification accounts for, without fitting a global regression line.
- Works with strata rather than one fitted coefficient, so it does not require a single slope to describe the outcome across the whole study area.
- Categorical variables can be used directly as strata, and continuous variables can be used after grouping, so one framework covers both kinds of factor.
- Comparing q across candidate factors gives a ranking of how strongly each stratification explains the outcome.
- The interaction detector reveals whether two risk factors interact or act independently on the outcome.
Applications
- Environmental epidemiology: examining whether physical environment variables such as watershed, lithozone or soil account for the spatial pattern of an outcome, as in the 2010 neural tube defects study.
- Ecology: testing which environmental classes, such as elevation or vegetation zone, best explain spatial variation in an ecological outcome.
- Urban and social geography: comparing how neighbourhood-level categories explain variation in a health or social outcome.
- Land-use and climate studies: comparing how land-use classes or climate zones explain variation in an ecosystem indicator.
How it works
How it works
Divide the study area into strata using one or more stratification variables, such as administrative units, ecological zones, or classes of a factor. A continuous variable is first grouped into classes, and the choice of class boundaries affects the result. The strata should be fixed on substantive grounds before the outcome is examined.
Assign each observation to its stratum, then compute the variance of the outcome within each stratum and the overall variance across the study area.
Compute the q-statistic as q = 1 - (sum over h of N_h * sigma_h^2) / (N * sigma^2), where N_h and sigma_h^2 are the sample size and outcome variance in stratum h, N is the total sample size, and sigma^2 is the overall variance. The more of the total variance that lies between strata rather than within them, the closer q is to 1, which is the sense in which a higher q indicates stronger stratification power.
Compare the observed q with what would be expected if the stratification had no effect on the outcome. This comparison is the null hypothesis being tested. Check the test procedure in the original Geodetector papers before reporting significance.
Common pitfalls
- Defining strata after looking at the outcome, which inflates the chance of finding a spurious stratification effect.
- Reading a high q as causal evidence; q shows that a stratification accounts for variation, not that the factor causes the outcome.
- Using strata that are too fine, leaving few observations per stratum, or too coarse, masking real differences, either of which changes q.
- Relying on one binning or partition of a continuous variable; check that conclusions hold under other reasonable choices.
- Interpreting an interaction result without a plausible mechanism, because the interaction comparison uses q values estimated from the same data and can differ by chance.
Frequently asked questions
How do I choose strata for my variables?
Strata should be defined a priori based on subject-matter knowledge (e.g., ecological zones, administrative boundaries, or theoretically meaningful thresholds). Avoid post-hoc data-driven stratification, which inflates Type I error. Sensitivity analysis across plausible stratum definitions is recommended.
What does a high q-statistic mean?
High q (close to 1) indicates the stratification variable explains most of the spatial heterogeneity in the outcome. It does not prove causation, only that the variable is strongly associated with spatial variation. Interpret within the context of ecological or epidemiological mechanisms.
Can I use Geodetector with continuous variables?
Yes. Continuous variables must be stratified into categories (bins) before computing q. The choice of binning scheme affects results; conduct sensitivity analyses across reasonable thresholds to ensure robustness.
How do I test for interactions between two stratification variables?
Compute q for each variable alone and for their joint stratification. Compare the joint q with the two single q values and with their sum to classify the interaction. The interaction detector shows whether the factors act together or independently; for the full set of interaction categories, consult the original interaction detector description in the Geodetector papers before reporting.
Is Geodetector better than spatial regression?
Neither is universally better. Geodetector does not assume a linear relationship or global coefficients, so it can be used when a single regression slope is doubtful. Spatial regression provides effect estimates and inference under parametric assumptions. Use both to complement each other: Geodetector to identify important stratification factors, spatial regression to quantify effects.
Related methods
Sources
Wang, J. F., Li, X. H., Christakos, G., Liao, Y. L., Zhang, T., & Gu, X. (2010). Geographical detectors–based health risk assessment and its application in the neural tube defects study for the C–H plane. International Journal of Geographical Information Science, 24(1), 107–127.
Open DOI referenceWang, J. F., Zhang, T. L., & Fu, B. J. (2016). A measure of spatial stratified heterogeneity. Ecological Indicators, 67, 250–256.
Open DOI referenceSong, Y., Wu, P., Gilmore, D., Zhang, Q., Feng, Z., Wang, J., & Lou, L. (2020). Spatial autoregressive modelling of functional traits: a study case on gap-phase regeneration in a Chinese subtropical forest. Journal of Spatial Science, 65(2), 209–221.
Open publication reference