$$\rightleftharpoonup{xx}$$
$$\longleftharp{xx}$$,
$$\longrightharp{xx}$$,
The research was approved by the Biomedical Ethics Committee of Peking University (IRB00001052-11015). All subjects provided informed consent.
Study population
The data for this study were obtained from CHARLS 2020, which covers 150 county-level units and 450 village-level units across the country, encompassing approximately 10,000 households and 19,395 middle-aged and elderly individuals aged 45 and above21. The survey employed a multi-stage probability sampling approach. Individuals were included if they met the following criteria: age of 45 years or older; selected home-dwelling in response to the questionnaire item BA007: What is the type of residence at the living address?; and provided a clear answer to the 10-item Center for Epidemiological Studies Depression Scale (CES-D-10). Individuals were excluded if they met one or more of the following criteria: responses indicating non-home residence (including communities, hospitals, and others or missing); lack of information on depression; lack of information on relevant covariates. Ultimately, 14,466 adults who met the initial criteria were included in this study. The detailed process of participant selection is illustrated in Figure 1.

Figure 1: A flow chart for study population selection. Please click here to view a larger version of this figure.
Definition of the variables
Depressive symptoms were assessed using a simplified version of the CES-D-10, which has high reliability and validity in previous studies22,23. The CES-D-10 has 10 items with four scales: 0 = never, 1 = sometimes or rarely, 2 = often, and 3 = always, and the fifth and eighth items are scored in reverse24. The total score of the depression scale is obtained by summing the ratings of all 10 items, ranging from 0 to 30; the higher the score, the more serious the individual’s depressive symptoms. Based on previous studies of middle-aged and elderly populations25,26, participants with CES-D-10 scores ≥10 were classified as having depressive symptoms, whereas scores <10 were classified as non-depressed.
Information collected from all study participants includes demographic information (age, gender, marital status, residence, and education level), living habits and physical health status (physical activity, smoking, drinking, social interactions, self-rated health, the status of chronic disease, and nap time), and information related to living conditions and children (satisfaction with living conditions, the marital status of the offspring, and the health status of the offspring). Chronic diseases are diagnosed by doctors and include hypertension, dyslipidemia, malignant tumors, chronic lung disease, heart disease, stroke, arthritis, and rheumatism.
Statistical analysis
Binary logistic regression analysis
Categorical variables are presented as frequencies and percentages. Chi-square tests were conducted to examine differences in depression incidence across various demographic characteristics within the study population. Binary logistic regression analysis was performed to identify significant factors associated with depressive symptoms. These statistical analyses were performed using SPSS software (version 21.0).
LASSO regression
In R version 4.3.2, the dataset was randomly partitioned into a training set and a test set at a 7:3 ratio using a fixed random seed to ensure reproducibility. Specifically, 70% of the data were allocated to the training set for model development, and 30% to the test set for independent validation. First, variables that were statistically significant (p < 0.05) in the binary logistic regression were included in the LASSO regression analysis to prevent overfitting by shrinking the coefficients. The optimal lambda value was determined via 10-fold cross-validation. The lambda.1se was selected based on the one standard error rule to achieve the optimal variable selection performance. LASSO shrinkage was employed to prevent overfitting by reducing the coefficients of less important variables toward zero. For further details, please consult the Supplementary File 1 (item 1).
Nomogram construction
The relative importance of the selected predictors was ranked according to the absolute magnitude of their standardized coefficients and visualized using a forest plot. A predictive nomogram was constructed using the rms package, based on the final logistic regression equation. For further details, please consult the Supplementary File 1 (item 2).
Model validation
Discrimination was evaluated by calculating the area under the receiver operating characteristic curve (AUC) using the pROC package. The AUC was calculated separately for the training set and test set. Typically, an AUC greater than 0.75 indicates good discrimination. For further details, please consult Supplementary File 1 (item 3).
Calibration: Model calibration was assessed using the Hosmer-Lemeshow goodness-of-fit test and visualized with calibration curves generated by the rms package, plotting predicted probabilities against observed frequencies. A non-significant Hosmer-Lemeshow test (p > 0.05) indicates good calibration. For further details, please consult the Supplementary File 1 (item 4).
Clinical utility: Clinical utility was evaluated using decision curve analysis (DCA) with the rmda package, calculating net benefit across threshold probabilities from 0% to 100%. For further details, please consult the Supplementary File 1 (item 5).
Random forest validation: As a supplementary validation, a random forest model was implemented using the randomForest package to assess model stability and generalizability. The error rate convergence curve was plotted to evaluate the relationship between the number of trees and prediction accuracy in both training and test sets. A two-sided p value < 0.05 was considered to indicate a statistically significant difference. For further details, please consult the Supplementary File 1 (item 6).