Genetic studies correct for population structure using ancestry. The usual tool is principal components of the genotype matrix, which summarize who a person's ancestors were. Much of the bias that makes genetic scores and causal estimates fail across populations may not come from ancestry at all. It may come from where people live: the neighborhoods, diets, housing and health services that differ across space and happen to correlate with ancestry. A person's genotype carries a map of their ancestors. The free-text addresses and birthplaces in their records carry a second map, of their lived environment. These two maps agree for most people and disagree for migrants and admixed individuals. That disagreement is the leverage this proposal uses. If we can turn the text into coordinates reliably, and carry the geocoder's uncertainty along, we can test how much apparent "ancestry bias" is really environmental geography. We can also correct for it without discarding non-European participants.
The proposal treats automated geocoding (converting location descriptions in text into latitude and longitude) as a measurement instrument. It treats population generalizability of polygenic scores and Mendelian randomization as the scientific question. Polygenic scores are weighted sums of many genetic variants. Mendelian randomization (MR) uses genetic variants as natural experiments to estimate the causal effect of an exposure on a disease. The new element is not a better geocoder. It is a quantified account of when text-derived location is good enough to serve as a confounder control in genetic causal inference, and an uncertainty-aware way to use it. We also report cases where it fails because the bias really does come from ancestry.
Core Claim
We claim three things, and each can be falsified.
First, part of the residual stratification seen in European-trained genetic scores is tied to residence rather than ancestry. This includes the finding that random-weight scores explain significant variance in 89% of 141 UK Biobank traits, with that inflation tracking alignment with the first genotype principal component (Highly parameterized polygenic scores tend to overfit to population stratification via random effects). It also includes the MR bias of up to 0.3 reported in multi-ancestry semi-synthetic settings (Addressing Instrument-Outcome Confounding in Mendelian Randomization through Representation Learning). Residence-tied bias of this kind can be removed by adjusting for a smooth function of geocoded residence. Genotype principal components remove it only to the extent that ancestry happens to predict residence.
Second, point geocodes leave residual confounding that grows with the ratio of geocoding error to the spatial correlation length of the confounder. This follows from the confounder's covariance function: the adjustment captures only the part of $U(s)$ that is correlated with $U(\hat s)$. Using the geocoder's full predictive distribution instead of its single best guess recovers most of that gap.
Third, the correction should help exactly where residence and genetic ancestry decouple, and not elsewhere. Where confounding is driven by ancestry-specific linkage patterns or pleiotropy, residence adjustment should do nothing. This prediction is what distinguishes our claim from "adding covariates always helps."
Relation to Prior Work
Two lines of work motivate the gap. The first shows that population structure is continuous and geographic. Novel probabilistic models of spatial genetic ancestry with applications to stratification correction in genome-wide association studies builds Geographic Ancestry Positioning (GAP), which uses a neighborhood-preserving embedding to place genotypes on a two-dimensional map. It reports 31% lower error than PCA on Human Origins and 56% lower on POPRES. Its spatial correction, SCGAP, found 17 loci in the Northern Finland Birth Cohorts, including a height variant that PCA correction missed. GAP infers coordinates from genotypes, so by construction it can only recover the ancestral map. It cannot distinguish a confounder that follows ancestry from one that follows residence. We supply the second, independently measured map.
The second line of work handles ancestry with learned representations. The MR representation-learning method above splits genotypes into an invariant instrument and an environment-specific part. It enforces invariance with a distribution-matching penalty across discrete ancestry groups. Its authors note that it breaks down when structure varies continuously or when groups are not different enough. DisPred (Improving genetic risk prediction across diverse population by disentangling ancestry representations) similarly separates ancestry from disease signal using continental labels, and degrades in admixed individuals. We borrow the independence penalty from the MR method but condition it on continuous, text-derived residence instead of group labels.
The geocoding literature supplies the measurement machinery and also constrains it. Regressing Location on Text for Probabilistic Geocoding (ELECTRO-map) regresses a mixture of five von Mises–Fisher distributions (Gaussian-like densities on the sphere) directly from text. It reports a median error of 44.1 km on Wikipedia versus 154.5 km for the gazetteer system Mordecai. A single-component model failed to converge, which tells us location uncertainty from text is genuinely multimodal and should not be collapsed to a point. Address-level systems show that informal addresses need spatially structured targets and that commercial APIs underperform on them. GeoIndia predicts hierarchical hexagonal cells and reports over 50% lower mean error than Google Maps. Geo-Spatially Informed Models for Geocoding Unstructured Addresses uses multi-resolution classification heads and is robust to corrupted postal codes. Applied health work shows why resolution matters. Leveraging open data to reconstruct the Singapore Housing Index recovered building-level socioeconomic status with an intraclass correlation of 0.999 and argues area averages invite ecological fallacy. The New Hampshire mammography study (Breast cancer stage at diagnosis and geographic access to mammography screening) needed street-network travel times rather than coarse proximity. None of these touch genetics.
SpaCE: The Spatial Confounding Environment supplies the confounding simulator and the estimator family, with spatial-spline adjustment (SPATIAL+) and spatial error models as its strongest methods. It assumes clean coordinates and contains no genetic instruments. We import its Gaussian Markov random field confounders (smooth random surfaces over a spatial graph) and its spatially blocked splits into a genetic setting with noisy, text-derived coordinates.
Research Program
The estimation setup is standard instrumental-variable regression with one added ingredient. Let $Z$ be a person's genotype at the instrument variants, $X$ the exposure, $Y$ the outcome, $A$ their top genotype principal components (the ancestral map), and $s$ their true residence or birthplace. $U(s)$ is an unobserved environmental confounder that varies smoothly over space. We never observe $s$, only a text description $t$ and a geocoder's predictive distribution $q(s \mid t)$. The adjustment replaces the unknown $s$ with the posterior expectation of a spatial basis $\phi$ (spherical splines or multi-resolution hexagonal-cell indicators):
$$\tilde\phi_i = \mathbb{E}_{s \sim q(\cdot \mid t_i)}[\phi(s)],$$
and $\tilde\phi_i$ enters both stages of two-stage least squares alongside $A_i$. This is regression calibration applied to geocoding. Its value here is that the von Mises–Fisher mixture output makes the expectation cheap and keeps multimodal ambiguity. A place name shared by two towns contributes half its weight to each rather than all to the wrong one.
For the representation-learning variant, we keep the reconstruction and independence structure of the MR method. We replace its group-level distribution matching with a kernel independence penalty between the learned instrument $\hat W$ and residence, computed on residuals after regressing out $A$:
$$\mathcal{L} = \mathcal{L}_{\text{recon}} + \lambda_1\,\mathrm{HSIC}\big(\hat W, \hat V\big) + \lambda_2\,\mathrm{HSIC}_{\bar k}\big(\hat W \perp s \mid A\big).$$
Here $\mathrm{HSIC}$ is the Hilbert–Schmidt independence criterion, a kernel measure of statistical dependence. $\hat V$ is the environment-specific component, and $\bar k(t_i,t_j)=\mathbb{E}_{q}[k(s_i,s_j)]$ is the spatial kernel averaged over both people's geocoding posteriors. Conditioning on $A$ matters. Instrument allele frequencies legitimately vary with ancestry, so demanding raw independence from residence would destroy instrument strength. We only ask that the instrument carry no residence information beyond what ancestry explains. We watch for the latent-dimension leakage the original paper warns about by sweeping the dimension of $\hat W$.
The geocoding side is built to run inside a secure biobank environment, since identifiable addresses cannot go to external APIs. We fine-tune an ELECTRO-map-style model for place names and birthplaces, and a hierarchical-cell model for addresses. We calibrate their predictive distributions on held-out text with known coordinates. We then characterize error by text type: place name alone, place plus region, full address.
Baselines
The naive reference is ordinary two-stage least squares, or a polygenic score regression, with no structure adjustment. It anchors how much bias exists; in the multi-ancestry MR semi-synthetic setting, raw two-stage least squares and MR-Egger show bias up to 0.3 (Addressing Instrument-Outcome Confounding in Mendelian Randomization through Representation Learning).
The standard-practice baseline adds the top 10 and top 40 genotype principal components. This is the competitor any genetics reviewer will name first. We report both cutoffs so the comparison is not won by under-adjusting.
The genotype-geography baseline replaces principal components with GAP coordinates and SCGAP-style kernel-smoothed allele frequencies (Novel probabilistic models of spatial genetic ancestry). It is the strongest method that uses geography without any text. Beating it is the core test of whether a second map adds anything. On the NFBC it recovered 17 loci. We run it on identical individuals and splits, with its neighborhood threshold tuned on the same validation budget as our method.
The discrete-environment baseline is the published MR representation-learning method with environments defined by ancestry groups. It reduced bias from up to 0.3 to near zero in the published semi-synthetic GLP1R experiment, and it is the strongest existing method for our MR question. We also give it geographic environments by binning residence into regions at several granularities. It gets the same architecture, latent dimension grid and tuning trials as our continuous variant. Beating it means lower absolute bias at equal or better confidence-interval width when confounding follows residence. It also means no loss when confounding follows discrete ancestry groups, where it should be at its best.
The coarse-geography baseline adjusts for administrative-area fixed effects, meaning postal region or district extracted from the same text. The point-geocode baseline fits the same spatial spline on each person's single most likely location. This is the SPATIAL+-style estimator from SpaCE; no reported result found on Lacuna for SpaCE's numeric error values. The point-geocode baseline doubles as the key ablation: it differs from our method only in using the posterior mode instead of the posterior expectation, isolating the value of propagated uncertainty.
An oracle using true coordinates bounds what any geocoder could achieve. On the geocoding side, the reference numbers are ELECTRO-map's 44.1 km median error against Mordecai's 154.5 km on the Wikipedia corpus. Mordecai reaches 13.4 km when the target region is known in advance.
Why not just…?
Why not just adjust for more genotype principal components? Principal components describe ancestry. They can only absorb a residence-tied confounder through the correlation between ancestry and residence, and that correlation is weakest in the migrants and admixed people the field most needs to include. The random-score result (Highly parameterized polygenic scores tend to overfit to population stratification via random effects) shows that spiked principal-component structure keeps leaking into scores even under standard practice. Our semi-synthetic arm settles the question directly: when the simulated confounder is a function of residence and residence is partly decoupled from ancestry, principal-component adjustment should leave bias that shrinks only as that decoupling vanishes.
Why not just use genotype-inferred geography such as GAP? GAP is a better ancestral map than PCA. However, it is still computed from genotypes, so it cannot tell a person born in one region and living in another from a non-migrant. It is the right tool when isolation by distance generates the confounding, and our flipped simulation, with ancestry-coupled confounding, should show it matching or beating residence adjustment there. We report that outcome as a success of the diagnostic, not a failure of the proposal.
Why not just bin residence into regions and run the existing discrete-environment method, or use area fixed effects? This is the real threat. If confounders vary on scales coarser than the bins, binning may do as well as continuous adjustment, and the extra machinery would not be worth it. The Singapore housing work argues that building-level variation matters for socioeconomic status. That is evidence about the exposure, though, not proof for our estimand. We therefore sweep the confounder's correlation length in simulation and report the length below which binning loses. If that crossover lies below the resolution geocoders can actually achieve, we will say so and recommend binning.
Why not just use the structured coordinates biobanks already hold, or a commercial geocoder? Where clean structured coordinates exist we use them, as the oracle. The point of the study is the many registries and electronic health record cohorts where location survives only as text. Commercial APIs are ruled out there by privacy constraints on identifiable addresses. They also return points without uncertainty and underperform on informal addresses, reportedly by more than 50% in mean error against GeoIndia.
Proposed Experiments
The semi-synthetic arm follows the MR representation-learning design. It uses real genotypes from All of Us around GLP1R and from UK Biobank, with the same ancestry groups. Outcomes are simulated with a known causal effect. Confounding comes from three sources: a Gaussian Markov random field over residence, as in SpaCE; an ancestry-coupled term; and a mixture of the two. We control three knobs: how strongly residence decouples from ancestry, the confounder's spatial correlation length, and the text type used to generate locations. For text, we render each person's location as a place name, a place with its region, or a synthetic address. We draw deliberately from ambiguous gazetteer names, then geocode with our in-environment models. The primary metrics are absolute bias of the causal estimate, confidence-interval coverage and width, and first-stage instrument strength. That last metric checks that conditioning on ancestry preserved relevance. We use spatially blocked splits wherever tuning is involved.
The real-data arm reruns the random-score diagnostic across UK Biobank traits under each adjustment. The outcome is the fraction of traits where random, permuted and sign-flipped scores still explain significant variance, against the reported 89%. We run it separately for people whose birthplace and residence are near versus far apart. We also re-estimate a published European-only MR association with inactivity or BMI as the exposure (Dissecting the causal association between social or physical inactivity and depression; Causal associations between risk factors and common diseases inferred from GWAS summary data). This time we include non-European participants and apply our adjustment, and ask whether the estimates become consistent across ancestry groups.
Three results decide the question. The proposal is supported if residence adjustment removes a meaningful share of random-score signal beyond 40 principal components and GAP, concentrated in the decoupled subgroup. It is also supported if, in the flipped simulation, residence adjustment does nothing while GAP helps, which confirms the method separates the two sources rather than simply adding covariates. The third requirement is that the posterior-averaged adjustment beats point geocodes by a margin that grows with geocoding error relative to confounder correlation length, as the covariance argument predicts. If residence adjustment only helps where binned regions help equally, the contribution reduces to a measurement study of required geocoding resolution. We would publish it as that.
References
- Highly parameterized polygenic scores tend to overfit to population stratification via random effects
- Addressing Instrument-Outcome Confounding in Mendelian Randomization through Representation Learning
- Novel probabilistic models of spatial genetic ancestry with applications to stratification correction in genome-wide association studies
- Improving genetic risk prediction across diverse population by disentangling ancestry representations
- Regressing Location on Text for Probabilistic Geocoding
- GeoIndia: A Seq2Seq Geocoding Approach for Indian Addresses
- Geo-Spatially Informed Models for Geocoding Unstructured Addresses
- Leveraging open data to reconstruct the Singapore Housing Index and other building-level markers of socioeconomic status for health services research
- Breast cancer stage at diagnosis and geographic access to mammography screening (New Hampshire, 1998-2004)
- SpaCE: The Spatial Confounding Environment
- Dissecting the causal association between social or physical inactivity and depression: a bidirectional two-sample Mendelian Randomization study
- Causal associations between risk factors and common diseases inferred from GWAS summary data