Relative importance of perceived physical and social neighborhood characteristics for depression: a machine learning approach
The physical and social neighborhood environments are increasingly recognized as determinants for depression. There is little evidence on combined effects of multiple neighborhood characteristics and their importance. Our aim was (1) to examine associations between depression severity and multiple perceived neighborhood environments; and (2) to assess their relative importance.
Cross-sectional data were drawn from a population-representative sample (N = 9435) from the Netherlands. Depression severity was screened with the Patient Health Questionnaire (PHQ-9) and neighborhood perceptions were surveyed. Supervised machine learning models were employed to assess depression severity-perceived neighborhood environment associations.
We found indications that neighborhood social cohesion, pleasantness, and safety inversely correlate with PHQ-9 scores, while increasing perceived distance to green space and traffic were correlated positively. Perceived distance to blue space and urbanicity seemed uncorrelated. Young adults, low-income earners, low-educated, unemployed, and divorced persons were more likely to have higher PHQ-9 scores. Neighborhood characteristics appeared to be less important than personal attributes (e.g., age, marital and employment status). Results were robust across different ML models.
This study suggested that the perceived social environment plays, independent of socio-demographics, a role in depression severity. Contrasted with person-level and social neighborhood characteristics, the prominence of the physical neighborhood environment should not be overstated.
KeywordsDepression Social neighborhood environment Physical neighborhood environment Netherlands
Instruments for assessing levels of physical activity and fitness
Dynamic urban environmental exposures on depression and suicide
Generalized linear model
Geographic information system
Gradient boosting machine
Mean absolute error
Patient Health Questionnaire
It is gradually established that people’s mental health is shaped, in addition to person-level attributes , by the neighborhood environment, which can be broadly categorized into physical and social characteristics . Since mental illness contributes 13% of disability adjusted life-years lost to the global burden of mental disorders , it is necessary to understand how and to what extent the physical and social neighborhoods affect depression.
Recent reviews, mainly including cross-sectional and limited longitudinal evidence, suggest that socio-spatial aspects of people’s living environment can contribute to or be protective against depression [4, 5, 6]. It was found that, for example, traffic-related air pollution , noise , safety concerns , and urbanicity  were harmful for mental health because they are usually experienced as undesirable and stressful for residents which may, in turn, promote depressive mood [6, 11].
In contrast, it is theorized that green and blue space , and social capital  were beneficial because such factors may be stress-reducing and buffer against negative thoughts , while neighborhood safety and social cohesion could act as coping mechanisms to safeguard from psychological distress . Associations such as these are, however, not universally confirmed, and the mechanisms are yet to be fully understood.
Our present knowledge mainly originates from studies incorporating a single neighborhood characteristic [15, 16, 17], which may have resulted in misestimated neighborhood effects. In fact, as put forward by the socio-ecological model of health , multiple physical and social neighborhood characteristics may be involved at the same time, implying a complex interplay. Therefore, when assessing correlations, either directly or in interaction with person-level attributes, it is rational to assume that multiple neighborhood characteristics may re-inforce or level-out each other. Supportive empirical evidence is, however, scarce [19, 20, 21], as are studies that assess the relative importance of such characteristics in such a constellation .
Furthermore, it is suggested that neighborhood characteristics interact and are potentially non-linearly associated with depression . Current insights from conventional (multilevel) regressions may be limited in that they assume correlations are linear [19, 20, 21]. This cannot be substantiated by theoretical considerations , and potentially results in overly simplistic models which may contribute to contradictory findings.
These issues might be overcome through machine learning (ML) . ML includes a broad set of inductive models that learn to approximate unknown target functions from training data without being explicitly designed for a specific task. Echoing recent calls for methodological advances , many of the models allow for non-linear correlations, routinely assess variable importance, and explore interactions between person-level and neighborhood characteristics.
Given the inconsistencies between and the methodological limitations of studies conducted to date, this large-scale explorative study in the Netherlands aimed (1) to examine the associations of physical and social neighborhood characteristics on people’s depression severity; and (2) to assess the relative importance of people’s perception of physical and social neighborhood characteristics on depression severity through ML approaches.
Materials and methods
Study setting and participants
This cross-sectional study reports on a nationally representative population sample in the Netherlands. In the course of the NEEDS project , an online survey was carried out with Statistics Netherlands between September and December 2018.
Participants needed to fulfill the following eligibility criteria: to be aged between 18 and 65 years, and living in a private household. Through systematic sampling with probabilities proportional to the target population size, sub-municipalities were first selected from each COROP region (i.e., a regional Dutch division). Next, from those regions individuals registered in the Dutch National Personal Records Database were randomly sampled. Incentives were offered to increase the response. Of those 45,000 invited people, 11,524 completed the questionnaire resulting in an overall response rate of 25.6%. We conducted a complete case analysis excluding those with any missing information. After exclusions due to incomplete variables (N = 2089), the final sample size was 9435. A full description of the study protocol  and the survey is available .
Ethical approval of the study design was obtained from the Ethics Review Board of the Faculty of Social and Behavioral Sciences of Utrecht University (FETC17–060). Informed consent was implied by conducting the questionnaire.
Our survey in the Dutch language comprised various modules including sociodemographics, mental health, and perception of the residential neighborhood. Other questions were asked but were not included here. The survey was further enriched with selected register data, namely urbanicity and income, available through Statistics Netherlands. If not mentioned otherwise, register data refer to 1st July 2018.
Severity of depression
Depression severity was operationalized through the depression module of the Patient Health Questionnaire (PHQ-9) . This instrument was recognized as having good diagnostic performance, good sensitivity, and good specificity in a meta-analyses . The 9-item long screener assesses people’s experience within the last 2 weeks. The statements address whether a respondent felt down or depressed, had pleasure in doing things, had thoughts of suicide, etc. Each item is on a 4-point Likert scale ranging from “not at all” to “nearly every day”. We summed the individual item scores per question. The total score was our outcome measure, assumed to be continuous. A PHQ-9 total score of 1 refers to no evidence of depressive symptoms, while 27 represents highest depression severity. The internal consistency of the PHQ-9 in our sample had a Cronbach’s alpha of 0.887.
Physical neighborhood environment
Residential exposure to natural environments was measured twofold: first, we asked for the perceived distance to the nearest green space (defined as parks, play areas, sports fields or forests), and second, perceived distance to the nearest blue space (rivers, lakes, beaches). Distances were categorized into < 300 m, 300–1 km, > 1–5 km, and > 5 km. These were in line with others [28, 29].
To capture the perceived density of traffic, respondents were asked to evaluate traffic in their neighborhood based on their experiences in the past 6 months. The variable was on a 4-point Likert scale from “very busy/congestion” to “very quiet”, with a greater higher score indicating less perceived density of traffic.
Pleasantness was operationalized using four questions from the ALPHA questionnaire . Respondents were asked to what extent they agree that the environment is pleasant for walking and cycling, the amount of incivilities (e.g., litter, graffiti) present, the number of trees in the street and the maintenance of buildings. Each question was answered on a 4-point Likert scale, with inverse scoring on negatively stated items. A greater score overall indicated a more pleasant neighborhood. The Cronbach’s alpha was with 0.620 low. It is argued elsewhere  that for such environmental constructs a reduced Cronbach’s alpha is acceptable because the involved indicators are often not intercorrelated.
Data on urbanicity refer to the urbanicity of the neighborhood (‘buurt’) of the person’s home according to Statistics Netherlands. The variable was grouped into quintiles ranging from “not urban” (< 500 addresses/km2) to “very strongly urban” (> 2500 addresses/km2). Within this range, class breaks were set every additional 500 addresses/km2.
Social neighborhood environment
To operationalize social cohesion, participants were asked to rate their agreement on a 5-point scale ranging from 1 (totally agree) to 5 (totally disagree), with the following statements : ‘People around here are willing to help their neighbors’, ‘I live in a cozy neighborhood, people in this neighborhood can be trusted’, ‘people in this neighborhood generally cannot get along so well’, and ‘people in this neighborhood do not share the same values’. Negatively stated items were inversely scored, with a higher score overall indicating greater social cohesion. The internal consistency was with a Cronbach’s alpha of 0.829.
Questions on perceived safety were drawn from the “neighborhood safety” module within the ALPHA questionnaire . Participants rated their level of agreement with a set of five statements on a 4-point Likert scale from 1 (strongly disagree) to 4 (strongly agree). Statements included: ‘It is dangerous to leave a bicycle locked in my neighborhood’ and ‘it is dangerous in my neighborhood during the day because of the level of crime’. Responses were reverse coded and then summed. The Cronbach’s alpha was 0.822.
The following routinely considered covariates were included [1, 19, 32]: age (grouped into 5-year categories), gender (men, woman), ethnicity (Dutch, Western background, non-Western background), marital status (married, divorced, widowed, unmarried), employment status (employed, unemployed), and education (re-coded into low (up to lower secondary education), medium (up to upper secondary education), and high (university education and further)). Household income was obtained via Statistics Netherlands; the most recent data available are from 1st January 2016. The data were classified into quintiles (1 = lowest, 5 = highest).
Machine learning models
We undertook a supervised machine learning (ML)  approach to assess associations between depression severity and neighborhood characteristics while adjusting for person-level attributes. Generally spoken, supervised ML models seek for patterns (i.e., complex relationships and interactions) in training data and use this information to conduct inference or predictions for unseen data without relying on strict model assumptions.
Since the repertoire of available regression-based ML algorithms is large and the performance may depend on the data set at hand , we selected well-established regression-based models. We fitted a generalized linear model (GLM)  as base model, and the following three ML models: an artificial neural network (NNET) , a random forest (RF) , and a gradient boosting machine (GBM) . For brief model descriptions, see the supplementary materials. Our model pre-selection was also guided by benchmark studies . Each model was fitted with depression severity as outcome variable and full covariate adjustment. All input variables were scaled to have zero mean and unit variance to make them comparable.
The goodness-of-fit of each model depends on the chosen hyper-parameters. We tested different settings from and evaluated the models’ root-mean-square error (RMSE), the mean absolute error (MAE), and R2 using 10 times repeated 10-fold cross-validation (CV). CV randomly partitions the data into 10 disjoint subsets. Subsets are used one at a time for model testing while the remaining ones are used for model building. Table A1 in the supplementary materials lists the final parameter settings. All analyses were carried out in the R programing environment  and the caret package  facilitated parameter tuning and model validation, while providing a unified interface for each algorithm.
Different strategies were conducted for an in-depth model understanding. First, we assessed the variable importance relative to each other by permuting one variable at a time and measuring the change in performance . To explore commonalities in variable importance, a heat map was generated. Second, to investigate the directions of the relationships and possible non-linearities, partial dependence plots were used. These plots show the change in the average predicted value as one or more variables vary over their marginal distribution . Third, through the H statistic we quantified either the total interaction of one variable with all others or the interaction of two variables . A value of 0 means no interaction; 1 means that the entire variance is explained by the partial dependence functions.
< 300 m
300 m to 1 km
> 1 km to 5 km
> 5 km
< 300 m
300 m to 1 km
> 1 km to 5 km
> 5 km
Similar patterns were observed for social cohesion. High education and income were associated with lower PHQ-9 scores. However, while the differences in PHQ-9 scores between education groups decreased with social cohesion score, a decrease in the differences of the PHQ-9 scores between income groups was not always observable. For instance, there was always a notable gap in PHQ-9 scores between low and middle income groups, regardless of the social cohesion score. Moreover, when comparing the different models, it can be seen that for GBM, no decrease in PHQ-9 scores can be observed for a social cohesion score from 5 to 11.
Main findings in the context of available evidence
This study assessed how multiple physical and social neighborhood characteristics together are correlated with depression severity after adjusting for individual socio-demographic factors, using a ML approach. The four models fitted on our large-scale data resulted in robust evidence that demonstrates which perceived neighborhood characteristics are cross-sectionally correlated with depression severity. All ML models showed a better fit than basic regression, however, the differences were more of a statistical nature (Fig. 1).
We went a step further than previous studies [19, 20, 21] in also assessing the relative importance of individuals’ perceptions of the physical and social neighborhood with respect to depression severity. Our models consistently showed that perceived physical neighborhood environment only played a minor role in explaining depression severity (Fig. 2). In contrast, social cohesion and safety were found to be important overall. Our result that the neighborhood social environment is of greater importance than the physical one replicates a study from the UK .
In line with a systematic review , we observed a negative relation between depression and age. It seems that older aged people’s susceptibility to depression declines which could result from diminishing emotional responsiveness or psychological immunization against stressful situations . Moreover, age was found to interact strongly with other variables, primarily personal-level (e.g., employment status ) and to a minor extent with environmental ones (e.g., perceived green space) (Fig. A1), over the life span. Such a co-variation  is not surprising because, for instance, unemployment may pose a higher risk for a young adult than someone close to retirement.
Perceived physical neighborhood characteristics including green and blue space, pleasantness, and urbanicity were found to be less important. This may partly be due to the way we assessed neighborhood features; some variables (e.g., green space) also showed limited variance. To circumvent methodological issues we employed, as frequently done [22, 45], people’s neighborhood perceptions instead of geographic information system (GIS)-based measures per administrative area or buffer. Both ways cause spatial  and temporal context uncertainties (i.e., temporally ill-aligned GIS and survey data)  potentially translating into biased outcomes. Work undertaken in metropolitan Chicago found that perceived but not objectively measured neighborhood deterioration was correlated with higher depressive symptoms, which further supports our reasoning .
Some neighborhood characteristics were identified as relevant, but not all turned out to be related to depression severity (Fig. 3). In what follows the neighborhood characteristics are discussed in accordance to their descending order of importance (Fig. 2). First, our study supports previous findings suggesting that pronounced neighborhood social cohesion seems to correlate with reduced depression severity [45, 49]. It is assumed that in socially cohesive neighborhoods it is more likely that people help, support, and trust each other, and that a tightly knit social network may facilitate the spread of information among neighbors . Through such pathways living in a cohesive environment may promote mental health.
Second, neighborhood safety was confirmed in our study to be negatively associated with depression severity. Another Dutch cross-sectional study has concluded the same , but overall findings are inconclusive . Among different conceivable mechanisms, we speculate that living in an unsafe neighborhood enhances experienced stress, which in turn is a depression risk factor . Alternatively, it has been theorized that a lack of safety limits social cohesion due to mistrusting others in the neighborhood .
Third, perceived traffic appeared to be positively correlated with depression severity. While our data did not allow us to disentangle pollutants emitted from traffic, we believe that air pollution and noise are conceivable underlying pathways. This is underpinned by a meta-analysis on air pollution and risk of depression , but contradicts a European multi-cohort study . Traffic noise is regarded as a psychosocial stressor causing annoyance and negative emotions , and in a German study was significantly related to depressive symptoms [8, 19].
Fourth, we found pleasantness was negatively correlated with depression severity. This is in line with previous research concerning neighborhood quality and depression. For example, walkable neighborhoods have previously been associated with reduced depressive symptoms . It is suggested that this is due to increased opportunity for social interaction, which in turn can improve depressive symptoms. Poor maintenance of buildings and incivilities in the street, or neighborhood social disorder, has been linked to increased risk of depression . This may be the result of reduced neighborhood satisfaction , or via enhanced stress .
Fifth, we found no indication that depression severity differed between urban and rural areas. While contradicting an international meta-analyses on mood disorders and urbanization , our results confirm another Dutch study reporting an insignificant correlation . Further, in a recent analysis of eight Dutch cohort studies, inconsistent results were found for the effect of urbanization on depression severity . It is suggested this is due to the use of different research designs, measures of depression, and confounders.
Lastly, we could not confirm that blue space within people’s living environment is correlated with depression severity. This finding aligns with a series of others reporting insignificant associations on the 5% level [19, 21]. However, our findings were suggestive for beneficial mental health effects of perceived closeness to green space, though no causality can be inferred. Similar results were reported elsewhere [12, 20, 29]. The assumed mechanisms may operate through stress recovery, attention restoration, physical activity, and social interaction .
Strengths and limitations
A number of key strengths of this study need to be emphasized. Our study is innovative in the way correlations were assessed. While earlier studies were limited to linear associations without examining variable interactions and non-linearities [15, 19, 22], we put these challenges central and fitted flexible ML models in a data-driven manner. Our study also used a large nationally representative data set for the Netherlands. This produced a large sample size where our results are deemed to be robust. However, whether and how our findings can be generalized for a wider European or other cultural contexts needs further, ideally longitudinal , exploration.
Despite these strengths, several limitations are recognized. The cross-sectional nature of the data has limited capability to establish causal links. We were unable to assess whether the social causation hypothesis or the social drift hypothesis applies . While the former posits that adversity linked with low socio-economic status contribute to depression, the latter argues that depressed people experience a downward drift towards neighborhoods with lower socio-economic status [59, 60]. Our findings may also be biased because depressed people might be more likely to view their environment negatively .
Our survey benefited from the inclusion of well-tested questionnaires (e.g., PHQ-9), which facilitates comparability with other studies, but they may be subject to self-reporting bias. We cannot eliminate that the perception of depressed people is impaired . As some survey questions relate to people’s living environment, ambiguities concerning the neighborhood size and the environmental perception may arise; which potentially have attenuated the relationships. Despite the fact we adjusted for several socio-economic characteristics, another final consideration is that we cannot rule out unmeasured and residual confounding. However, our findings were robust to adjustment for many potential confounding factors but some, for example people’s physical activity levels , were not available to us on a personal level.
The results reported here are from a large nationally representative sample from the Netherlands and provide support for a relationship between perceived physical and social neighborhood characteristics and people’s severity of depression. The importance of the physical neighborhood environment is, however, limited relative to the social environment and individual attributes. We observed specifically that neighborhood social cohesion, pleasantness and safety were inversely correlated with depression severity, while distance to green space and traffic were positively correlated. No association was found for urbanicity and blue space. While confirmation through longitudinal research is required, our study suggests that modification of physical and social neighborhood characteristics could represent an effective intervention to promote mental health.
We thank the anonymous reviewers for their valuable comments on an earlier draft of this paper.
The project was funded by the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation program (Grant Agreement No. 714993). In the course of the NEEDS project, JH’s contribution was based on a research stay at Utrecht University.
Compliance with ethical standards
Conflict of interest
On behalf of all authors, the corresponding author states that there is no conflict of interest.
- 23.Fernández-Delgado M, Cernadas E, Barro S et al (2014) Do we need hundreds of classifiers to solve real world classification problems? J Mach Learn Res 15:3133–3181Google Scholar
- 25.de Groot J, Roels J, Shah S, de Witt S (2018) Stemming and Leefomgeving. Onderzoeksdocumentatie Kwaliteitsanalyse (NEEDS), Den HaagGoogle Scholar
- 29.Stigsdotter UK, Ekholm O, Schipperijn J et al (2010) Health promoting outdoor environments-Associations between green space, and health, health-related quality of life and stress based on a Danish national representative survey. Scand J Public Health 38:411–417CrossRefPubMedPubMedCentralGoogle Scholar
- 33.Hastie T, Tibshirani R, Friedman J (2017) The elements of statistical learning. Data mining, inference and prediction, 2nd edn. Springer, New YorkGoogle Scholar
- 35.Haykin S (1994) Neural networks: a comprehensive foundation. Prentice Hall PTRGoogle Scholar
- 38.R Core Team (2018) R Development Core Team. RA Lang Environ Stat Comput 55:275–286Google Scholar
- 50.Kawachi I, Berkman L (2000) Social cohesion, social capital, and health. In: Berkman LF, Kawachi I (eds) Social Epidemiology. Oxford University Press, New York, pp 174–190Google Scholar
- 59.Lund C, Stansfeld S, De Silva M et al (2014) Social determinants of mental health. In: Patel V, Minas H, Cohen A, Prince M (eds) Global mental health: principles and practice. Oxford University Press, Oxford, pp 116–136Google Scholar
Open AccessThis article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.