BackgroundLiving in a more deprived area is associated with worse health, at any stage of life. We aimed to improve understanding of how our health is related to our neighbourhood by using structural equation modelling to evaluate two conceptual frameworks: (1) the neighbourhood effect, in which area deprivation directly affects individuals’ health; and (2) health selection, in which people sort themselves into neighbourhoods over time by health. MethodsIn this analysis, we used data from the 1958 (ages 16, 23, 33, 42, and 55 years; n=18 555) and 1970 (ages 16, 24, 34, and 42 years; n=18 639) British Birth cohorts to investigate life-course relationships between body-mass index (BMI) and area deprivation; residential address at each age was linked to the closest Townsend deprivation index score taken from 1971–2011 census data, recalculated for 2011 lower-super-output boundaries. Model fit was compared between three models: area deprivation (in which pathways lead from Townsend score at one age to BMI at the next age); health selection (from BMI at one age to Townsend score at the next age); and both combined. In the best fitting model, we tested whether relationships differed for people who had moved house and those who had not (≥one vs no moves over each age interval), by using interaction terms fitted separately by pathway. FindingsModel fit statistics for all three models were almost identical (eg, root mean square of approximation was ~0·07 in the 1958 cohort ~0·07 and ~0·05 in the 1970 cohort), with associations seen for neighbourhood effect and health selection pathways, so the model with both frameworks was chosen for further analysis. For both cohorts, BMI and area deprivation strongly tracked through life, and area deprivation predicted BMI at the next interval (eg, a 1-unit increase in Townsend score at age 42 years led to a 0·09 [95% CI 0·05–0·12] increase in BMI at age 55 years), for all age intervals, except the 1958 cohort path of Townsend score at age 23 years to BMI at age 33 years. In contrast, health selection paths were weak and only occurred at four intervals: BMI at 23 years to Townsend score at 33 years, BMI at 33 years to Townsend score at 42 years, and BMI at 42 years to Townsend score at 55 years, all in the 1958 cohort, and BMI at age 34 years to Townsend score at 42 years in the 1970 cohort (eg a 1-unit higher BMI at age 23 years led to a 0·04 [95% CI 0·03–0·06] higher Townsend score at age 33 years). Moving status did not modify associations between any area deprivation effect or BMI health selection paths. InterpretationOn the basis of our prespecified models, selective sorting by BMI across adulthood is weak and does not explain life-course associations between area deprivation and BMI. Data on complete residential histories might have provided a more thorough test of the research hypothesis. Further research could also address the longitudinal study attrition to provide more robust findings. FundingLeverhulme Trust Research Project (RPG-2015-317).