Gene–environment correlations across geographic regions affect genome-wide association studies

Gene–environment correlations affect associations between genetic variants and complex traits in genome-wide association studies (GWASs). Here we showed in up to 43,516 British siblings that educational attainment polygenic scores capture gene–environment correlations, and that migration extends these gene–environment correlations beyond the family to broader geographic regions. We then ran GWASs on 56 complex traits in up to 254,387 British individuals. Controlling for geographic regions significantly decreased the heritability for socioeconomic status (SES)-related traits, most strongly for educational attainment and income. For most traits, controlling for regions significantly reduced genetic correlations with educational attainment and income, most significantly for body mass index/body fat, sedentary behavior and substance use, consistent with gene–environment correlations related to regional socio-economic differences. The effects of controlling for birthplace and current address suggest both passive and active sources of gene–environment correlations. Our results show that the geographic clustering of DNA and SES introduces gene–environment correlations that affect GWAS results.

G enome-wide association studies (GWASs) are an important tool for the investigation of the epidemiology and biology of mental and physical health outcomes. GWASs are viewed as essential herein, because for most outcomes in life, individual differences are a consequence of a multitude of genetic and environmental influences 1 . The aim of a GWAS is to estimate associations between genetic variants and complex traits 2 . The nature of the associations is generally difficult to determine, especially for highly polygenic traits 3 . Genetic effects are expressed through many cascades of biological processes that influence and react to environmental exposures, which can give rise to gene-environment correlations. Three potential sources of gene-environment correlations are as follows: (1) population stratification, (2) family-level geneenvironment correlations and (3) gene-environment correlations across geographic regions.
Population stratification affects GWASs when trait differences co-vary with systematic allele frequency differences between ancestries 4,5 . Genome-wide allele frequency differences between populations due to genetic drift and/or natural selection are detectable even within reasonably homogenous populations [6][7][8] . These older ancestry differences generally show strong correlations with geography [6][7][8][9] and could therefore align with regional differences in environmental influences. Population stratification could then lead to biases in GWASs that are not only due to systematic genetic differences but also due to correlated environmental differences between (sub)populations. Bias due to population stratification in GWASs is commonly controlled for with principal components (PCs) that reflect the strongest axes of (ancestral) genetic variation 10 .
Differences between families in (socio-economic) environmental factors can also induce gene-environment correlations. Outcomes can, for example, be influenced by the parental genotype through parental (rearing) behavior and inherited socio-economic environments 11 . These indirect genetic effects have been detected for genes associated with educational attainment on a variety of outcomes. Because parental and offspring genotypes correlate, polygenic effects on education could be mixed with signals of GWASs on physical and mental health outcomes that are influenced by these environmental factors. Some refer to these indirect genetic effects as 'nature of nurture' (ref. 11 ), implying indirect effects that arise by ways of parenting or nurturing a child. Others call it 'dynastic effects' (ref. 12 ), implying that indirect effects can arise from the succession of (economic) (dis)advantage accumulated across generations, improving children's (socio-economic) positions at birth. As families are nested in neighborhoods, regions and other social structures, accounting for family can partly account for effects at other levels as well.
A third source of gene-environment correlations can be found across geographic regions, which could result from both active and passive processes. Active processes could occur when individuals with favorable genetic predispositions are more likely to improve their environmental circumstances through migration 13 . This process can increase the geographic clustering of genes associated with educational attainment and decrease the geographic clustering of PCs that capture older ancestry differences 13 . Migration can improve rearing environments for offspring as well, making active geneenvironment correlations in one generation induce family-level gene-environment correlations in the next. Passive sources of regional gene-environment correlation could arise, for example, due to government policies that affect certain socioeconomic strata more than others. For instance, a policy change that makes insulin more expensive will introduce a correlation between alleles related to socioeconomic status (SES) (for example, education and income) and those related to consequences of untreated diabetes.
In this study, we investigated the effects of gene-environment correlations across geographic regions on polygenic signals for a wide range of traits. We first examined passive and active gene-environment correlations at the family and regional level. To this end, we used educational attainment polygenic scores and phenotypic measures of 56 complex traits in 22,657 adult sibling pairs from UK Biobank. We then conducted GWASs on 56 complex traits in a dataset of up to 254,557 adult individuals of European descent from Great Britain (UK Biobank) 14 . In these GWASs, we reduced the part of the signal that arises due to gene-environment correlations by introducing fixed effects for neighborhoods that are economically more homogenous than the country as a whole, effectively performing within-region GWASs for a wide range of complex traits. We investigated the impact of gene-environment correlations on the heritability of complex traits and on their genetic relationships with socio-economic outcomes (education and income).

results
We first show gene-environment correlations across geographic regions using polygenic scores in siblings. We then reduce their impact on GWAS signals by controlling for geographic regions. For both parts, we analyzed 1,246,531 common SNPs and 56 complex traits related to physical and mental health, body composition, and emotional, cognitive, behavioral and socioeconomic outcomes (see Supplementary Table 1 for a list of traits and sample sizes). In all analyses, we controlled for population stratification (100 PCs), sex and age.
Polygenic scores in siblings. In the presence of gene-environment correlations, polygenic scores are predictive of both genetic and environmental influences on the trait. Selzam et al. demonstrated in 2,366 dizygotic twin pairs that, for educational attainment and IQ, polygenic scores explain 60% more variance between families than within families 15 . This study was done in children and young adolescents, aged 12-21 years, where much of the gene-environment correlations originated from the family (shared) environment in which they were born and raised, that is, passive gene-environment correlations. We conducted similar analyses in this study in 22,675 adult sibling pairs aged 40-70 years. We extended our analyses to investigate whether gene-environment correlations across geographic regions result in an increase in predictive power and to test whether this was influenced by active gene-environment correlations. Active gene-environment correlations could occur, for example, when adults with a higher educational attainment polygenic score are more likely to move to a more favorable region than their siblings with a lower educational attainment polygenic score (Fig. 1).
SES-related signals are best captured by GWASs on educational attainment and income. We created a polygenic score for educational attainment rather than income because educational attainment had a large GWAS excluding UK Biobank participants (245,621 European participants excluding British cohorts) 16 . We used this polygenic score to predict educational attainment as well as 55 other complex traits, as we expected environmental effects involved in gene-environment correlations to impact a wider variety of outcomes. We tested for the presence of gene-environment correlations on the family level and across geographic regions by fitting five models: model 1 includes polygenic scores on an individual level as a predictor; model 2 includes polygenic scores on the within-family and between-family level as predictors; model 3 includes polygenic scores on the within-region and between-region level as predictors; model 4 includes polygenic scores on the within-family (within-region), between-family (within-region) and between-region level as predictors; in model 5, we decomposed the within-family polygenic score into within-and between-region effects to test for active gene-environment correlations. Regions are based on Middle Layer Super Output Area (MSOA) regions of the current address (Fig. 2). An important indicator for the presence of gene-environment correlations beyond the family level across  geographic regions is a weaker within-family effect in model 4 than in model 2, as that would imply that a portion of the effect captured on the individual level, and not by the family, is due to gene-environment correlations across geographic regions. We determined the significance of this difference by bootstrapping (see Methods for more details on the models). We fitted the five models to the data of 56 complex traits with sample sizes ranging from 11,093 to 43,516 individuals. Main results are shown in Fig. 3 and Extended Data Fig. 1. As expected from ref. 15 , individual-level effects became generally weaker after adding between-family effects (model 1 versus model 2; Extended Data Fig. 1a). For ten traits, the individual-level effect of the polygenic score became significantly weaker after adding a between-region effect to a model with a between-family effect (that is, weaker in model 4 compared to model 2, based on the false discovery rate (FDR)-corrected p-values of the difference in effect sizes based on 1,000 bootstraps; Fig. 3a). The five most significant reductions were observed for body mass index (BMI) (P = 1 × 10 −5 ), waist circumference (P = 1 × 10 −4 ), household income (P = 1 × 10 −4 ), time spent watching television (P = 3 × 10 −4 ) and whole-body fat mass (P = 6 × 10 −4 ), possibly because, of all traits considered, these are most likely to change once siblings migrate away from the parental residence (see Table 1 for full results for these traits). Adding the between-region effect to the between-family effect also significantly decreased the individual-level polygenic score effect for educational attainment (P = 9 × 10 −4 ). Six traits showed an increase in R 2 > 2% after adding the between-region effect to the between-family effect (Fig. 3b). When comparing fixed effect estimates within model 4, the majority of traits showed higher between-region than between-family effect (Fig. 3c), implying additional explanatory power of geographic regions not captured at the individual or family level. Part of the between-family effect in model 2 can be explained by between-region effects, as reflected by a significant decrease of the between-family effect in the majority of traits after adding the between-region effect (model 4 versus model 2; Extended Data Fig.  1b). After decomposing the within-family effect into within-and between-region effects (model 5), the majority of traits showed higher between-region than within-region effect (Fig. 3d), implying wide-spread active gene-environment correlations.
GWASs controlled for geography. We ran linear mixed model (LMM) 17 GWASs on 56 complex traits in up to 254,387 participants of European descent. We included the geographic region of birth and/or current residence of the participants as dummy coded fixed effects to control for gene-environment correlations. Geographic regions were obtained by mapping latitude and longitude coordinates of birthplace or current address (1-km resolution) to local authority areas or MSOA regions (Fig. 1). The local authority areas are based on the level of subnational division used for the purposes of local government, while MSOA regions are defined as a set of adjacent output areas chosen to have comparable population sizes and to be "as socially homogenous as possible based on tenure of household and dwelling type" (ref. 18 ). Both local authority regions and MSOA regions explained significant amounts of variation for all 56 complex traits, most for household income (~5% based on birthplace, ~14% based on current address; Extended Data Fig. 2). Current address consistently explained more variation than birthplace, in line with richer and healthier people being more likely to have moved to regions inhabited by richer and healthier people 13 . We only included regions with ≥ 100 UK Biobank participants and selected only participants with all geographic information available. For local authority areas, this resulted in 282 regions for birthplace and 147 regions for current address. For MSOA regions, this resulted in 816 regions for birthplace and 1,747 regions for current address. A total of 254,557 participants with geographic regions were available for both birthplace and current address (Fig. 2). Of these participants, between 63,780 and 254,387 had phenotypes available (Supplementary Table 1). In addition, we compared the results with those obtained when controlling the GWASs for latitude and longitude coordinates (also for birthplace, current address    Supplementary Table 1 for sample size per trait). error bars in a, c and d indicate 95% confidence intervals. a, Comparison of the within-effect estimate of model 2 and the within-effect estimate of model 4. Trait names are shown for the ten traits that showed a significant decrease (p-value of the difference based on 1,000 bootstraps). b, Comparison of the marginal R 2 of models 2 and 4 (that is, variance explained by all fixed effects, including age and sex). Trait names are shown for the six traits for which the difference between models 2 and 4 was more than 2%. c, Comparison of the between-family effect and between-region effect estimates of model 4. d, Comparison of the within-region effect and between-region effect estimates of model 5. Table 1  and both) and assessment center. As we explain in the Methods, the current address measure is likely to be more precise than the birthplace measure. We compared GWAS results controlling for region with the results of conventional GWASs not corrected for region, obtained from the same selection of individuals. The impact of controlling for geographic region was investigated by computing the magnitude and significance of the change in SNP-based heritability and the change in genetic correlation with two indicators of SES, namely educational attainment and household income.
SNP-based heritability. Without controlling for geographic region, the SNP-based heritabilities of the 56 traits ranged from 0.02 to 0.41 (estimated using linkage disequilibrium (LD) score regression 19 based on ~1.2 million SNPs), with physical traits showing higher heritability estimates than behavioral traits (Fig. 4) show the change in SNP-based heritability after controlling for geographic region. All heritability estimates before and after controlling for geographic region can be found in the Supplementary Data file. The heritability estimates most consistently affected by controlling for local authority or MSOA regions were those of educational attainment and income. Controlling for current address resulted in stronger heritability reductions than controlling for birthplace, and including both resulted in the strongest reductions. Controlling for the smaller MSOA regions resulted in stronger heritability reductions than controlling for the larger local authority regions. Accordingly, controlling for MSOA regions based on both birthplace and current address resulted in significant heritability reductions for the largest number of traits (n = 6): household income (from 7% to 4%), educational attainment (from 14% to 9%), age at first birth (from 14% to 9%), time spent watching television (from 12% to 9%), overall health (from 8% to 7%) and fluid intelligence (from 22% to 19%). These traits have a strong relationship with SES, especially income and educational attainment, which showed the strongest reduction and also the strongest geographic clustering (Extended Data Fig. 2), making it likely that their polygenic signal was larger because it captured effects attributable to gene-environment correlations.
Assessment center did not significantly impact any of the heritability estimates, while latitude and longitude did, but for very different traits, namely anthropomorphic and cardiovascular traits (Extended Data Figs. 3 and 4). The SNP-based heritability of height was most strongly affected by latitude and longitude corrections, decreasing from ~41% to ~13% (for both birthplace and current address separately and combined). Other significant reductions were observed for hip circumference, corpuscular volume and corpuscular hemoglobin. These effects could not be explained by a reduction in population stratification, as the LD score intercept increased after controlling for latitude and longitude (Supplementary Table 2). This heritability reduction only occurred when controlling for 100 PCs and latitude and longitude combined but not when controlling for only PCs or only longitude and latitude (Supplementary Table 2); because latitude and longitude correlate strongly with several PCs (Supplementary Table 3), this effect may be caused by multicollinearity.
Genetic correlations. Genes associated with socioeconomic success can influence which neighborhoods people can afford to live in, and thus the quality of people's living environment. Environmental exposures that differ between neighborhoods and regions can affect a wide range of physical and mental health outcomes, which causes    Supplementary Table 1 for sample size per trait). genes associated with socioeconomic success to also become associated with these physical and mental health outcomes. We investigated whether controlling for regional differences decreases genetic correlations with SES. Genetic correlations were computed for 56 complex traits with educational attainment and household income using LD score regression 20 and ∼1.2 million SNPs. The significance of the change in genetic correlations after controlling for geography was tested in Genomic SEM 21 accounting for the dependence between the various GWASs, which all rely on the same sample. Figure 6 and Extended Data Fig. 5 show the changes in genetic correlations and their significance. All uncorrected and corrected genetic correlations with educational attainment and household income can be found in Extended Data Figs. 6 and 7 and in the Supplementary Data file.
Controlling for local authority or MSOA region significantly reduced the genetic correlations between most of the 56 complex traits and education and income (Fig. 6). We observed the most and strongest reductions when controlling for birthplace and current address jointly and the smaller MSOA regions. When controlling for MSOA regions based on both birthplace and current address jointly, 41 traits showed a significant reduction in the genetic correlation with educational attainment. The five most significant decreases were observed for height (from 0.20 to 0.11, P change = 9 ×  Table 1. A relatively small number of traits showed significantly stronger genetic correlations with educational attainment after controlling for geographic region. When controlling for MSOA region based on both birthplace and current address, genetic correlations with education became significantly stronger for eight traits (number of sexual partners, corpuscular volume, corpuscular hemoglobin, risk-taking, age at menarche, job satisfaction, drinks per week and smoking initiation) and genetic correlations with income became significantly stronger for six traits (ever sought/received professional help for mental distress, number of sexual partners, corpuscular volume, corpuscular hemoglobin, happiness and family relationship satisfaction). This could mean that regional differences in SES masked genetic correlations between these traits and educational attainment, but could potentially also result from collider bias (Discussion and Methods).
We also computed genetic correlations between cognitive and noncognitive 22 components of educational attainment (Extended Data Figs. 7 and 8). Similar changes occurred after controlling for MSOA region, except for a small number of traits differentially correlated with cognitive versus noncognitive skills, which, accordingly, showed differential effects for controlling for geography. Interestingly, income showed a particularly strong difference, with little change in cognitive skills after controlling for MSOA, but a significant decrease in its genetic correlation with noncognitive skills.

Discussion
Environmental factors that differ between economically prosperous and deprived regions influence a wide range of complex traits, while these regions can also show genetic differences. Within-family designs can reduce the impact of these gene-environment correlations on GWASs 23-25 , but they do not control for active geneenvironment correlations that occur when genetic differences  between family members become associated with SES-related neighborhood characteristics after children leave the parental residence. Furthermore, large sample sizes of genotyped families are harder to attain, as reflected in noisier genetic effect estimates of current within-family GWASs (Extended Data Fig. 9). We showed here that the effects of gene-environment correlations that extend beyond the family can be reduced in GWASs by controlling for geographic regions. Fully removing polygenic effects that affect the outcome via the social environment will be more challenging, and it depends on the research question of the GWAS whether it would be desirable to exclude this causal chain from the signal 26 .
We confirmed the presence of gene-environment correlations across geographic regions by analyzing associations between educational attainment polygenic scores and 56 complex traits in adult siblings. A significant part of the predictive power of the polygenic score could be attributed to gene-environment correlations across families and across geographic regions. Geographic regions capture a substantial part of family-level gene-environment correlation and a significant, but smaller, portion of independent gene-environment correlations across regions. These additional gene-environment correlations were less significant for educational attainment than for traits, such as BMI, income and time spent watching  Figs. 3 and 4). error bars indicate 95% confidence intervals. Asterisks indicate FDr-corrected P < 0.05, corresponding to a significant change in genetic correlation. Sample sizes of the GWASs ranged from 63,780 to 254,387 (see Supplementary Table 1 for sample size per trait).
television, even though these analyses were done with an educational attainment polygenic score. This may be explained by people obtaining their education before migrating to their current address, in which case passive gene-environment correlations would have a stronger impact than active gene-environment correlations on educational attainment. Controlling GWASs for geographic region significantly reduced SNP-based heritability estimates for a relatively small number of SES-related outcomes, most significantly for income, educational attainment, age at first birth, time spent watching television, overall health and fluid intelligence. Genetic correlations with SES (education and income) decreased significantly for most traits, more so when controlling for current address than for birthplace, in line with increased geographic clustering of complex trait variation (and decreased geographic clustering of ancestry-related variation) 13 due to SES-related migration. Parents' addresses are likely influenced by the same genetic variants inherited by their offspring, and there are multiple mechanisms that could lead to offspring increasing the already significant gene-environment correlation through their own migration in adulthood. These mechanisms could be environmental and/or genetic, including wealth transfer from parent to child, or offspring potentially having higher polygenic scores than their parents due to assortative mating, which is especially strong for SES 27,28 .
The most significant reductions in genetic correlations with education and income were observed for traits related to BMI and body fat, suggesting correlations between SES-related genes and obesogenic environments. This may help (partly) explain why the polygenic score for BMI shows the strongest geographic clustering in Great Britain, after educational attainment and cognition 13 . While the relationship between BMI and SES is positive in poorer countries, where food insecurity relates to food shortages, it is reversed in more developed countries, where food insecurity relates to a lack of access to healthy foods 29 . The number of fast-food restaurants and diabetes rates in British neighborhoods are significantly correlated with regional differences in (polygenic scores for) educational attainment 13 . Behavioral traits related to body weight, namely time spent watching television and frequency of alcohol intake, are also among the top five traits showing these gene-environment correlations in their polygenic signals. This suggests that, besides dietary options, behaviors that correlate with regional socio-economic factors may also affect regional differences in body weight and their associated polygenic signals.
There are several limitations to be kept in mind when interpreting our results. Firstly, UK Biobank participants are on average more highly educated and healthier than the general population, and they are more often from regions that are better developed economically 30,31 . Geographic clustering of SES is probably stronger in the general population than in UK Biobank 13 , so effects observed in the current study may be underestimated. Furthermore, the geographic coverage is wider for birthplace than for current address, as participants were sampled to live within a radius of 35 km of one of the 22 UK Biobank assessment centers. Controlling for assessment center, however, had minimal impact on the GWAS signal compared to the other regional measures (Extended Data Figs. 3-5). The geographic locations that we use are not precise; to ensure anonymity, birthplace and current address have been rounded to 1 km and the current address location is more precise than birthplace (Methods). While boundaries of MSOA regions were chosen to delineate socially homogeneous regions 18 , the geographic location of participants is only a relatively crude and temporally variable proxy for social environments that underlie the gene-environment correlations that we try to control for. Environmental circumstances start with the family environment and expand to close and extended social circles, likely across multiple communities throughout life. It will be challenging to fully understand and account for correlations between genes and environments, but there is room for improvement by genotyping family members, social circles and collecting longitudinal information on the participants' living environments. Furthermore, when correcting for geographic location, there is a risk of collider bias: if genetic variants affect current address (for example, through effects on cognitive ability) and the outcome of interest (for example, substance use) also affects current address, controlling for current address in the GWAS on substance use may induce collider bias, biasing estimates of SNP associations, heritability and genetic correlations (Methods and Extended Data Fig. 10).
Finally, controlling for current address only gets us closer to the direct genetic effect on the outcome if the relationship between environment and outcome arises from a causal effect of the current environment on the outcome. The outcomes for which we detect the strongest evidence for active gene-environment correlations (for example, BMI, time spent watching television) are plausible outcomes of current adult environments, while for other outcomes it is more plausible that they contributed to the current environment (for example, educational attainment).
Effects estimated in GWASs of many phenotypes are affected by gene-environment correlations, and these are not entirely attributable to processes that take place within a family but are also attributable more broadly to regional social, economic and political processes that correlate with individuals' genotypes. We showed how to significantly reduce these effects in GWAS signals. It will depend on the goals of the research whether this would be desirable, as these effects result from dynamic social circumstances that are part of a true causal chain in between our DNA and complex mental and physical health outcomes. Statistical models, research designs and conclusions of GWASs need to more carefully reflect the reality of the social and geographic structure of society.

Online content
Any methods, additional references, Nature Research reporting summaries, source data, extended data, supplementary information, acknowledgments, peer review information; details of author contributions and competing interests; and statements of data and code availability are available at https://doi.org/10.1038/ s41588-022-01158-0.
Genetic relatedness matrix. We created genetic relatedness matrices (GRMs) to include in our LMM GWASs to control for cryptic relatedness. The GRMs contain genetic relationships between all individuals based on a slightly LD-pruned HapMap 3 SNP set (LD-pruning parameters used in PLINK: window size = 1,000 variant count, step size = 100, r 2 cutoff = 0.9 and MAF > 0.01, resulting in 575,293 SNPs). The GRMs were computed using GCTA 34 on individuals of European descent. We created a sparse GRM, containing only the relationships of related individuals (cutoff = 0.05, resulting in 179,609 relationships) to control for the presence of closely related individuals (cousins, siblings, parent-offspring pairs).

Polygenic scores.
We computed polygenic scores, that is, the genome-wide sum of alleles weighted by their estimated effect sizes, for educational attainment. The allelic effect size estimates were obtained from the GWAS from ref. 35 , which was re-computed to exclude not only UK Biobank dataset (to avoid over-estimation of the genetic predisposition of a trait) 36 , but also all British cohorts, as an extra measure against residual population stratification within Great Britain. The polygenic scores were computed with the SBLUP approach 28 , which maximizes the predictive power by creating scores with best linear unbiased predictor (BLUP) properties and accounts for LD between SNPs. As a reference sample for the LD, we used a random sample of 10,000 unrelated individuals from UK Biobank that were imputed using the HRC reference panel 37 . To control for population stratification, we regressed out the first 100 PCs from the polygenic scores.
Phenotypic and geographic measures. Phenotypes. Selection of phenotypic outcomes was based on the relevance of the metric to broad mental and physical health outcomes, resulting in the selection of 56 complex traits encompassing domains of anthropomorphic traits, cardiovascular outcomes, cognition, SES, depressive symptoms, sedentary behavior, reproductive behavior, risk-taking behavior, physical activity, self-reported overall health, sleep, social connection and substance use (Supplementary Table 1). All traits were analyzed as provided by UK Biobank, except for the substance use phenotypes, which were defined according to the GWAS & Sequencing Consortium of Alcohol and Nicotine (GSCAN) in ref. 38 , and educational attainment, which was transformed to years of education as defined according to the International Standard Classification of Education (ISCED) coding as analyzed in ref. 16 .
Geographic measures. Birthplace location was based on the coordinates in UK Biobank fields 129 (latitude) and 130 (longitude). UK Biobank verbal interview includes a procedure to ascertain a participant's birthplace described as follows: "The interviewer is provided with a tree structure that lists place names and counties in England, Wales and Scotland. They were instructed to enter at least the first three letters of the town/village/place that the participant provides. If there are too many matches to the first three letters, no place names appear, and more letters need to be entered. If there is more than one listing of the relevant place name, then they were asked to choose the one with correct district or county. In order to narrow down the search, the interviewer may also need to type in the district or county to find a match. If they cannot find the place name, they were instructed to use the Enter Other facility to enter free text to state the town, county (or district) and country. If the participant does not know, there is the option to enter Unknown. Place of birth in the United Kingdom is then converted into North and East coordinates. " It is not clear whether birthplace refers to the residence at birth or the place of the hospital of birth. The current address location was based on the coordinates in UK Biobank fields 22702 (longitude) and 22703 (latitude). Deriving these coordinates is described by UK Biobank as follows: "Where the full address is present and is verified to be valid, software package DataPlus (provided in the QuickAddress Batch packet) is used to transform the address data into the grid coordinates. Where only the postcode is present, the grid coordinates are generated with the aid of online mapping tools: doogal (https://www.doogal. co.uk/) and uk-postcodes (https://www.uk-postcodes.com). Further details of this process are available from relevant websites. " The participants' coordinates, which were rounded to 1 km, were mapped to the nearest MSOA region using a shapefile obtained from the InFuse website, which is part of UK Data Service Census Support 39 . The R-packages sp (v1.4-4) and rgdal (v1.5-18) were used to merge the spatial data from the MSOA shapefile [40][41][42] .
Sibling polygenic score analyses. We extended the model from ref. 15 using the polygenic score in 22,675 siblings based on an educational attainment GWAS in 245,621 European participants that excluded all British cohorts 16 , regressed the first 100 PCs out of the polygenic score to control for population stratification and tested for the presence of gene-environment correlations on the family level as well as across geographic regions by fitting the following four models (covariates of sex and age are included but not shown in the following equations): Model 1: The model, with the polygenic score on an individual level as fixed effect: Model 2: The model with between-family fixed effects added, as used in ref. 15 : Model 3: The model with between-region fixed effects added: Model 4: The model with both between-family and between-region fixed effects added: Here Y ijk denotes the phenotypic outcome, where i = [1,2] corresponds to the sibling (1 is the oldest sibling) from family j, who lives in MSOA region k. PRS denotes the polygenic score, PRSj refers to the mean polygenic score of the family and PRS k refers to the mean polygenic score of the region. α 0 denotes the intercept; γ j denotes the random intercept with γ j ~ N(0,σ 2 γ ), accounting for between-family variation in the intercept; γ k denotes the random intercept with γ k ~ N(0,σ 2 γ ), accounting for between-region variation in the intercept. The residual is represented as ε ijk with ε ijk ~ N(0,σ 2 ε ). This random intercept mixed-effects model can include multiple fixed effects to separate the association between the polygenic score and the phenotype into within-family (that is, individual-level) and between-family and between-region effects. The random effect term σ 2 γ , which estimates the difference between the group intercepts γ j , γ k and the overall intercept α 0 , accounts for the residual structure in the data corresponding to all unaccounted familial and regional factors (both genetic and environmental) that contribute to phenotypic similarities within families and within regions.
Next, to test for active gene-environment correlations, we decomposed the within-family effect into within-and between-region effects. This allowed us to investigate whether the between-family model captures all gene-environment correlations in the individual-level polygenic score or whether part of the within-family effect also contains between-region effects. We fitted the following model 5: All models included sex and age as fixed covariates (not displayed in the formulas above).
To establish whether the individual-level genetic effect (β W ) differs between models 2 and 4, we need to account for the fact that we rely on near perfectly overlapping data. We do so by way of a bootstrap procedure. We resampled, with replacement, a number of observations equal to the number of observations in the original dataset from rows of the dataset. In 1,000 bootstrap samples, we re-estimated models 2 and 4, computed the difference in β W between models 2 and 4, and computed the standard deviation of this difference, which served as the bootstrapped standard error. Any correlation between β W2 and β W4 is reproduced faithfully across the bootstrap samples, meaning that the standard error of their differences accounts for this correlation. We then computed a bootstrap P value assuming the distribution of ( β W2 − β W4 /s.d.( β W2 − β W4 )) 2 is χ 2 with 1 degree of freedom under the null.

Genetic association analyses.
We performed four GWASs per trait. First, we performed GWASs using two regression models. Model 1 is as follows: Here P 1 to P 100 represent ancestry-informative PCs derived as described above, u is a vector of random effects and Z is a random effects design matrix and a random effects model as described in ref. 17 , which is used to account for the presence of closely related individuals and an extra guard against population stratification. Model 2 is as follows: yi = β 0 + β 1 × SNP + … + β 4 × P1 + … + β 104 × P100 + β 105 ×D1 + … + β k × D k + Zu + ei The second equation omits sex and age for brevity and includes dummy variables D 1 through D K for all but one MSOA region of birth. The directed acyclic graph (DAG) in Extended Data Fig. 10a describes the suspected causal structure of the data we model, where P represents the previous generation (parental influence), BP is birthplace, SNP represents the genes carried by the individual and Y corresponds to the phenotypic outcome. Along similar lines, a GWAS was performed using dummy variables based on current address instead of birthplace and an analysis where dummy variables for both birthplace and current address were included. The plausible causal models in the GWASs that correct for current address are more complicated. We propose three DAGs, which we feel are abstractions of potential causal processes that relate confounding parental influences (P), genotype (SNP), current address (CA) and outcome (Y). We include these DAGs and their descriptions because they are useful to have in mind when evaluating our results. In practice, we expect that a mix of these processes, or more complex processes altogether, underpins the relationship between genotype and outcome.
The first causal process (Extended Data Fig. 10b) that may have a role is a process where a confounder, such as intergenerational transfer of wealth through inheritance or financial support during college (or lack thereof), is correlated to the parental genome and therefore the offspring's genome (SNP) as well as the address of the adult participant (CA), and controlling for address ensures the regression of Y on SNP is no longer confounded by P (similar to the process that underlies controlling for birthplace).
The second causal process (Extended Data Fig. 10c) is one where the genotype (SNP) mediated by traits, such as cognitive ability and mental health, affects people's ability to attain a higher education and/or be upwardly socially mobile, and so influences which environment people can afford to live in, which in turn influences the outcome (Y) of interest. Here, if we control for current address, we test for a more 'direct' effect, not mediated by environmental exposures, of genotype (SNP) on outcome (Y). The (probable) presence of mediation would mean that controlling for current address is likely to lead to qualitative changes in the genetic effect estimates to a different extent than when controlling for birthplace. However, even in the absence of mediation, we could expect differences herein, as current address appears to be measured more precisely.
Finally, as depicted in the causal model in Extended Data Fig. 10d, there is the risk that the genotype (SNP), through its effect on other traits (for example, cognitive ability), influences current address (CA), while the outcome (Y) (for example, substance use) also influences current address. In this case, conditioning on current address in a GWAS on, for example, substance use would potentially induce collider bias, which is undesirable. In practice, we do not know which of the causal processes, or which mix of causal processes, underlies the data. The effects of correcting for current address are therefore more complex to interpret.
SNP-based heritability and genetic correlation. Heritability and genetic correlation were estimated using LD score regression 19,20 and Genomic SEM 21 version 0.0.3. The genetic correlations represent the genetic covariation between two traits based on all polygenic effects captured by the included SNPs, and are estimated with the slope from the regression of the product of the two z-scores from the two GWASs on the LD score 20 . The genome-wide LD information used was based on European populations from the HapMap3 reference panel 19,43 . All LD score regression analyses included the ~1.3 million genome-wide HapMap SNPs used in the original LD score regression studies 19,20 . The standard error of the difference between the heritability and genetic correlations based on the different specifications could not easily be estimated because the GWASs, for which we wanted to obtain the differences were based on the exact same sample and their standard errors were therefore highly dependent. Thus, we estimated the standard error of the differences in heritability and genetic correlations with Genomic SEM, which allowed us to account for the dependence between the estimates of SNP-based heritability and genetic correlations. Genomic SEM accounts for this dependence by explicitly considering the correlation between estimates of heritability and/or genetic correlations that are modeled jointly (for details see ref. 21 ). To obtain the P value of the difference, we divided the estimate of the difference by its standard error and performed a Z test. Significance was then determined after FDR correction of the P value. For geography-corrected traits, genetic correlations were computed with either educational attainment or income, and these were also corrected for the same geographic variable.