Introduction

External forces are rapidly shifting where people live, both by changing the physical environment and by accelerating how often people move (Dun, 2011; Hugo, 2011). For example, fires on the US West Coast and hurricanes on the East Coast may lead to increased migration to midwestern cities (Maxim & Grubert, 2020). Further, while some may leave rural areas to escape natural disasters, others have escaped urban centers to avoid the spread of the COVID19 pandemic (Ramani & Bloom, 2021). Mental health is strongly linked to social and physical environment and access to health and social services (Vlahov & Galea, 2002). In turn, each of these factors are shaped by where a person lives. To better prepare for potential adverse consequences to mental health from changes to where people live, we sought to quantify the relationship between urbanicity and mental health across US counties.

Urbanicity refers to the degree to which a location is urban. In the US each county is assigned to an urbanicity category based on population density and proximity to the largest city (Rothwell et al., n.d.). The categories range from large central metro (e.g., Bronx County, New York or Los Angeles County, California) to noncore (e.g., Addison County, Vermont). Numerous studies suggest that living in an urban setting raises the risk of mental health problems (Castillejos et al., 2018; Krabbendam, 2005; March et al., 2008; Peen et al., 2010; Vassos et al., 2016). For example, a review of studies found that living in a European city is a risk factor for mental health and substance abuse disorders (Penkalla & Kohler, 2014). However, most of these studies have focused on Western Europe, psychosis and schizophrenia, and time periods prior to early 2010. This limits their generalizability to contemporary mental health issues in the US. These issues include ‘deaths of despair’ from suicides or drug overdose devasting rural US counties (Stein et al., 2017) and trauma associated with reported violent crime endemic to urban US counties (Bell & Owens-Young, 2020). There is a critical gap in the literature that relates urbanicity to contemporary mental health in the US.

There are many potential mechanisms by which urbanicity could impact mental health. One might expect worse mental health in urban counties considering that limited access to green space (Tsai et al., 2018), concentration of populations marginalized from resources, crowded living conditions, and air pollution (Ha, 2017) are associated with negative mental health outcomes. On the other hand, urban populations are also more likely to have access to mental health care, more likely to participate in social organizations which offer psycho-social support (Yang, 2019), and more likely to have educational and financial opportunities (Ha, 2019), all of which are associated with positive mental health outcomes. A recently published paper assessing quality of life in Finland found higher rates of high quality of life in rural areas but not after controlling for perceived loneliness (Weckroth et al., 2022). Another study found that people in urban areas have higher prevalence of both depression and anxiety despite having lower prevalence of other risk factors (Zijlema et al., 2015). While the effects of urbanicity on general mental health may not be large, both urbanicity and mental health are complex phenomena which cannot be concisely distilled and lend themselves well to many various research hypotheses. Disentangling the contribution of each of these potential mechanisms has important public health implications by pointing to possible solutions (e.g., increase access) for improving mental health.

Relating urbanicity to mental health in the US, however, requires confronting several challenges. Urbanicity is a complex phenomenon, and its effects are impossible to isolate completely. There are many potential variables that confound the relationship between urbanicity and mental health. Most notably, counties that differ in urbanicity will also differ in the sociodemographic makeup of their population in terms of distributions of racial identity, age, income, and education. Even controlling for observed sociodemographic differences, there may still be unobserved confounding variables. For example, some people may choose to live in urban places and others in rural environments. These choices could be influenced by the past and present sociocultural context of each community which affects who feels welcomed into which communities. Factors such as personality and familial ties play large roles in both mental health and choice of living location (Chan, 1977). Thus, analyses and conclusions must be carefully crafted to account for the complexity of where people live and why.

In this paper, we investigate the impact of urbanicity on mental health at the county-level in the US (n = 3142 counties). Our primary outcome is a county’s average number of mentally unhealthy days reported in past 30 days. We hypothesized that the more urban counties are associated with greater average number of mentally unhealthy days. Using data from the Behavior and Risk Factor Surveillance System (BRFSS) and the US Census Bureau, aggregated by the County Health Rankings and Roadmaps (CHRR), we estimate the relationship between urbanicity and our primary outcome. Adjustments are made for sociodemographic characteristics of the county and US state using a combination of inverse probability weighting and random effects modeling. We then investigate the degree to which this relationship is mediated by characteristics of the county such as social connectedness, access to exercise, mental health providers, violent crime, housing cost, food environment, air pollution, and income inequality. Our findings have important public health implications, adding to our understanding of the growing rural–urban divide in the US and of the potential mechanisms for this divide.

Methods

Data

Data on US counties was provided by the University of Wisconsin’s CHRR. CHRR is a Robert Wood Johnson Foundation funded program that helps local and community leaders identify county-level factors that influence the health of the community (Explore Health Rankings | Rankings Data & Documentation, 2022). CHRR collects and aggregates publicly available data at the county-level. Therefore, this is an ecological study, and the unit of analysis for this paper is a county. We analyzed the 2021 CHRR dataset for all 3142 US counties for which data is available. This dataset includes information collected from 2015 to 2019 from the American Community Survey. Outcome data is available in the CHRR dataset from the 2018 BRFSS, which are small area estimates based on limited survey sampling across all 50 states. See Table 5 in the Appendix for the years and data sources for all covariates and mediators.

Variables

Exposure

The primary exposure is urbanicity. Each county in the dataset has been assigned an urbanicity category based on the 2013 National Center for Health Statistics (NCHS) Urban–Rural Classification Scheme for Counties (Rothwell et al., n.d.). The NCHS urban–rural classification scheme relies on information such as population density as well as proximity to the largest city within a metropolitan statistical area. The six categories are as follows: large central metro (n = 68), large fringe metro (n = 368), medium metro (n = 372), small metro (n = 357), micropolitan (n = 641), and noncore (n = 1335). It is worth noting that the four “Metro” categories contain 85% of the total US population. A map of each county’s urbanicity designation can be accessed at https://www.cdc.gov/nchs/data_access/urban_rural.htm.

Outcome

The primary outcome of interest is poor mental health days, an age-adjusted average number of mentally unhealthy days reported in the past 30 days. This is a self-reported variable collected by the BRFSS. The most recent available data represents 2018. We chose to use this measure of self-reported health because BRFSS is the largest continuously conducted health survey system in the world (CDC - About BRFSS, 2019), and BRFSS county-level estimates span all 3142 US counties. These estimates are well-validated and commonly used (Pierannunzi et al., 2013).

Controls

We controlled for several variables that might confound the relationship between urbanicity and mental health. Broadly, the sociodemographic makeup of a county varies with urbanicity and is expected to also influence mental health of persons living in the county. The first variable we controlled for is median household income: the income level at which half of households in the county earn more, to measure the typical income in a county. We controlled for median household income, since higher income allows county residents to enjoy greater access to mental health care, which may be positively related to mental health (Grembowski et al., 2002). For similar reasons, we also controlled for education (Chevalier & Feinstein, 2006). Thus, the second control variable was some college: the percentage of adults ages 25–44 with some post-secondary education. The third control variable was percent over 65: the percentage of the population that are over age 65, since age is associated with decreased rates of self-reported poor mental health (NIMH» Mental Illness, n.d.). Another control variable was US state. We added a control variable for state to account for potential state-level effects since our outcome variable comes from BRFSS which uses state-level sampling methods.

We also controlled for race/ethnicity since self-reported mental health differs by race/ethnicity. For example, during the pre-vaccine COVID-19 pandemic, adults identifying as Hispanic had 20% to 400% greater odds of experiencing poor mental health than adults identifying as non-Hispanic (Lee & Singh, 2021). Additionally, people who identify as Black are historically more likely to report lower levels of life satisfaction than people identifying as white (Hughes & Thomas, 1998). Therefore, we controlled for the variables Percent Black: the percentage of the population that is non-Hispanic Black or African American, and Percent Hispanic: the percentage of the population that is Hispanic. We point out that the CHRR dataset also has a variable for percentage of the population that identify as Asian and a similar variable for percent Native Hawaiian/Other Pacific Islander. However, we did not include these variables because of their limited variation across the 3142 US counties.

Potential Mediators

We also wanted to understand the mechanisms by which urbanicity impacts mental health. In other words, urbanicity may lead to changes to physical environment (e.g., access to care or food) which then leads to changes in mental health outcomes. We examined eight potential mediators. Social associations is the number of membership associations in a county per 10,000 population. Access to exercise is the percentage of the population with adequate access to locations for physical activity. Food environment index is calculated as a ratio of the percent of each county’s population experiencing limited access to healthy foods to the percent of each county’s population experiencing food insecurity. The percent of the population experiencing limited access to health foods is calculated as a function of poverty and distance to a grocery store while food insecurity is a modeled estimate from the Core Food Insecurity Model (Map the Meal Gap Data | Feeding America, n.d.). Mental health providers is the ratio of population to mental health providers. Air pollution is the average daily density of fine particulate matter in micrograms per cubic meter. Violent crime is the number of reported violent crime offenses per 100,000 population. Severe housing cost burden is the percentage of households that spend 50% or more of their income on housing. Income inequality is the ratio of household income at the 80th percentile to income at the 20th percentile. See Table 6 in the Appendix for descriptive statistics of each mediator by urbanicity category.

Primary Analyses

We estimated the average relationship between urbanicity and poor mental health days using mixed effects linear regression models. For simplicity, we built models that compare counties from one urbanicity category at a time against small metro counties. Hence, five comparisons were made: large central metro, large fringe metro, medium metro, micropolitan, and noncore vs. small metro. Each linear regression model included poor mental health days as the dependent variable and urbanicity as the independent variable. State was included as a random effect to accommodate within-state correlation and variation due to state differences in BRFSS approaches.

Models were fit with and without adjustments for the control variables. Control variables were accounted for using inverse probability weighting (IPW). IPW entails weighting each county by the multiplicative inverse of the propensity scores, i.e., the probability of belonging to the county’s urbanicity category conditional on the confounding variables (i.e., education, income, age, percent Black, and percent Hispanic). This approach was used as opposed to including control variables directly in the model to avoid issues with misspecification of their influence in the linear regression model. Propensity scores needed for IPW were calculated from a logistic regression model for each urbanicity comparison. Hence, five logistic regression models were fit. Small metro was chosen as the reference category to avoid propensity scores near 0 or 1, since small metro is one of the middle urban categories. By contrast, an urban category at one extreme (e.g., large central metro) would lead to propensities close to 0 or 1 when compared to the other extreme (e.g. noncore). Education, income, percent Black, percent Hispanic, and age are treated as independent variables in each logistic regression model. Considering that education and income have a strong relationship to mental health (Araya et al., 2003) and vary greatly across counties, an interaction term between income and education is included in the logistic regression model. In addition, natural cubic splines with three degrees of freedom each were used for education and household income. To validate this choice of model, other models were considered and compared to our model based on Akaike Information Criteria (AIC) (see Table 7 in the Appendix).

Mediation Analysis

Mediation analysis was conducted in two steps (Imai et al., 2010; VanderWeele & Vansteelandt, 2014). First, we built a linear regression model for each urbanicity comparison relating potential mediators and urbanicity to poor mental health. These models included the eight mediators as independent variables but were otherwise identical to models from our primary analysis: poor mental health days was the dependent variable, urbanicity was an independent variable, state was a random effect, and IPW was used to adjust for control variables. Second, we built a linear regression model for each urbanicity comparison and each potential mediator. In this case, the potential mediator was the outcome variable, urbanicity was the independent variable, state was a random effect, and IPW was used to adjust for control variables. We report the effect of each mediator on poor mental health days and natural indirect effects of mediation. These latter effects are recovered for each mediator as the product of the effect of urbanicity on the mediator and the effect of each mediator on mentally unhealthy days. A total natural indirect effect is then recovered by summing the natural indirect effects over each mediator. To calculate the significance of mediating effects, we bootstraped data (i.e. resample without replacement) to generate a sampling distribution and estimated statistical significance (MacKinnon, 2002) using the bias-corrected and accelerated (BCa) method available in the R boot package (v1.3–28; Ripley, 2021). The BCa method was chosen because it produces more balanced confidence interval estimates than other bootstrapping methods (Jung et al., 2019).

Results

County Characteristics by Urbanicity

County characteristics are summarized by urbanicity category in Table 1. Briefly, the more urban counties tended to be more educated and younger, and to have a higher median income and a larger proportion of Black and Hispanic residents. The proportions of Black and Hispanic residents tended to be similar across urbanicity categories, with slightly higher proportions of Hispanic residents than Black residents in micropolitan and noncore counties. Without controlling for any variables, we also found that the more urban categories tended to have better mental health in terms of average poor mental health days (see Fig. 1 in the Appendix). Residents in large central metro counties reported the lowest average poor mental health days: 4.35 days. Residents in micropolitan counties reported the highest: 4.74 days. As expected, income and education are strongly protective of mental health, with counties with higher education and income levels having lower average poor mental health days (see Figs. 2, 3 in the Appendix for plots of these relationships).

Table 1 Mean (SD) characteristics of US counties by urbanicity category
Fig. 1
figure 1

Average number of poor mental health days reported in past month per county by urbanicity category

Fig. 2
figure 2

Plot to justify nonlinear relationship between education and poor mental health days

Fig. 3
figure 3

Plot to justify nonlinear relationship between income and poor mental health days

Average Relationship to Urbanicity

Our first analysis included a random effect for within-state correlation and controls for county sociodemographic composition (i.e. income, education, race/ethnicity, and age; see Table 2). When we only included the random effect for within-state correlation, we found that small metro counties differ significantly in average poor mental health days compared to every other urbanicity category. In this case, the more urban counties had progressively fewer average poor mental health days, whereas the less urban counties had progressively more poor average mental health days. When adjusting for state and sociodemographic composition, only counties at the extreme ends of urbanicity, i.e. either large central metro or noncore, differed significantly in average poor mental health from small metro counties. Adjusted estimates indicated that large central metro counties had an average of 0.24 fewer poor mental health days than small metro counties (t = − 5.78, df = 423, p < 0.001), whereas noncore counties had an average of 0.07 more poor mental health days than small metro counties (t = 3.06, df = 1690, p = 0.002).

Table 2 Average effect of urbanicity on poor mental health days reported per month after allowing average outcomes to vary by state and adjusting for age, income, education, and race/ethnicity

Mediation

Our next analysis investigated whether the differences between large central metro or noncore counties and small metro counties could be explained by specific features of an urban or rural environment. Table 3 shows the average effect of each potential mediator on poor mental health days when all mediators are included in the model for poor mental health days. We will summarize the top 4 significant effects. The food environment index had the largest coefficient for both comparisons (i.e. large central metro vs. small metro and noncore vs. small metro), whereby a better food environment was related to better average mental health. Access to exercise had the next largest coefficient for both comparisons and was also positively related to better average mental health. Violent crime had the third largest coefficient for both comparisons and was negatively related to a county’s mental health. Finally, income inequality had the fourth largest coefficient for both comparisons and was also negatively related to a county’s mental health.

Table 3 Average effect of each potential mediator on poor mental health days when all mediators are included in the model for poor mental health days

Most of the potential mediators had a strong direct effect on poor mental health days, but they still might not mediate the relationship between urbanicity and poor mental health. Thus, our final analysis estimated natural indirect effects, i.e. the effects of changes in mediators that are related to urbanicity. Natural direct and indirect effects are summarized in Table 4. For the large central metro vs. small metro comparison, the natural indirect effect was marginally significant: 0.11 fewer poor mental health days (95% CI − 0.22 to 0.02) were attributed to changes in the potential mediators related to being a large central metro county. In other words, about 46% (0.11/0.24) of the relationship between large central metro and poor mental health was mediated by factors such as food environment, access to exercise, violent crime, and income inequality. By contrast, the relationship between noncore and poor mental health was not mediated by these factors, as the natural indirect effect for the noncore vs. small metro comparison was nearly zero: 0.005 (95% CI − 0.07 to 0.11). This could be because the average number of self-reported poor mental health days in noncore counties was only 0.07 higher than the average number of self-reported poor mental health days in small metro counties, or perhaps there were additional unmeasured mediating factors at play.

Table 4 Mediating effects (95% confidence intervals) between the relationship between urbanicity and average poor mental health days

Discussion

This paper investigates contemporary relationships between urbanicity and mental health in counties in the US. A series of regression analyses were performed on all US counties (n = 3142) using data from BRFSS and the US Census Bureau and aggregated in 2021 by CHRR. Our primary finding is that more urban counties are associated with fewer poor mental health days on average, even after allowing the average outcome to vary by state and adjusting for differences in age, income, education, and race/ethnicity. This finding is greatest in large central metro counties, which enjoy the fewest average poor mental health days, and noncore counties, which have slightly more poor mental health days on average. Fewer poor mental health days in large central metro counties was partly mediated by differences in the built-environment, with better food environments and access to exercise protecting a county from poor mental health. On the other hand, violent crime and income inequality contributed to a county’s high poor mental health days average. By contrast, more poor mental health days in noncore counties was not mediated by any of our hypothesized factors. This might be because some variables are weak proxies for social and environmental constructs.

Our findings shed light on contemporary questions about mental health in the US. Is mental health better or worse in urban areas than rural areas? There are arguments on both sides: urban areas have greater access to resources like mental health providers and social associations, but rural areas have less violent crime or income inequality and greater access to green spaces. Finding that urban counties are associated with better, not worse, mental health is contrary to what might be expected based on what we know from different countries and earlier time periods. For example, a study published in 2000 of urban–rural mental health differences in Great Britain found that individuals living in urban centers had higher rates of three indicators of poor mental health (Paykel et al., 2000), and a 2007 study of Chinese migrant workers found that workers living in urban areas had worse mental health than workers in rural areas (Li & Rose, 2017). Thus, there appear to be unique factors at play when it comes to mental health in contemporary US.

We then want to know what it is about a US urban county that is related to better average mental health, and conversely, what it is about a US rural county that is related to poorer average mental health. We investigated eight possible explanations: food environment, access to exercise, access to mental health providers, income inequality, violent crime, social associations, severe housing burden, and air pollution. Factors like income inequality (Halfon et al., 2017; Spencer et al., 2019), violent crime (Curry et al., 2008), severe housing cost burden (Nobari & Whaley, 2021), and food insecurity (Chilton et al., 2007) might contribute to traumatic experiences and psychosocial stress which are strongly implicated in mental health problems (Schore, 2001). For example, even after adjusting for sociodemographic characteristics and social support, children living in severe housing cost burdened households experienced more adverse childhood events than children from non-burdened households (Nobari & Whaley, 2021). Additionally, across the world, income inequality has been found to be associated with higher rates of intimate partner violence and relationship dissatisfaction (Spencer et al., 2019). Factors such as access to exercise (Taylor et al., 1985), mental health providers (Elkin et al., 1989), and social associations (Echeverría et al., 2008; Wang et al., 2018) can protect a person from mental health problems. For example, neighborhood social cohesion is associated with lower rates of depression and higher rates of healthy lifestyle factors (Echeverría et al., 2008). Additionally, although a causal link between exercise and mental health has not been identified, the relationship between exercise and positive mental health outcomes has been well established (De Moor et al., 2008; Taylor et al., 1985). On the other hand, unhealthy diet, which is one result of a poor food environment, is associated with mental disorders such as depression and dementia(Jacka et al., 2014), and food insufficiency has been shown to be positively related to poor self-reported physical and mental health (Siefert et al., 2001). Together, these factors were able to partly explain why large central metro counties had fewer poor mental health days on average, but not why noncore counties had more poor mental health days on average.

Understanding why urbanicity contributes to better mental health is important in guiding public policy for two reasons. First, factors like food environment or access to exercise are changeable. City planners and public infrastructure projects can target investments in food or exercise by building green spaces in a city or expanding access to food (Beyer et al., 2014; Bruening et al., 2016). Second, with human migration imminent as consequence of climate change, it will be important to inform people about potential pros and cons of moving to more urban or rural regions.

Inability to explain why rural areas are subject to worse mental health is not a new challenge. Over the past two decades, research relating suicide and rurality has determined a variety of associations. For instance, a 2006 study determined that contextual or place-based factors, such as exposure to firearms, socioeconomic decline, and lack of mental health services accessibility contributed most to high rates of suicide among male residents of rural regions (Judd et al., 2006). Additionally, between 1999 and 2015, non-Hispanic White populations living in nonurban areas experienced increased rates of premature death which were attributable to suicide, poisoning, and liver disease (Stein et al., 2017).

There are several limitations to consider. We used a combination of inverse probability weighting and random effects to account for potential confounders of the urban-mental health relationship. Controlling for confounders is necessary for uncovering the impact of urbanicity but by no means sufficient. Models may have been mis-specified or propensity scores may be imprecise leading to biased results. Thus, we caution the reader to conclude that urbanicity causes changes in mental health. To this point, our analysis may leave out residual and unmeasured confounders, such as presence of industry, the effects of migration, and individual factors such as heritability of mental health disorders, resilience, and trauma. Moreover, since this is an ecological study using county-level data, the confounding variables we adjusted for can only account for county-level differences and cannot fully control for the effects of these variables at the individual level. It is incorrect to assume that the county-level phenomena described in this paper can be applied to the individuals living in these counties. There are also limitations with how our primary outcome was collected. BRFSS uses a survey sample, and certain individuals respond at lower rates than others (Schneider et al., 2012). Additionally, BRFSS is administered by each state’s health department, which can lead to unintended differences between states. Further, though BRFSS uses rigorous sampling and modeling techniques, it yields a different sample than that collected by the US Census, from which we recovered covariates for our analysis. Despite these limitations, BRFSS provides estimates of mental health across all 3142 US counties and has been validated in at least two separate analyses which found substantial agreement between BRFSS estimates and re-tested estimates (Pierannunzi et al., 2013).

Another important limitation is that our analysis did not account for racism or discrimination due to identity, mass incarceration, the effects of redlining and other racist policies, generational wealth, and historical trauma. These issues may be necessary to fully unwrap why urban areas have fewer poor mental health days and rural areas more. We also only focused on average self-reported poor mental health days, which is missing many important aspects of an individual’s mental health such as diagnoses, hospitalizations, and suicidal thoughts and intent. It is also self-reported, which can lead to misclassification of mental health across cultural and social groups. Additionally, county-level differences in education and income may be the result of county-level differences in mental health—that is, the relationships between education, income, and mental health are potentially bi-directional. In our analyses, we treated income and education as county-level confounders on the relationship between urbanicity and mental health. Thus, we adjusted only for one-directional relationships between education, income, and mental health.

A final limitation is that our unit of analysis is a county. As such, rural counties are better represented than urban counties despite having smaller total population. Further, county-level analyses can lead to an ecological fallacy whereby urban counties might have better mental on average than rural counties, but individual people might thrive in more rural counties.

In summary, we found that more urban counties have better mental health than rural counties. Future research could prioritize access to food, exercise, and mental health services since these place-based factors are both measurable and malleable and could have important policy implications. Additionally, future analyses might include comparison across years with special consideration for how the Covid-19 pandemic has changed mental health.