The structural association between community environment and health vulnerability with the mediation role of sleep quality and social values among middle-aged and elderly adults in China: nationwide cross-sectional study Authors: Qingping Zhou, Yusupujiang Tuersun, Zhenning Liang, Xiyue Zhang, Chenxi Wang, Yao Yu, Siyuan Liu, Di Dai, Shengfan Zhan, Shuining Li, Yi Qian Published: 2025 ABSTRACT AbstractBackgroundHealth vulnerability reflects the adverse state of below-normal health of middle-aged and elderly adults in the process of population aging under the influence of internal and external risk perturbations, and is a comprehensive assessment of individual health status. However, there is a lack of clarity about whether and how the community environment influences the health vulnerability of middle-aged and older adults. This study aims to elaborate the complex pathways of sleep quality, social values, and anti-fragile capacity between community environment and health vulnerability, and to provide a scientific basis for promoting healthy aging in China.MethodsThis study was screened to finally include 8,032 middle-aged and older adults who participated in the China Family Panel Studies Database 2020 survey. While controlling for confounders we used structural equation modeling (SEM) to analyze the parallel mediating roles of sleep quality, social values, and anti-fragile capacity in community environment and health vulnerability, and subgroup analyses to explore the heterogeneity of the effects across subgroups of the population.ResultsThe composite index of health vulnerability of Chinese middle-aged and elderly adults was 0.227 (SD = 0.129). Community environment was positively correlated with sleep quality, social values, and anti-fragile capacity (p < 0.05). Community environment, sleep quality, and anti-fragile capacity were negatively correlated with health vulnerability. In addition, after adjusting for confounders, sleep quality, social values, and anti-fragile capacity were able to partially mediate the association between community environment and health vulnerability among middle-aged and olderadults, with mediating effects of 19.50%, 3.06%, and 2.20%, respectively(p < 0.05). Subgroup analyses further showed that the mediating effects of sleep quality, social values, and anti-fragile capacity on community environment and health vulnerability differed across age, gender, and place of residence subgroups.ConclusionsThis study found a complex relationship between community environment, sleep quality, social values, anti-fragile capacity, and health vulnerability in middle-aged and older adults. Various intervention paths should be taken to improve the aging-friendly level of community environments and build home-friendly retirement communities to alleviate the health vulnerability of the middle-aged and elderly groups and promote healthy aging in China.Clinical trial numberNot applicable.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12889-025-25755-w.Keywords: Community environment, Sleep quality, Social values, Health vulnerability, Anti-fragile capacity Introduction Vulnerability is considered a multidimensional construct that encompasses not only an individual’s dependence on activities of daily living, but also health and illness, attitudes, behaviors, and resource dependence on others [1]. Health vulnerability refers to the state of ill-health exhibited by an individual under the influence of external risk perturbations or changes in his or her own organism [2], and involves the sensitivity and coping capacity of physiological, psychological and social factors to health problems. As individuals age, their health becomes more fragile [3]. The middle-aged and elderly groups, in particular, are gradually characterized by chronic diseases, advanced age and incapacitation, and are faced with the reality of declining physiological functions and weakened ability to withstand external disturbances, making their health conditions more and more fragile. As one of the countries with the fastest rate of population aging, China has an arduous and burdensome task of coping with aging, so exploring the health vulnerability of middle-aged and elderly groups is of great significance in promoting the Healthy China Strategy and Positive Aging Strategy. As the basic unit of public services and urban governance in China, the community shoulders the major mission of realizing basic elderly care services for all elderly people. The community is one of the main sources of social support for middle-aged and older persons in coming to terms with the ageing process, and it also provides venues and basic guarantees for the participation of middle-aged and older persons in daily activities. Influenced by traditional Chinese culture, most older people tend to age at home and in a familiar environment. Therefore, the middle-aged and elderly population is more likely to be influenced by the characteristics of the community environment [4]. Previous studies have shown that the level of community neighborhood environment and built environment is positively associated with cognitive function in older adults [5]. In addition, a longitudinal study in China showed that middle-aged and older people living in communities with better infrastructure and more voluntary organizations had lower levels of health vulnerability [6]. Although there have been studies showing the link between health levels and lifestyle and environment in older people, they have focused mainly on community resources and lack a comprehensive assessment of health levels from a vulnerability perspective [6, 7]. The community environment encompasses a wider range of health-related social and internal supports, interactions, and resources, and in order to better improve the quality of life of older adults and prolong the healthy remainder of their lives, it is necessary to analyze in depth for the potential pathways linking the community environment to health vulnerability in the middle-aged and elderly adults. In addition, prior studies have shown that the association between community environment and health vulnerability among middle-aged and elderly adults can be explained by other variables, such as sleep quality and social capital [8], and that interventions in these variables are key to reducing health vulnerability among middle-aged and older adults. Established research suggests that being in a good neighborhood environment increases physical activity in older adults, which produces appropriate levels of fatigue to promote sleep quality [9]. Whereas sleep disorders are one of the key risk factors for health vulnerability in older adults [10], those with sleep disorders are more likely to be vulnerable [11]. Second, social values, as middle-aged and elderly adults’ perceptions and attitudes toward social things, often guide individual behavior. Unfortunately, there is not much established research on the association between social values and community environment among middle-aged and older adults, and even less on the association between the three, together with health vulnerability. It has been shown that individuals’ values vary depending on their immediate environment and that anxiety and depression are associated with the endorsement of individual values [12]. Thus, it is reasonable to hypothesize that social values influence the association between community environment and health vulnerability among middle-aged and elderly adults. In addition, the mitigation of health vulnerability among older persons is the result of a combination of factors, including social policy interventions and the shaping of anti-fragile capacity, which refers to the ability of older persons to withstand risky shocks, and which is most concretely embodied in social capital [13]. Middle-aged and older adults are exposed to community environments for longer periods of time than young people [14], and social networks and social support resources tend to diminish with age [15], which in turn makes them less resilient to risks. Previous studies have shown that social capital not only directly influences older adults’ self-rated health [16], but also indirectly influences the association between environment and depressive symptoms among Chinese older adults [15]. However, few studies have focused on the potential pathways of community environment on health vulnerability among Chinese middle-aged and elderly adults, especially the intermediary role of social values and anti-fragile capacity, and most of the studies have focused on one dimension of health or only stayed at the correlation analysis, which lacked a comprehensive assessment of health level. Therefore, this study aimed to explore the associations between community environment, sleep quality, social values, anti-fragile capacity and health vulnerability among middle-aged and older Chinese adults, and to further analyze the potential pathways of association in order to provide a reference basis for promoting healthy aging in China. On this basis, we formulate the following hypotheses and construct a parallel mediation model hypothesis diagram, and paths a1, a2, and a3 represent the effects of the community environment on the three mediators (sleep quality, social values, and anti-fragile capacity, respectively); Paths b1, b2, and b3 represent the effects of the three mediators on health vulnerability (respectively); Path c’ represents the direct effect of the community environment on health vulnerability after accounting for the mediators, as detailed in Fig. 1: (H1) Community environments can directly affect the health vulnerability of middle-aged and elderly adults in China; (H2) Community environment affects health vulnerability in middle-aged and elderly adults through the parallel mediation of sleep quality, social values, and anti-fragile capacity. Parallel intermediary model assumption diagram Methods Study population The data for this study were obtained from the China Family Panel Studies database (online access data: https://www.isss.pku.edu.cn/cfps/), the CFPS study design and survey methodology have been described in the relevant literature [17]. CFPS is a national longitudinal survey conducted since 2010, covering 25 provinces (cities) in China, collecting data from three dimensions: individual, household and community, using multistage probability proportional to size sampling with implicit stratification, and employing long questionnaires, short questionnaires, proxy questionnaires and telephone interviews, aiming to reflect changes in China’s social, economic, demographic, health, education and other aspects of development [18]. Therefore, the CFPS database effectively reflects the overall situation of China’s middle-aged and elderly population. Furthermore, its questionnaire survey covering three dimensions: individual, household, and community—provides a high-quality data foundation for this study. Secondly, CFPS was approved by the Biomedical Ethics Committee of Peking University (Approval No. IRB00001052-14010), and all participants signed a written informed consent form. Based on the World Health Organization’s criteria for age, we defined individuals aged ≥ 45 years as middle-aged or older adults. This study used data from the 2020 CFPS to process the raw data, screened 14,204 samples aged ≥ 45 years, and excluded those who had missing values for variables or answered “not sure”, so that 8,032 samples were included in the final study, and the flowchart of the screening process of the study subjects is shown in Fig. 2. Flow chart of study participants Research variables Definition of community environment Section Y of the CFPS 2020 household economy questionnaire investigated study participants’ assessment of the community environment, reflecting the level of the community environment through the individual’s subjective perception of the environment. This refers to a comprehensive perception encompassing both the objective material conditions and the subjective social atmosphere of the community in which they reside. It should be specifically noted that the concept of community in this study follows the definition established by the CFPS, referring to China’s grassroots administrative units. Specifically, this includes the jurisdictions of community residents’ committees in urban areas and the jurisdictions of villagers’ committees in rural areas. In the questionnaire from the state of public facilities (education, health care, transportation, etc.), the surrounding environment (noise pollution, garbage dumping, etc.), the surrounding security conditions, community neighborhood, neighbors to help, the feelings of the community to assess the level of the community environment in six dimensions, in accordance with the five-point assignment method based on the extent of the answers were assigned 1 to 5 points, the six dimensions of the score will be added up, the higher the score, the better the community environment, which can be found on Table 1 of the Supplementary Material. If asked “How is the security around your neighborhood?” The respondents were asked to choose one of five levels of security: “very good”= 5, “good”= 4, “average”= 3, “poor”= 2, “very poor”= 1. The Cronbach’s alpha coefficient for the sample of this study was 0.997 and the KMO value was 0.950, which gives good reliability and validity. Table 1Basic characteristics of the study population (n = 8032)VariableCategoriesMean ± SD/Cases(%)Age58.621 ± 9.313GenderMale4176(51.992)Female3856(48.008)Place of residenceUrban3813(47.473)Rural4219(52.527)EducationIlliterate/semi-literate2286(28.461)Primary2045(25.461)Junior high school2281(28.399)High school/Secondary vocational school/Technical school/Vocational high school1020(12.699)Junior college252(3.137)Undergraduate degree and higher125(1.556)No formal education23(0.286)MarriageUnmarried76(0.946)Married (with a spouse)7149(89.006)Cohabiting24(0.299)Divorced174(2.166)Widowed609(7.582)EmployUnemployed59(0.735)Employed5778(71.937)Out of the labor force2195(27.328)Annual household income per capita≤ 10,0002249(28.000)10,001 ~ 20,0002317(28.847)20,001 ~ 30,0001226(15.264)≥ 30,0002240(27.888)Mobile device useNo4772(59.412)Yes3260(40.588)Internet accessNo7548(93.974)Yes484(6.026)Lunchtime napNo2740(34.114)Yes5292(65.886)Regular physical activityNo2496(31.076)Yes5536(68.924)Community Environment23.850 ± 3.603Sleep quality2.143 ± 0.971Social values26.012 ± 2.777Anti-fragile capacity0.601 ± 0.158 Basic characteristics of the study population (n = 8032) Assessment of health vulnerability In order to comprehensively assess the health vulnerability of middle-aged and elderly people in China, this study refers to the existing literature and the international common index assignment method [2, 19], and uses the 2020 CFPS survey data to construct a comprehensive index system of health vulnerability of middle-aged and elderly adults in China in terms of physical health vulnerability and mental health vulnerability, and Cronbach’s alpha coefficients of the samples of the study is 0.797. Physiological health vulnerability is measured by two secondary indicators: physical health and activities of daily living (ADLs), with physical health comprising five tertiary indicators: self-assessed health level, BMI, health changes, indisposition, and chronic diseases. Activities of Daily Living (ADLs) includes seven level three indicators: independent outdoor activities, eating independently, independent kitchen activities, independent public transportation, independent shopping, independent cleaning and independent laundry. Mental health vulnerability contains three secondary indicators of depressive symptoms, subjective well-being and cognitive ability, of which subjective well-being is reflected by individual self-assessment of subjective well-being and cognitive ability is reflected by memory conditions. Depressive symptoms were measured in the 2020 CFPS survey using the Center for Streamlining Depression Scale short form (CES-D8), which assigns scores based on the frequency of occurrence of specific moods, “Hardly ever (< 1 day)”= 0, “Some of the time (1–2 days)”= 1, “Often (3–4 days)”= 2, “Most of the time (5–7 days)”= 3, which contains 2 positive and 6 negative indicators, with the positive indicators reverse scored and scores ranging from 0 to 24 [20], with higher scores indicating that depressive symptoms are more evident, with scores ≥ 9 indicating the presence of depressive symptoms [21], and Cronbach’s alpha coefficient is 0.815 [22]. In this study, in order to quantitatively assess the health vulnerability of Chinese middle-aged and elderly adults, with reference to the established literature [23], each metric was assigned a value that was dichotomized or mapped into the 0–1 interval, using the scores of the indicators of the different dimensions summed up and divided by the theoretical maximum score, e.g., the value of physiological health vulnerability was calculated as the score of the 12 tertiary indicators summed up and divided by 12. The health vulnerability composite index is a continuous variable that ranges from 0 to 1, with higher scores indicating greater health vulnerability, the assignment of specific health vulnerability composite index metrics is detailed in Table 2 of the Supplementary Material. Table 2Characterizing the health vulnerability of middle-aged and elderly adults in ChinaVariablesHealth vulnerabilityPhysiological health vulnerabilityMental health vulnerabilityComposite indexPhysical healthADLsFull sample0.227 ± 0.1290.196 ± 0.1350.407 ± 0.2260.045 ± 0.1400.353 ± 0.232Age 45 ~ 600.211 ± 0.1130.175 ± 0.1140.385 ± 0.2180.025 ± 0.0970.352 ± 0.233 ≥ 600.251 ± 0.1460.225 ± 0.1560.439 ± 0.2330.073 ± 0.1810.354 ± 0.229p value<0.001<0.001<0.001<0.0010.659Gender Male0.211 ± 0.1210.182 ± 0.1290.382 ± 0.2150.038 ± 0.1360.328 ± 0.221 Female0.245 ± 0.1360.211 ± 0.1410.435 ± 0.2350.052 ± 0.1440.380 ± 0.239p value<0.001<0.001<0.001<0.001<0.001Place of residence Urban0.214 ± 0.1190.187 ± 0.1250.402 ± 0.2200.034 ± 0.1250.322 ± 0.220 Rural0.239 ± 0.1370.204 ± 0.1430.412 ± 0.2310.055 ± 0.1520.381 ± 0.238p value<0.001<0.0010.033<0.001<0.001The urban-rural classification is based on the official categorization provided by the National Bureau of Statistics of ChinaADLs Activities of Daily Living Characterizing the health vulnerability of middle-aged and elderly adults in China The urban-rural classification is based on the official categorization provided by the National Bureau of Statistics of China ADLs Activities of Daily Living Assessment of sleep quality In this study, we selected individual sleep perception as a measure of sleep quality with reference to the established literature [24], and sleep perception is an important subjective reference for reflecting individual sleep quality [25], and this subjective evaluation has become the primary basis for the diagnosis and efficacy assessment of sleep disorders. We screened the question “I don’t sleep well” from the CFPS questionnaire and assigned a score based on the responses, “Almost never (< 1 day)” = 3, “Some of the time (1–2 days)” = 2, “Often (3–4 days)” = 1, “Most of the time (5–7 days)” = 0, with higher scores indicating better sleep quality. Definition of social values Social values represent an individual’s understanding and evaluation of the meaning inherent in external social phenomena or entities, reflecting their core perspectives and criteria for assessing how society functions and resources should be distributed. Section M of the CFPS Database 2020 Individual Self-Answer Questionnaire surveyed the study participants on their views on social justice, wealth, work, competence, and economic development, and consisted of eight entries, with four positive and four negative indicators, which were scored according to the level of response, with “Strongly Disagree” = 1, “Disagree” = 2, “Neither Agree nor Disagree” = 3, “Agree” = 4, ”Strongly agree” = 5, negative indicators are reverse scored, ranging from 8 to 40, with higher scores indicating more positive social values, specific entries are detailed in Table 3 of the supplementary material. The Cronbach’s alpha coefficient for the sample of this study was 0.995 and the KMO value was 0.950, which gives good reliability and validity. Table 3Correlation analysis of community environment, sleep quality, social values, anti-fragile capacity and health vulnerability of middle-aged and elderly adultsVariablesCESQSVHVPHVMHVAnti-fragile capacityCE1.000SQ0.096**1.000SV0.074**0.064**1.000HV−0.140**−0.338**−0.115**1.000PHV−0.199**−0.393**−0.167**0.599**1.000MHV−0.082**−0.236**−0.067**0.940**0.289**1.000Anti-fragile capacity0.074**0.035**0.055**−0.061**−0.165**−0.0021.000CE Community Environment, HV Health Vulnerability, SQ Sleep Quality, SV Social values, PHV Physiological Health Vulnerability, MHV Mental Health Vulnerability**P<0.01 Correlation analysis of community environment, sleep quality, social values, anti-fragile capacity and health vulnerability of middle-aged and elderly adults CE Community Environment, HV Health Vulnerability, SQ Sleep Quality, SV Social values, PHV Physiological Health Vulnerability, MHV Mental Health Vulnerability **P<0.01 Assessment of Anti-fragile capacity Anti-fragile capacity refers to the ability of middle-aged and older adults to withstand risky shocks. In this study, in order to assess the anti-fragile capacity of middle-aged and elderly adults in China, we constructed a system of anti-fragile capacity indicators based on the vulnerability framework in terms of two dimensions, namely, risk resistance and social service system [26], in which risk resistance is filtered out from the CFPS database by three indicators: place of residence, housing ownership, and marriage. The social services system screens for three indicators of participation in retirement pensions, participation in pension insurance and participation in medical insurance. Similarly, each metric is dichotomized or mapped into the 0 ~ 1 range, calculated as in the health vulnerability composite index, with values ranging from 0 to 1, with higher scores indicating better anti-fragile capacity. the assignment of specific anti-fragile capacity metrics is detailed in Table 4 of the Supplementary Material. Table 4Path coefficients for structural equation modeling of community environment, sleep quality, social values, and health vulnerabilityPathwaysModel1Model2β95%CIp valueβ95%CIp valueCE→SQ0.0260.020 ~ 0.032<0.0010.0250.019 ~ 0.031<0.001SQ→HV−0.040−0.043~−0.037<0.001−0.039−0.041~−0.036<0.001CE→HV−0.004−0.005~−0.003<0.001−0.004−0.004~−0.003<0.001CE→SV0.0580.041 ~ 0.075<0.0010.0510.033 ~ 0.068<0.001SV→HV−0.004−0.005~−0.003<0.001−0.003−0.004~−0.002<0.001CE→ Anti-fragile capacity0.0030.002 ~ 0.003<0.0010.0020.001 ~ 0.002<0.001Anti-fragile capacity → HV−0.090−0.108~−0.072<0.001−0.055−0.074~−0.035<0.001β beta coefficient, CI confidence interval, CE Community Environment, HV Health Vulnerability, SQ Sleep Quality, SV Social valuesModel1 was adjusted for age, genderModel2 was adjusted for age, gender, education, employ, regular physical activity, lunchtime nap, annual household income per capita, mobile device use, internet access Path coefficients for structural equation modeling of community environment, sleep quality, social values, and health vulnerability β beta coefficient, CI confidence interval, CE Community Environment, HV Health Vulnerability, SQ Sleep Quality, SV Social values Model1 was adjusted for age, gender Model2 was adjusted for age, gender, education, employ, regular physical activity, lunchtime nap, annual household income per capita, mobile device use, internet access Covariates In this study, control variables were determined based on previous studies and general knowledge, mainly considering some basic demographic characteristics and lifestyle variables. Personal characteristic variables, excluding place of residence which was not included as a control variable, primarily encompass age, gender, employment, education, annual household income per capita, and lifestyle variables such as lunchtime nap, regular physical activity, mobile device use and Internet access. The CFPS divides educational background into nine categories, which we adjusted to seven categories: illiterate/semi-literate, elementary school, junior high school, high school/secondary school/technical school/vocational high school, junior college, bachelor’s degree and above, and no schooling, and divides per capita annual household income into four categories of ≤ 10,000, 10,001–20,000, 20,001–30,000, and ≥ 30,000, according to specific response values. In addition, the frequency of exercise was used to determine whether or not the study participants were physically active, with the response of never/less than once a month defined as “no” and vice versa as “yes”. The specific values of the covariates are detailed in Table 1. Statistical analysis Descriptive analysis of sociodemographic characteristics, lifestyle variables, sleep quality, community environment, social values, anti-fragile capacity and a composite index of health vulnerability of the study population, using frequencies (percentages) or means ± standard deviations. We used one-way ANOVA to analyze age, gender, and urban-rural differences in the health vulnerability of middle-aged and elderly adults in China, and Pearson’s correlation test for continuous variables to analyze the associations among variables. To test the hypothesis that sleep quality, social values, and anti-fragile capacity mediate the relationship between community environment and health vulnerability, we used R software to construct structural equation models for parallel mediation analyses and controlled for covariates, and reported the path coefficients of the models unadjusted and adjusted for confounders. In addition, to validate the stability of the model, we used IBM SPSS Amos24.0 to construct the latent variable health vulnerability composite index and anti-fragile capacity to validate the mediating associations of sleep quality, social values, and anti-fragile capacity in the relationship between community environment and health vulnerability. Finally, to better elucidate the relationship between community environment and health vulnerability among middle-aged and elderly adults in China, this study conducted subgroup analyses based on characteristics such as age, gender, and place of residence. Place of residence was categorized according to the administrative codes for urban/rural areas provided by the National Bureau of Statistics of China: respondents residing within the jurisdiction of urban neighborhood committees were classified as urban samples, while those residing within the jurisdiction of village committees were classified as rural samples. All analyses were statistically analyzed using R4.3.2 (https://www.r-project.org/), IBM SPSS 27.0, and IBM SPSS Amos 24.0 (https://www.ibm.com/spss) and were considered statistically significant with a two-sided test of p < 0.05. The design and analysis of this study was not preregistered. Results Participant characteristics Of the 8032 study participants included, the mean age was 58.621 years (SD = 9.313), the male to female ratio was close to 1:1, and the urban to rural ratio was close to 1:1. In terms of educational attainment, more than 80% of middle-aged and elderly adults were in junior high school or below. The majority of middle-aged and elderly adults are married (with spouses), more than 70% of middle-aged and elderly adults are working, and the ratio of annual household income per capita by category is close to 1:2:2:2. At the level of lifestyle variables, the ratio of whether or not to access the Internet on a mobile device was close to 1:1.5, while the majority of middle-aged and elderly adults had not used a computer to access the Internet, and the ratio of whether or not to take a lunch break and whether or not to engage in regular physical activity was close to 2:1. The mean rating of community environment for all included Chinese middle-aged and elderly adults was 23.850 (SD = 3.603), the mean rating of sleep quality was 2.143 (SD = 0.971), the mean rating of social values was 26.012 (SD = 2.777), and the mean rating of anti-fragile ability was 0.601 (SD = 0.158), as detailed in Table 1. Characterizing the health vulnerability of middle-aged and elderly adults in China According to the results of the health vulnerability measure for middle-aged and elderly adults in China in Table 2, the health vulnerability for the included middle-aged and elderly adults was 0.227 (SD = 0.129). In terms of disaggregation, the mental health vulnerability was 0.353 (SD = 0.232), the physical health vulnerability was 0.196 (SD = 0.135), of which the physical health vulnerability was 0.407 (SD = 0.226), and the activities of daily living (ADLs) vulnerability was 0.045 (SD = 0.140). The results of differences in health vulnerability of Chinese middle-aged and elderly adults with different characteristics showed that the health vulnerability composite index and physical health vulnerability values were statistically different between 45 and 60 years old and ≥ 60 years old (p < 0.05), in which the health vulnerability composite index and all dimensions of the ≥ 60 years old sample were higher than those of the 45–60 years old sample, but the mental health vulnerability values were not statistically different between the age characteristics (p > 0.05). In terms of gender characteristics, the composite health vulnerability index, physical health vulnerability value and mental health vulnerability value of the female sample were higher than those of the male, and the difference was statistically significant (p < 0.05). In terms of residence, the samples living in rural areas had higher health vulnerability composite index, physical health vulnerability value and mental health vulnerability value than those living in urban areas, and the difference was statistically significant (p < 0.05), and the specific metric levels are detailed in Table 2. Correlation analysis of community environment, sleep quality, social values, and anti-fragile capacity and health vulnerability among middle-aged and elderly adults in China This study conducted multicollinearity diagnostics on the variables. The results revealed that the variance inflation factor (VIF) for each variable was less than 3, indicating no multicollinearity issues among the variables. Pearson’s correlation test showed that community environment was positively correlated with sleep quality, social values, and anti-fragile ability (p < 0.05), and negatively correlated with the health vulnerability, physical health vulnerability, and mental health vulnerability (p < 0.05). Sleep quality was positively correlated with social values and anti-fragile capacity (p < 0.05) and negatively correlated with the health vulnerability, physical health vulnerability and mental health vulnerability (p < 0.05). Social values were positively correlated with anti-fragile capacity (p < 0.05) and negatively correlated with the health vulnerability, physical health vulnerability and mental health vulnerability (p < 0.05). Anti-fragile capacity was negatively correlated with the health vulnerability and physiological health vulnerability (p < 0.05), but not statistically significantly correlated with physiological health vulnerability (p > 0.05), as shown in Table 3. Relationship between community environment, sleep quality, social values, and anti-fragile capacity and health vulnerability among Chinese middle-aged and elderly adults The results of path coefficient analysis showed that after adjusting for different confounders, community environment, sleep quality, social values and anti-fragile capacity can negatively affect the health vulnerability of middle-aged and elderly adults (β = −0.004, −0.039, −0.003, −0.055, p < 0.001), and community environment can positively affect the sleep quality, social values and anti-fragile capacity of middle-aged and elderly adults (β = 0.025, 0.051, 0.002, p < 0.001), and the comparison of the before and after coefficients and the final parallel mediation model plots are detailed in Table 4; Fig. 3,and the coefficient of determination of the model is 0.135. In addition, we also analyzed the path coefficients of community environment, sleep quality, social values, and anti-fragile capacity with Physiological health vulnerability and mental health vulnerability, respectively, and the associations between the variables still held, and these results are detailed in Tables 5 and 6 of the Supplementary Material. Parallel mediation effects model (Notes: **p<0.05, R2 = 0.135) Table 5Parallel mediated effects test bootstrap analysisVariableEffectEstimate95%CIp value|ai*bi/c|HVTotal−0.005−0.006~−0.004<0.001Direct−0.004−0.004~−0.003<0.001IndirectCE→SQ→HV−0.001−0.001~−0.001<0.00119.50CE→SV→HV−0.000−0.000~−0.000<0.0013.06CE→ Anti-fragile capacity→ HV−0.000−0.000~−0.0000.0022.20PHVTotal−0.003−0.004~−0.002<0.001Direct−0.002−0.003~−0.001<0.001IndirectCE→SQ→PHV−0.001−0.001~−0.0010.00522.50CE→SV→PHV−0.000−0.000~−0.0000.0113.40CE→ Anti-fragile capacity→ PHV−0.000−0.000~−0.0000.0022.53MHVTotal−0.012−0.013~−0.010<0.001Direct−0.009−0.010~−0.008<0.001IndirectCE→SQ→MHV−0.002−0.003~−0.002<0.00117.29CE→SV→MHV−0.000−0.001~−0.000<0.0013.83CE→Anti-fragile capacity→MHV−0.000−0.000~−0.0000.0012.05CI Confidence interval; |ai*bi/c|, proportion of relative meditation effect, CE Community Environment, HV Health Vulnerability, SQ Sleep Quality, SV Social values, PHV Physiological Health Vulnerability, MHV Mental Health Vulnerability Parallel mediated effects test bootstrap analysis CI Confidence interval; |ai*bi/c|, proportion of relative meditation effect, CE Community Environment, HV Health Vulnerability, SQ Sleep Quality, SV Social values, PHV Physiological Health Vulnerability, MHV Mental Health Vulnerability Table 6Subgroup analysis of mediation models for HV associated with CE mediated by sleep quality and social valuesTotal indirecteffectInde1Inde2Inde3DirecteffectTotaleffectIndirect effect/Total effect(%)Age 45 ~ 60−0.001**−0.001**−0.000**−0.000**−0.004**−0.005**24.64 ≥ 60−0.001**−0.001**−0.000*−0.000−0.004**−0.005**21.17Gender Female−0.001**−0.001**−0.000−0.000*−0.004**−0.005**23.60 Male−0.001**−0.001**−0.000**−0.000*−0.004**−0.005**21.12Place of residence Urban−0.001**−0.001**−0.000**−0.000*−0.003**−0.004**16.96 Rural−0.001**−0.001**−0.000**−0.000−0.004**−0.006**24.37Bootstrap Mediation test is adjusted for age, gender, education, employ, regular physical activity, lunchtime nap, annual household income per capita, mobile device use, internet accessInde1, Indirect effect1, CE→SQ→HV; Inde2, Indirect effect2, CE→SV→HV; Inde3, Indirect effect3, CE→ Anti-fragile capacity→ HVCE Community environment, SQ Sleep quality, SV Social values, HV Health vulnerability*P<0.05,**P<0.01 Subgroup analysis of mediation models for HV associated with CE mediated by sleep quality and social values Bootstrap Mediation test is adjusted for age, gender, education, employ, regular physical activity, lunchtime nap, annual household income per capita, mobile device use, internet access Inde1, Indirect effect1, CE→SQ→HV; Inde2, Indirect effect2, CE→SV→HV; Inde3, Indirect effect3, CE→ Anti-fragile capacity→ HV CE Community environment, SQ Sleep quality, SV Social values, HV Health vulnerability *P<0.05,**P<0.01 Parallel mediating effects of sleep quality, social values and anti-fragile capacity The results of the mediation effect test showed that, after adjusting for confounders, community environment could negatively affect health vulnerability of Chinese middle-aged and elderly adults both directly and partially through the mediation of sleep quality, social values, and anti-fragile capacity, with a direct effect value of −0.004 (95% CI:−0.004~−0.003), and a total indirect effect value of −0.001, in which the mediation effect of sleep quality (19.50%) was much higher than the mediation effect of social values (3.06%) and anti-fragile capacity (2.20%). (19.50%) accounted for a much higher proportion of the mediating effect than that of social values (3.06%) and anti-fragile capacity (2.20%). In addition, we similarly analyzed the mediating roles of sleep quality, social values, and anti-fragile capacity on the associations between community environment and physical health vulnerability and mental health vulnerability, and found that some of the mediating roles and the order of magnitude of the mediating effects accounted for the same hold true, as detailed in Table 5. To test the robustness of the model, we also used AMOS to construct the latent variables of anti-fragile capacity and health vulnerability, and the corrected model was well fitted, and the fit indices all met the fit requirements (GFI = 0.904, RMSEA = 0.066, NFI = 0.714, AGFI = 0.883), which also indicated that the model of parallel mediating roles was valid, and the coefficients of the standardized paths are shown in detail in Fig. 4. AMOS structural equation modeling diagram Subgroup analysis The results of subgroup analysis showed that the parallel mediating effects of sleep quality, social values and anti-fragile capacity remained significant (p < 0.05) in the 45–60 year old, male and urban populations, with total mediating effects accounting for 24.64%, 21.12% and 16.96%, respectively. However, the mediating role of anti-fragile capacity in the association between community context and health vulnerability was not significant for those ≥ 60 years of age, and those with rural residence (p = 0.227, 0.080). In addition, for the female middle-aged and elderly adults, the mediating role of social values in the association between community environment and health vulnerability was not significant (p = 0.079). It is worth noting that sleep quality partially mediated the association between community environment and health vulnerability across all subgroups of the population, the results of the subgroup analysis are detailed in Table 6. Discussion In this study, we constructed a composite index of health vulnerability containing 15 items with reference to established studies [23]. The Health Vulnerability Composite Index is a comprehensive assessment of an individual’s health status, which provides an overall picture of the health of middle-aged and elderly adults. To our knowledge, this is the first study to assess the impact of community environment on health vulnerability among middle-aged and elderly adults. We used structural equation modeling to explore the associations between community environment, sleep quality, social values and health vulnerability of middle-aged and elderly adults, and introduced anti-fragile capacity to construct a parallel mediation model of sleep quality, social values and anti-fragile capacity. The results showed that community environment could both directly and negatively affect health vulnerability of Chinese middle-aged and elderly adults, and also partially mediate health vulnerability in parallel through sleep quality, social values and anti-fragile capacity, with a total mediating effect of 24.76%. Moreover, when decomposed, this association existed equally in physical health vulnerability and mental health vulnerability. In addition, subgroup analyses revealed heterogeneity in the mediating effects across subgroups. Health vulnerability in middle-aged and elderly adults reflects an adverse state where their health falls below normal levels due to internal and external risk disturbances encountered during the aging process. It is an adjusted metric that aggregates “health deficits” in middle-aged and elderly adults. The health vulnerability of middle-aged and elderly adults included in this study was 0.227 (SD = 0.129). In terms of decomposition, the mental health vulnerability was 0.353 (SD = 0.232) and the physiological health vulnerability was 0.196 (SD = 0.135). Generally, health vulnerability ≥ 0.25 is considered to indicate a certain level of vulnerability in individuals [2]. In our study, the vulnerability rate among middle-aged and elderly adults was 37.413%, which is similar to previous research findings on frailty in this population [27]. In addition, we found that the health vulnerability and physiological health vulnerability were statistically different between ages 45–60 and ≥ 60, with the health vulnerability, physiological health vulnerability, and each of its dimensions being higher in the ≥ 60 sample than in the 45–60 sample. This may be due to the fact that with age, the physiological functions of various organs of the human body decline, and middle-aged and elderly adults are more prone to chronic diseases. Compared to middle-aged people, the deterioration of the body functions of those over 60 years of age is more serious, and their physiological health will be worse [28]. Interestingly, we found that mental health vulnerability was not statistically different across age-specific characteristics, suggesting that intervening at an early age to target mental health risk factors may be an effective way to mitigate health vulnerability [29], and that mental health should be prioritized from the time an individual enters middle age. In terms of gender characteristics, females have a higher health vulnerability, physical health vulnerability and mental health vulnerability than males, and the results are consistent with the findings of a systematic evaluation and meta-analysis that included 240 studies from 62 countries and territories [30]. This may be because on the one hand there is a difference in the prevalence of debility between males and females, with females tending to experience more debilitating symptoms than males [31], and on the other hand it is the fact that females are more susceptible to emotional influences in their daily lives [32], and are at a greater risk of developing mental health vulnerabilities. In terms of place of residence, the rural population has higher health vulnerability, physiological health vulnerability and mental health vulnerability than those living in urban areas. This may be influenced by the developmental differences between urban and rural areas in China, where social vulnerability is more prevalent in rural areas than in urban areas [33]. Middle-aged and elderly adults living in rural areas have lower levels of education, receive less emotional and material support, are less satisfied with their lives, experience more cognitive decline and have poorer family functioning [34–36]. This study found that community environment can directly and negatively influence health vulnerability and positively influence sleep quality, social values and anti-fragile capacity in middle-aged and elderly adults. As the fundamental unit of urban public services and governance, the community often serves as the primary activity venue and living space for older adults, especially given that most elderly people in China currently prefer home-based care. Therefore, the community environment plays a significant role in influencing the health status of elderly individuals. Individuals cannot exist independently of their surrounding environment. Previous studies have shown that community environments influence the lifestyle and behaviors of elderly individuals [37] and are intricately linked to depressive symptoms among residents [38]. Unhealthy environments can lead to a rapid decline in both physical and mental health and may even exacerbate the disease burden among middle-aged and elderly adults [39, 40]. Moreover, poor environments can lead to progressive cognitive decline in middle-aged and elderly adults [41], severely impacting their overall health levels. Second, unfavorable community environments can lead to severe sleep deprivation, insomnia, and circadian rhythm disruption [42], affecting the quality of individual’s sleep. As a socio-cultural factor, social values reflect individuals’ perspectives and attitudes toward social matters. A harmonious, inclusive, and positive community environment can foster a sense of social participation and belonging among middle-aged and elderly adults [43], thereby positively influencing their social values. Thus, the environment surrounding middle-aged and elderly adults can comprehensively impact their health vulnerability in multiple ways. Health vulnerability interventions based on community environments hold substantial potential, and promoting healthy aging by improving community environments is both effective and feasible. In addition, previous studies related to the health vulnerability of middle-aged and elderly adults have focused more on the analysis of risk factors [44, 45], such as gender, age, BMI, education level and other demographic or sociological characteristics, and have lacked deeper correlation studies. In our study, we included three mediators, namely, sleep quality, social values and anti-fragile capacity, and constructed a parallel mediation model to confirm that the community environment acts on the health vulnerability of middle-aged and elderly adults through multidimensional factors, i.e., the community environment not only affects the health vulnerability of middle-aged and elderly adults directly, but also indirectly through sleep quality, social values and anti-fragile capacity. Previous studies have shown that good sleep quality is a recognized predictor of health [46]. Within the community environment, a supportive sleep environment and social support can improve sleep quality [47], enhance immune function, promote emotional stability and psychological resilience, and thereby reduce individual health vulnerability. Secondly, social values among middle-aged and elderly adults shape behavioral norms and moral guidelines. These are formed through long-term interactions within their living spaces, creating shared understandings and standards that influence their health perceptions and behavior choices [48]. A positive community environment can encourage middle-aged and elderly adults to develop constructive social values and healthy lifestyles, proactively maintain health habits, and increase social support [49]. For example, by encouraging participation in community activities, such an environment can enhance their sense of social involvement and belonging. This, in turn, helps mitigate health risks associated with psychological issues and chronic diseases, thereby reducing health vulnerability. Anti-fragile capacity is objectively reflected in the richness and sustainability of an individual’s livelihood capital [26]. Socioeconomic disparities among middle-aged and elderly individuals directly lead to health inequalities [6]. Existing research has shown that favorable neighborhood material and social resources can help individuals better cope with external changes and meet their needs within their unique environments to maintain health [50]. Finally, subgroup analysis further indicates that the impacts of sleep quality, social values, and anti-fragile capacity on the relationship between community environment and health vulnerability among middle-aged and elderly adults in China exhibit complex associations across different subpopulations. Sleep quality serves as a partial mediator in the relationship between community environment and health vulnerability in all three subgroups of elderly individuals. Additionally, social values partially mediate the association between community environment and health vulnerability among older adults in both the age and place of residence subgroups. The partial mediating role of anti-fragile capacity is observed in the gender subgroup. Interestingly, we found that the partial mediating role of social values does not hold for female middle-aged and elderly adults, while the mediating effect of anti-fragile capacity is not observed in populations aged ≥ 60 years and those living in rural areas. In terms of age and residence subgroups, anti-fragile capacity cannot partially mediate the relationship between community environment and health vulnerability among middle-aged and elderly adults who are either ≥ 60 years old or reside in rural areas. The reasons for this may be largely attributed to the extensive influence of China’s “urban-rural dual system,” which creates significant disparities in welfare systems between rural and urban areas (i.e., rural elderly individuals often lack pensions and accessible medical services) [51]. As age increases and socioeconomic resources are limited, elderly individuals are frequently at a disadvantage [52], resulting in a weaker capacity to withstand health risks. In terms of the gender subgroup, within the context of traditional Chinese culture, men typically bear greater social responsibilities and are more influenced by social role identity and values, maintaining higher levels of social engagement and identity in old age [53]. In contrast, middle-aged and elderly females rely more on family support and emotional connections, tending towards family-centered lives [54]. This suggests that personalized health management plans for middle-aged and elderly adults should fully consider gender differences, with special attention to family support and the direct provision of health services for middle-aged and elderly females. Study strengths and limitations To our knowledge, this study is the first to use China Family Panel Studies (CFPS) data to analyze the potential pathways through which community environments impact health vulnerability in middle-aged and elderly adults, incorporating a large, nationally representative sample. Additionally, health vulnerability provides a comprehensive assessment of health status in middle-aged and elderly adults, offering a more nuanced reflection of their health conditions. We also introduced social values as a mediating variable and analyzed associations across different population subgroups, which contributes to a better understanding of the relationship between community environment and health, thereby promoting healthy aging. However, our study has some limitations. First, the cross-sectional design calls for future prospective studies to clarify the causal relationship between community environment and health vulnerability, and all variables are based on retrospective self-reported data, which may introduce some recall bias. Nonetheless, as CFPS is a major social survey project in China, the choice of self-reported data aligns with cost-effectiveness principles, and self-reported measures have been widely used in large epidemiological studies [55], such as CHARLS and ELSA. Secondly, the assessment of health vulnerability of middle-aged and elderly adults in this study failed to cover all health-related indicators, especially objective indicators such as blood pressure, clinical diagnosis, and the lack of objective data on sleep quality testing, which could be included in the future to make the results more comprehensive. However, previous research indicates that for epidemiological studies, the health vulnerability index is not sensitive to the nature of included variables and can be constructed from almost any set of health-related variables [56, 57]. Finally, although we adjusted for a wide range of confounding factors and explored urban-rural differences through subgroup analyses, residual confounding from disease factors, socioeconomic factors, and other variables cannot be ruled out. Therefore, future studies should adopt a more comprehensive approach to investigate the associations among these variables, particularly by employing mixed-methods research to analyze urban-rural differences in health risk factors among middle-aged and elderly adults and the underlying mechanisms. Conclusions Our study demonstrates varying degrees of association among community environment, sleep quality, social values, anti-fragile capacity, and health vulnerability in middle-aged and elderly adults in China. We found that sleep quality, social values, and anti-fragile capacity partially mediated the impact of community environment on health vulnerability, with differences observed across subgroups. This evidence suggests that multiple interventions can be used to improve community environments, thereby alleviating health vulnerability among the middle-aged and elderly adults, with a need to focus on mental health from midlife onward. It also highlights community environment as an important intervention target, recommending accelerated development of age-friendly communities, encouraging active social participation among middle-aged and elderly adults, holding more health seminars, and positively promoting social values for this demographic. Diverse strategies should be adopted to mitigate health vulnerability. Supplementary Information Supplementary Material 1. Acknowledgements We thank the participants and investigators of the China Family Panel Studies database for making this study possible. Authors’ contributions Study design, Manuscript writing: Qingping Zhou, Yusupujiang Tuersun, Zhenning Liang. Data collection and management: Di Dai, Shengfan Zhan, Xiyue Zhang, Shuining Li. Data analyses: Qingping Zhou, Chenxi Wang, Yao Yu. Manuscript review and editing: Siyuan Liu, Yi Qian. All authors were involved in the manuscript preparation. The authors read and approved the final manuscript. Funding This work was supported by grants from the National Social Science Foundation of China (project number 21BGL301), the Key Laboratory of Philosophy and Social Science (Public Health Policy Research and Evaluation) in Higher Educational Institutions of Guangdong Province (project number 2015WSYS0010), the 2024 Undergraduate Extracurricular Research Fund Program, School of Health Management, Southern Medical University (project number 2024RFU009) and the 2024 Guangdong University Students’ Innovation and Entrepreneurship Training Program Project (project number S202412121178). Data availability This study is based on publicly available datasets, and the data can be accessed from the website: https://www.isss.pku.edu.cn/cfps/. Data are available for researchers upon application to the CFPS. Declarations Ethics approval and consent to participate The survey was reviewed and approved by the Peking University Biomedical Ethics Review Committee (approval number: IRB00001052-14010). Participants gave informed consent to participate in the study before taking part. All methods were performed in accordance with the relevant guidelines and regulations. Consent for publication Not applicable. Competing interests The authors declare no competing interests. Footnotes Publisher’s Note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. Qingping Zhou, Yusupujiang Tuersun and Zhenning Liang contributed equally to this work. References Associated Data Supplementary Materials Supplementary Material 1. Data Availability Statement This study is based on publicly available datasets, and the data can be accessed from the website: https://www.isss.pku.edu.cn/cfps/. Data are available for researchers upon application to the CFPS.