LDH to lymphocyte percentage ratio is a novel predictor of in-hospital mortality in PLWH - a retrospective study Authors: Xiaoting Xie, Jingzhen Lai, Zhiman Xie, Wudi Wei, Sufang Ai, Rongfeng Chen, Zongxiang Yuan, Sirun Meng, Li Ye, Junjun Jiang, Hao Liang Published: 2025 ABSTRACT BackgroundHuman immunodeficiency virus (HIV) infection and acquired immune deficiency syndrome (AIDS) present significant global health challenges. Over time, the condition has evolved into a chronic disease, requiring continuous monitoring of inflammation and immune status to guide treatment strategies. This study aimed to evaluate various combinations of hematological, immunological, and biochemical parameters in PLWH with HIV/AIDS-related conditions to identify cost-effective biomarkers for predicting in-hospital mortality of people living with HIV(PLWH).MethodsThis retrospective, observational study included 7,855 PLWH with HIV/AIDS-related admissions between 2011 and 2019. We extracted medical records and laboratory test results from the subjects. Receiver Operating Characteristic (ROC) curve analysis was performed to assess the ability of all biochemical indicators to differentiate in-hospital mortality. Extreme Gradient Boosting (XGBoost), Support Vector Machine (SVM), and Backpropagation Neural Network (BP-NN) models were developed and evaluated, and the importance score of each feature was calculated in the optimal model. Additionally, multivariate Logistic Regression (LR) analysis and a SHAP-based (SHapley Additive exPlanations) LR model were used to compare selected indicators with key traditional variables, evaluating their predictive value for in-hospital mortality in PLWH hospitalized for HIV/AIDS-related conditions.ResultsThis study analyzed 46 basic biochemical parameters and 1,041 composite ratios. The Lactate Dehydrogenase to Lymphocyte Percentage Ratio (LDH to lymphocyte percentage ratio, L-LWR) achieved the highest area under the curve (AUC) of 0.716 (95% CI: 0.695–0.738, P < 0.001) in ROC analysis. In the XGBoost model, which performed best on the test set, L-LWR ranked fourth in feature importance, making it the highest-ranked biochemical indicator. Multivariate logistic regression identified clinical stage 3 (OR: 3.05, 95% CI: 1.44–6.45, P < 0.001) and high L-LWR (> 24.441) (OR: 2.55, 95% CI: 2.04–3.20, P < 0.001) as significant risk factors. In the SHAP-based LR model, high L-LWR had the most significant impact on the model’s output (P < 0.001).ConclusionL-LWR is a potential predictor of in-hospital mortality in PLWH hospitalized for HIV/AIDS-related conditions.Clinical trial numberNot applicable.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12879-025-12104-w. Background HIV/AIDS is a chronic infection that compromises the immune system, posing a significant global public health challenge [1]. As of 2023, 42.3 million people [35.7–51.1 million] had died from HIV/AIDS-related causes globally, with 39.9 million [36.1–43.1 million] living with the virus. In some regions, up to 40% of individuals present with advanced HIV infection at the time of diagnosis, indicating a significant burden on healthcare systems [2]. A meta-analysis of 100,628 hospital admissions (2014–2023) reported an in-hospital mortality rate of 17% among PLWH [3]. A systematic review of 92,781 PLWH found that 18.8% were readmitted within 12 months and 14.1% died during follow-up [4]. These deaths are driven by various AIDS- and non-AIDS-related conditions, including cancers, infections, and wasting syndrome, among others—conditions that can deteriorate rapidly without prompt recognition and treatment [5, 6]. Therefore, timely and high-quality clinical management is critical for hospitalized PLWH. Classical markers, such as CD4 count, CD4/CD8 ratio, and viral load, are essential for long-term monitoring of immune status and guiding antiretroviral therapy (ART). However, consensus on the predictive value of these markers for adverse clinical outcomes remains lacking [7, 8]. Despite well-controlled viral loads, PLWH continue to face an elevated risk of inflammation-related complications, as CD4 count and viral load alone do not fully reflect the underlying immune status [9]. Advanced HIV infection and AIDS-related illnesses remain a persistent global challenge despite significant improvements in access to ART [3]. Scholars have observed that HIV infection is now increasingly characterized by a shift from immunodeficiency to chronic inflammation, with both processes closely interrelated in untreated and treated individuals [10]. Persistent inflammation among PLWH is marked by sustained activation of immune cells and elevated levels of inflammatory biomarkers [11]. These biomarkers are associated with increased mortality and other adverse outcomes in PLWH [12], highlighting their importance in understanding the complex interplay between immune dysfunction, inflammation, and HIV pathogenesis [13, 14]. Integrating such biomarkers into routine HIV monitoring strategies may be particularly valuable in resource-limited settings [9]. Moreover, these findings suggest that combining immune and inflammatory indicators could enhance the assessment of disease status and improve clinical decision-making in HIV care. Several hematological and biochemical parameter ratios, such as neutrophil-to-lymphocyte ratio (NLR), platelet-to-lymphocyte ratio (PLR), systemic immune-inflammation index (SII), and platelet indices, have been explored for their prognostic value in PLWH [15–18]. However, due to limitations in sample size, scope, and content, no comprehensive research has yet assessed whether these laboratory parameters or composite indices can characterize systemic inflammation, immune status, and clinical outcomes in hospitalized PLWH. This study focuses on the short-term inpatient management of PLWH hospitalized for HIV/AIDS-related conditions. By extensively analyzing hematological, biochemical, and immunological parameters—and their composite indices—in a large cohort, we aimed to identify tools that better reflect systemic inflammation and immune status, improve inpatient management, and enhance the identification of in-hospital mortality risk. Materials and methods Study population This retrospective, single-center, observational cross-sectional study was conducted at Nanning Fourth People’s Hospital, the only infectious disease specialty hospital in Nanning, Guangxi. The study included 7,855 hospitalized PLWH with HIV/AIDS-related conditions between November 2011 and June 2019. The diagnosis of HIV/AIDS was based on the Chinese HIV/AIDS Diagnosis and Treatment Guidelines applicable during the year of hospitalization. Inclusion Criteria: (1) PLWH admitted to the hospital between November 2011 and June 2019 for their most recent hospitalization. (2) admission diagnosis explicitly recorded as HIV or AIDS. (3) PLWH whose admission diagnosis was not directly recorded as HIV or AIDS but was related to infectious diseases, and who had a CD4 cell count of less than 200 cells/µL. Exclusion Criteria: (1) age < 18 years; (2) patients with incomplete medical records or missing important medical information. The study was approved by the medical ethics committee of the institution (Approval No. 20210099). Informed consent was obtained from and signed by all study participants. Clinical variables We organized and analyzed sociodemographic data, laboratory results, clinical characteristics, and medical history for all study subjects. Data on 25 comorbidities and 46 biochemical parameters (Table S1) were collected, including hematological, immunological, liver and kidney function, and electrolyte tests. Variables with missing values exceeding 20% were excluded. Patients were categorized into two groups based on discharge outcomes: the Survivor group and the Death group. HIV and AIDS classification was based on admission diagnosis. PLWH with CD4 counts above 200 cells/µL and currently receiving ART were classified as HIV. This study considered the first measurements of laboratory markers within 24 h of admission. Pairwise ratios were calculated for all variables, with particular focus on established ratio such as CD4/CD8 ratio and SII. Calculation of Ratios: L-LWR = LDH / lymphocyte percentage [19].LLR = LDH / lymphocyte count [20].ALRI = aspartate aminotransferase (U/L) / lymphocyte count [21].ANRI = AST (U/L) / neutrophil count [22].NLR = neutrophil count / lymphocyte count [23].PLR = platelet count / absolute lymphocyte count [23].SII = platelet count × neutrophil count/ lymphocyte count (×109/L) [24]. L-LWR = LDH / lymphocyte percentage [19]. L-LWR = LDH / lymphocyte percentage [19]. LLR = LDH / lymphocyte count [20]. LLR = LDH / lymphocyte count [20]. ALRI = aspartate aminotransferase (U/L) / lymphocyte count [21]. ALRI = aspartate aminotransferase (U/L) / lymphocyte count [21]. ANRI = AST (U/L) / neutrophil count [22]. ANRI = AST (U/L) / neutrophil count [22]. NLR = neutrophil count / lymphocyte count [23]. NLR = neutrophil count / lymphocyte count [23]. PLR = platelet count / absolute lymphocyte count [23]. PLR = platelet count / absolute lymphocyte count [23]. SII = platelet count × neutrophil count/ lymphocyte count (×109/L) [24]. SII = platelet count × neutrophil count/ lymphocyte count (×109/L) [24]. Comorbidity classification: Chronic comorbidities: Diabetes, hypertension, tumors, anemia, all tuberculosis except when the admission cause specifically noted as tuberculosis-related diseases. Acute comorbidities: Admission cause specifically noted as tuberculosis-related diseases, Talaromycosis, oral fungal infection, pneumocystis pneumonia, herpes zoster, cryptococcosis, septic shock, respiratory failure, cytomegalovirus infection, Immune Reconstitution Inflammatory Syndrome (IRIS). No comorbidities: No acute or chronic comorbidities of concern as mentioned above, but cannot completely confirm the absence of other comorbidities. Chronic comorbidities: Diabetes, hypertension, tumors, anemia, all tuberculosis except when the admission cause specifically noted as tuberculosis-related diseases. Chronic comorbidities: Diabetes, hypertension, tumors, anemia, all tuberculosis except when the admission cause specifically noted as tuberculosis-related diseases. Acute comorbidities: Admission cause specifically noted as tuberculosis-related diseases, Talaromycosis, oral fungal infection, pneumocystis pneumonia, herpes zoster, cryptococcosis, septic shock, respiratory failure, cytomegalovirus infection, Immune Reconstitution Inflammatory Syndrome (IRIS). Acute comorbidities: Admission cause specifically noted as tuberculosis-related diseases, Talaromycosis, oral fungal infection, pneumocystis pneumonia, herpes zoster, cryptococcosis, septic shock, respiratory failure, cytomegalovirus infection, Immune Reconstitution Inflammatory Syndrome (IRIS). No comorbidities: No acute or chronic comorbidities of concern as mentioned above, but cannot completely confirm the absence of other comorbidities. No comorbidities: No acute or chronic comorbidities of concern as mentioned above, but cannot completely confirm the absence of other comorbidities. Statistical analysis The Shapiro-Wilk test was used to assess the normal distribution of data. Continuous normally distributed variables were presented as mean and standard deviation. Continuous non-normally distributed variables were presented as median and interquartile range (IQR). Categorical data were presented as numbers and percentages. T-tests, non-parametric Mann-Whitney tests, and Pearson’s chi-square tests were used to compare normally distributed variables, skewed distributed variables, and categorical variables, respectively. ROC curve analysis and Youden’s index were used to determine the optimal cutoff values for biomarkers. Additionally, a logistic regression model was employed for multivariate analysis. Statistical analysis was performed using SPSS 23.0 software (IBM, Armonk, NY) and R 4.2.3 (R Foundation). A P-value < 0.05 was considered statistically significant. Model construction and verification We developed four machine learning models: XGBoost, SVM, and BP-NN were implemented in the initial phase, while the LR model was developed in a subsequent phase (Fig. 1). Patients were randomly divided into training (70%) and testing (30%) sets, with feature normalization performed using MinMaxScaler. To address class imbalance in the training set, Synthetic Minority Over-sampling Technique (SMOTE) was applied. GridSearchCV with 5-fold cross-validation was used to identify the optimal configurations that maximized the AUC for the training set. This approach ensured the models’ optimal performance during evaluation on the independent test set. We estimated 95% confidence intervals (CI) for all performance metrics (accuracy, sensitivity, F1-score, and AUC of ROC analysis) through 1,000 bootstrap iterations. Feature importance was quantified using model-specific techniques, with 95% CI derived from 100 bootstrap iterations. Fig. 1Comprehensive schematic diagram about the study design, patient selection process, and analytical workflow Comprehensive schematic diagram about the study design, patient selection process, and analytical workflow Results Demographic and clinical characteristics of patients A total of 7,855 hospitalized PLWH with HIV/AIDS-related conditions were included in this study. Among them, 760 (9.68%) died, with 97.63% of deaths occurring in individuals with AIDS. The study cohort ranged in age from 18 to 97 years, with 77.72% (n = 6,105) being male. While there were no significant differences in age and gender distribution between groups, there were notable differences in occupation and marital status. According to CD4 count staging, 80.89% of patients in this cohort were in stage 3, indicating severe immunodeficiency. Among patients who died during hospitalization, 92.89% were in stage 3. Of the included subjects, 26.51% (n = 2,082) received ART. Tuberculosis was the most common comorbidity among patients, followed by Talaromycosis. The incidence of comorbidities was significantly higher in the death group compared to the survival group, except for tuberculosis, hypertension, diabetes, and syphilis. Notably, septic shock, respiratory failure, and electrolyte imbalance were significantly more prevalent in the death group (Table 1). In terms of laboratory findings, the death group had lower levels of red blood cells (RBCs), hemoglobin (Hb), platelets (PLT), LWR, lymphocyte count (LC), and CD4/CD8 ratio compared to the survival group (P < 0.001), while LDH, white blood cells (WBCs), neutrophil count (NEU), L-LWR, LLR, APRI, ANRI, SII, and NLR levels were higher (P < 0.001). PLR and ALRI levels showed no significant difference between the survival group and the death group (P > 0.05) (Table 2). Table 1Demographic and clinical characteristics of hospitalized PLWH with HIV/AIDS-Related conditionsVariablesTotal(n = 7855)Survival group (n = 7095)Death group (n = 760)χ²P-valueCase Classification56.80< 0.001 HIV805 (10.25)787 (11.09)18 (2.37) AIDS7050 (89.75)6308 (88.91)742 (97.63)Sex0.090.761 Male6105 (77.72)5511 (77.67)594 (78.16) Female1750 (22.28)1584 (22.33)166 (21.84)Age Group4.870.088 18–402199 (27.99)1961 (27.64)238 (31.32) 41–603430 (43.67)3119 (43.96)311 (40.92) > 602226 (28.34)2015 (28.40)211 (27.76)Occupation66.42< 0.001 Farmer4407 (56.10)4069 (57.35)338 (44.47) Unemployed/ retired1839 (23.41)1575 (22.20)264 (34.74) Other1609 (20.48)1451 (20.45)158 (20.79)Marital status34.06< 0.001 Single1351 (17.20)1187 (16.73)164 (21.58) Married5031 (64.06)4604 (64.90)427 (56.18) divorce410 (5.22)358 (5.05)52 (6.84) widowed824 (10.49)746 (10.52)78 (10.26) Other238 (3.03)199 (2.81)39 (5.13)Clinical Stage, based on CD4 count (cells/µL)Stage 1(≥ 500)316 (4.02)306 (4.31)10 (1.32)78.52< 0.001Stage 2(200 to 499)1185 (15.09)1141 (16.08)44 (5.79)Stage 3(< 200)6354 (80.89)5648 (79.61)706 (92.89)ART25.54< 0.001 No5773 (73.49)5156 (72.67)617 (81.18) Yes2082 (26.51)1939 (27.33)143 (18.82)Comorbidity170.00< 0.001Chornic500 (6.37)466 (6.57)34 (4.47) Acute4581 (58.32)3971 (55.97)610 (80.26) No2774 (35.32)2658 (37.46)116 (15.26)Tuberculosis3507 (44.65)3150 (44.40)357 (46.97)1.840.175Talaromycosis1431 (18.22)1225 (17.27)206 (27.11)44.61< 0.001PTB2927 (37.26)2639 (37.20)288 (37.89)0.140.705Electrolyte Imbalance1143 (14.55)894 (12.60)249 (32.76)224.45< 0.001PCP945 (12.03)796 (11.22)149 (19.61)45.62< 0.001Hypertension491 (6.25)434 (6.12)57 (7.50)2.240.134Respiratory Failure372 (4.74)173 (2.44)199 (26.18)857.97< 0.001Syphilis256 (3.26)242 (3.41)14 (1.84)5.360.021Diabetes239 (3.04)208 (2.93)31 (4.08)3.060.080Cryptococcosis228 (2.90)176 (2.48)52 (6.84)46.33< 0.001Septic Shock222 (2.83)53 (0.75)169 (22.24)1154.33< 0.001Data are presented as n (%); χ²: Chi-square test. Abbreviations: PTB, Pulmonary Tuberculosis; PCP, Pneumocystis Pneumonia Table 1Demographic and clinical characteristics of hospitalized PLWH with HIV/AIDS-Related conditionsVariablesTotal(n = 7855)Survival group (n = 7095)Death group (n = 760)χ²P-valueCase Classification56.80< 0.001 HIV805 (10.25)787 (11.09)18 (2.37) AIDS7050 (89.75)6308 (88.91)742 (97.63)Sex0.090.761 Male6105 (77.72)5511 (77.67)594 (78.16) Female1750 (22.28)1584 (22.33)166 (21.84)Age Group4.870.088 18–402199 (27.99)1961 (27.64)238 (31.32) 41–603430 (43.67)3119 (43.96)311 (40.92) > 602226 (28.34)2015 (28.40)211 (27.76)Occupation66.42< 0.001 Farmer4407 (56.10)4069 (57.35)338 (44.47) Unemployed/ retired1839 (23.41)1575 (22.20)264 (34.74) Other1609 (20.48)1451 (20.45)158 (20.79)Marital status34.06< 0.001 Single1351 (17.20)1187 (16.73)164 (21.58) Married5031 (64.06)4604 (64.90)427 (56.18) divorce410 (5.22)358 (5.05)52 (6.84) widowed824 (10.49)746 (10.52)78 (10.26) Other238 (3.03)199 (2.81)39 (5.13)Clinical Stage, based on CD4 count (cells/µL)Stage 1(≥ 500)316 (4.02)306 (4.31)10 (1.32)78.52< 0.001Stage 2(200 to 499)1185 (15.09)1141 (16.08)44 (5.79)Stage 3(< 200)6354 (80.89)5648 (79.61)706 (92.89)ART25.54< 0.001 No5773 (73.49)5156 (72.67)617 (81.18) Yes2082 (26.51)1939 (27.33)143 (18.82)Comorbidity170.00< 0.001Chornic500 (6.37)466 (6.57)34 (4.47) Acute4581 (58.32)3971 (55.97)610 (80.26) No2774 (35.32)2658 (37.46)116 (15.26)Tuberculosis3507 (44.65)3150 (44.40)357 (46.97)1.840.175Talaromycosis1431 (18.22)1225 (17.27)206 (27.11)44.61< 0.001PTB2927 (37.26)2639 (37.20)288 (37.89)0.140.705Electrolyte Imbalance1143 (14.55)894 (12.60)249 (32.76)224.45< 0.001PCP945 (12.03)796 (11.22)149 (19.61)45.62< 0.001Hypertension491 (6.25)434 (6.12)57 (7.50)2.240.134Respiratory Failure372 (4.74)173 (2.44)199 (26.18)857.97< 0.001Syphilis256 (3.26)242 (3.41)14 (1.84)5.360.021Diabetes239 (3.04)208 (2.93)31 (4.08)3.060.080Cryptococcosis228 (2.90)176 (2.48)52 (6.84)46.33< 0.001Septic Shock222 (2.83)53 (0.75)169 (22.24)1154.33< 0.001Data are presented as n (%); χ²: Chi-square test. Abbreviations: PTB, Pulmonary Tuberculosis; PCP, Pneumocystis Pneumonia Demographic and clinical characteristics of hospitalized PLWH with HIV/AIDS-Related conditions Data are presented as n (%); χ²: Chi-square test. Abbreviations: PTB, Pulmonary Tuberculosis; PCP, Pneumocystis Pneumonia Table 2Laboratory parameters of hospitalized PLWH with HIV/AIDS-Related conditionsVariablesTotal (n = 7855)Survival group (n = 7095)Death group(n = 760)ZP-valueLDH(U/L)249.30 (208.25, 357.50)249.30 (204.60, 339.75)351.30 (249.30, 591.75)-16.77< 0.001WBCs(109/L)5.23 (3.72, 7.36)5.18 (3.71, 7.21)5.93 (3.81, 9.24)-5.40< 0.001RBCs (109/L)3.59 (2.99, 4.18)3.61 (3.02, 4.19)3.36 (2.74, 4.12)< 0.001< 0.001Hb (g/L)103.00 (85.00, 121.00)104.00 (86.50, 122.00)94.00 (75.20, 114.00)-4.00< 0.001PLT (109/L)198.00 (128.00, 268.00)201.40 (135.00, 271.00)147.00 (69.30, 228.25)-12.04< 0.001LWR(%)17.30 (10.30, 26.90)17.90 (10.90, 27.30)11.80 (6.41, 20.93)-12.08< 0.001LC (109/L)0.87 (0.51, 1.38)0.90 (0.54, 1.40)0.64 (0.35, 1.13)-9.54< 0.001NEU (109/L)3.46 (2.24, 5.38)3.38 (2.22, 5.21)4.38 (2.54, 7.29)-8.35< 0.001PLR215.25 (126.60, 366.67)213.54 (128.57, 360.21)230.15 (97.34, 414.14)-0.040.971ALRI2.34 (1.47, 3.71)2.35 (1.49, 3.67)2.27 (1.29, 4.14)-0.590.555ANRI0.20 (0.09, 0.47)0.19 (0.09, 0.43)0.38 (0.14, 0.96)-11.71< 0.001SII722.87 (344.58, 1528.62)711.08 (345.98, 1465.94)914.61 (337.44, 2233.08)-4.11< 0.001L-LWR15.60 (8.70, 33.42)14.51 (8.42, 29.38)37.15 (17.19, 80.07)-19.62< 0.001LLR309.56 (170.10, 642.66)291.14 (164.15, 582.02)630.40 (298.42, 1321.03)-16.51< 0.001CD4/CD8 ratio0.20 (0.09, 0.32)0.20 (0.09, 0.33)0.17 (0.07, 0.24)-3.56< 0.001NLR4.05 (2.17, 7.82)3.87 (2.12, 7.30)6.87 (3.45, 13.33)-13.17< 0.001Data are presented as median (IQR). p values were calculated using the Mann–Whitney U test. Abbreviations: RBCs, red blood cells; Hb, hemoglobin; LWR, lymphocyte percentage; LC, lymphocyte count; NEU, neutrophil count Table 2Laboratory parameters of hospitalized PLWH with HIV/AIDS-Related conditionsVariablesTotal (n = 7855)Survival group (n = 7095)Death group(n = 760)ZP-valueLDH(U/L)249.30 (208.25, 357.50)249.30 (204.60, 339.75)351.30 (249.30, 591.75)-16.77< 0.001WBCs(109/L)5.23 (3.72, 7.36)5.18 (3.71, 7.21)5.93 (3.81, 9.24)-5.40< 0.001RBCs (109/L)3.59 (2.99, 4.18)3.61 (3.02, 4.19)3.36 (2.74, 4.12)< 0.001< 0.001Hb (g/L)103.00 (85.00, 121.00)104.00 (86.50, 122.00)94.00 (75.20, 114.00)-4.00< 0.001PLT (109/L)198.00 (128.00, 268.00)201.40 (135.00, 271.00)147.00 (69.30, 228.25)-12.04< 0.001LWR(%)17.30 (10.30, 26.90)17.90 (10.90, 27.30)11.80 (6.41, 20.93)-12.08< 0.001LC (109/L)0.87 (0.51, 1.38)0.90 (0.54, 1.40)0.64 (0.35, 1.13)-9.54< 0.001NEU (109/L)3.46 (2.24, 5.38)3.38 (2.22, 5.21)4.38 (2.54, 7.29)-8.35< 0.001PLR215.25 (126.60, 366.67)213.54 (128.57, 360.21)230.15 (97.34, 414.14)-0.040.971ALRI2.34 (1.47, 3.71)2.35 (1.49, 3.67)2.27 (1.29, 4.14)-0.590.555ANRI0.20 (0.09, 0.47)0.19 (0.09, 0.43)0.38 (0.14, 0.96)-11.71< 0.001SII722.87 (344.58, 1528.62)711.08 (345.98, 1465.94)914.61 (337.44, 2233.08)-4.11< 0.001L-LWR15.60 (8.70, 33.42)14.51 (8.42, 29.38)37.15 (17.19, 80.07)-19.62< 0.001LLR309.56 (170.10, 642.66)291.14 (164.15, 582.02)630.40 (298.42, 1321.03)-16.51< 0.001CD4/CD8 ratio0.20 (0.09, 0.32)0.20 (0.09, 0.33)0.17 (0.07, 0.24)-3.56< 0.001NLR4.05 (2.17, 7.82)3.87 (2.12, 7.30)6.87 (3.45, 13.33)-13.17< 0.001Data are presented as median (IQR). p values were calculated using the Mann–Whitney U test. Abbreviations: RBCs, red blood cells; Hb, hemoglobin; LWR, lymphocyte percentage; LC, lymphocyte count; NEU, neutrophil count Laboratory parameters of hospitalized PLWH with HIV/AIDS-Related conditions Data are presented as median (IQR). p values were calculated using the Mann–Whitney U test. Abbreviations: RBCs, red blood cells; Hb, hemoglobin; LWR, lymphocyte percentage; LC, lymphocyte count; NEU, neutrophil count ROC analysis of laboratory parameters and composite ratios We calculated pairwise ratios for all 46 basic laboratory parameters, resulting in 1,035 composite ratios. Additionally, we included established clinical ratios, yielding a total of 1,085 variables for ROC analysis. As shown in Fig. 2, we identified the top 10 basic and composite variables ranked by AUC value (all p < 0.05). Among them, L-LWR emerged as the most discriminative predictor of in-hospital mortality (AUC: 0.716, 95% CI: 0.696–0.738, p < 0.001), with an optimal threshold of 24.441 (sensitivity: 65.79%, specificity: 69.57%). Among basic biochemical parameters, LDH demonstrated the highest discriminatory ability (AUC: 0.685, 95% CI: 0.663–0.706, p < 0.001; sensitivity: 52.11%, specificity: 75.57%). Subgroup ROC analysis showed that L-LWR maintained strong performance across various patient classifications (Figure S1). Notably, L-LWR was the only indicator to achieve an AUC greater than 0.7 in both individuals with HIV infection and those with AIDS (p < 0.001) (Fig. 3a), and its ability to discriminate in-hospital mortality was higher in those with HIV infection compared to those with AIDS. Other established composite ratios exhibited relatively lower discriminatory ability. Furthermore, L-LWR performed better in patients with chronic comorbidities than in those with acute complications (Fig. 3b). Comprehensive ROC analysis results for all variables and subgroups are presented in Supplementary Table S2. Fig. 2Top 10 laboratory parameters and composite ratios on ROC curve analysis. a) Laboratory Parameters. b) Composite Ratios. Note: laboratory parameters are those that can be obtained directly from the biochemical test list. Abbreviations: DBIL, direct bilirubin; NR, neutrophil ratio; TBIL, total bilirubin; IBIL, indirect bilirubin; EOSR, eosinophil ratio; MONOR, monocyte ratio; HCT, hematocrit Top 10 laboratory parameters and composite ratios on ROC curve analysis. a) Laboratory Parameters. b) Composite Ratios. Note: laboratory parameters are those that can be obtained directly from the biochemical test list. Abbreviations: DBIL, direct bilirubin; NR, neutrophil ratio; TBIL, total bilirubin; IBIL, indirect bilirubin; EOSR, eosinophil ratio; MONOR, monocyte ratio; HCT, hematocrit Fig. 3Comparative ROC curve analysis results of L-LWR and established ratios by HIV/AIDS status and comorbidity type. a) By HIV/AIDS Status. b) By Comorbidity Type. Note: Due to the low mortality rate in the HIV subgroup (18 deaths among 805 patients), we employed a 1:4 case-control matching strategy. Cases (deceased patients) were matched to controls (survivors) based on ART status, age group, comorbidity classification, and Clinical Stage to ensure balanced comparison groups for analysis Comparative ROC curve analysis results of L-LWR and established ratios by HIV/AIDS status and comorbidity type. a) By HIV/AIDS Status. b) By Comorbidity Type. Note: Due to the low mortality rate in the HIV subgroup (18 deaths among 805 patients), we employed a 1:4 case-control matching strategy. Cases (deceased patients) were matched to controls (survivors) based on ART status, age group, comorbidity classification, and Clinical Stage to ensure balanced comparison groups for analysis Feature importance scores in machine learning models To further assess the importance of variables in predicting in-hospital mortality among PLWH, we constructed three machine learning models: XGBoost, SVM, and BP-NN. These models included variables with an AUC greater than 0.65, and sensitivity and specificity greater than 50% from the ROC analysis (k = 116), along with data on 25 comorbidities, clinical stage, and ART status. The sum of all feature importance scores was 1. Among the models, the XGBoost model demonstrated the highest performance on the test set, achieving superior sensitivity, F1 score (Fig. 4a), and AUC (Fig. 4b) compared to the other models. Consequently, we selected the XGBoost model for feature importance analysis. Figure 4c shows the top 10 features ranked by importance score in the XGBoost model, along with Clinical Stage and ART. Septic shock, respiratory failure (RF), and electrolyte imbalance (EI) were identified as the three most important predictors of mortality, and L-LWR ranked fourth overall and was the highest-ranked biochemical indicator (P < 0.001). The model performance data and importance scores of all variables in XGBoost model are presented in Table S3. Fig. 4Machine learning model performance and feature importance analysis. a) comparison of model performance in training and testing sets. b) ROC analysis results of each model in training and testing sets. c)Top 10 Feature importance scores in the XGBoost Model. Abbreviations: RF, Respiratory Failure; EI, Electrolyte Imbalance; TC, total cholesterol Machine learning model performance and feature importance analysis. a) comparison of model performance in training and testing sets. b) ROC analysis results of each model in training and testing sets. c)Top 10 Feature importance scores in the XGBoost Model. Abbreviations: RF, Respiratory Failure; EI, Electrolyte Imbalance; TC, total cholesterol Multivariate logistic regression and SHAP value-based LR model Multivariate logistic regression analysis revealed that clinical stage 3 was a significant risk factor for in-hospital mortality among PLWH (OR: 3.05, 95% CI: 1.44–6.45, P<0.001). High L-LWR (≥ 24.441) was also identified as a significant risk factor for in-hospital mortality (OR: 2.55, 95% CI: 2.04–3.20, P < 0.001). ART-uptake showed a significant protective effect (OR: 0.70, 95% CI: 0.57–0.87, P < 0.001). Interestingly, higher CD4/CD8 ratio was associated with an increased risk of mortality (OR: 1.67, 95% CI: 1.21–2.31, P =0.002) (Fig. 5a). To further evaluate the relative importance of L-LWR in predicting in-hospital mortality compared to other clinical variables, we constructed a logistic regression model utilizing SHAP value analysis. This model incorporated variables including L-LWR, CD4/CD8 ratio, ART status, clinical stage, and comorbidity classification. The analysis revealed that high L-LWR had the most significant impact on the model’s output, followed by clinical stage 3 (Fig. 5b). High L-LWR values consistently led to higher model outputs, indicating an increased mortality risk, while low L-LWR values were associated with a lower risk of death. The model also showed that a higher CD4/CD8 ratio was linked to an increased mortality risk (Fig. 5c). The LR model achieved an AUC of 0.721 on the test set (Figure S2). Fig. 5Multivariate logistic regression and SHAP value analysis in LR model. (a) multivariate logistic regression analysis. (b) Average impact of features on model predictions. (c) detailed impact analysis of each feature Multivariate logistic regression and SHAP value analysis in LR model. (a) multivariate logistic regression analysis. (b) Average impact of features on model predictions. (c) detailed impact analysis of each feature Discussion HIV/AIDS remains a significant global public health challenge, with its high infectivity and long-term progression making prevention and control critical. This study identifies L-LWR as a potential biomarker for predicting mortality in hospitalized PLWH with HIV/AIDS-related conditions, as demonstrated by ROC analysis. The machine learning models further highlighted L-LWR as the most important biochemical indicator, and logistic regression analysis confirmed that high L-LWR levels are an independent risk factor for mortality in this population. Our results suggest that HIV/AIDS-related mortality is closely linked to severe immunodeficiency, as evidenced by the higher proportion of patients in stage 3 (severe immunodeficiency) in the death group. The lower uptake of ART in the death group (18.82% vs. 27.33%) underscores the critical importance of early ART intervention in improving patient outcomes. The hematological profiles of deceased patients displayed clear signs of immune dysregulation and an inflammatory response, including lymphocytopenia and neutrophilia. Additionally, increased levels of LDH and WBCs support the presence of an inflammatory state. These findings underscore the potential utility of routine hematological parameters as prognostic indicators for HIV/AIDS-related mortality. Previous research has explored the prognostic value of various laboratory test ratios in predicting HIV/AIDS-related mortality and the progression of comorbidities [25–29]. In our study, ROC analysis revealed that L-LWR outperformed over 1,000 other laboratory indicators, maintaining an AUC above 0.7 in both HIV and AIDS cohorts. This suggests that L-LWR is a broadly applicable marker across the HIV spectrum. Notably, L-LWR showed better performance in HIV cohort than in AIDS cohort, indicating its sensitivity to early pathophysiological changes, which could provide a window for earlier clinical intervention. Interestingly, L-LWR showed greater predictive value in patients with chronic comorbidities compared to those with acute comorbidities. This may be due to the persistent immune dysfunction and low-grade inflammation associated with chronic conditions, which can lead to gradual depletion of lymphocyte reserves [11] and progressive changes in lymphocyte and leukocyte homeostasis. Furthermore, chronic conditions often result in ongoing cellular damage, reflected by increased LDH levels [30]. This observation is particularly relevant as HIV/AIDS is increasingly recognized as a chronic health condition, with PLWH experiencing a rising incidence of chronic comorbidities [31]. The predictive power of L-LWR was comparable to that of clinical stage 3 and surpassed that of acute comorbidities and ART uptake, highlighting its ability to reflect the acute nature of in-hospital mortality risk. The immunodeficiency, excessive inflammatory response, and metabolic disorders indicated by L-LWR may provide a more direct measure of acute mortality risk. Interestingly, the predictive value of the CD4/CD8 ratio was notably lower, and it even showed opposite results in ROC analysis and logistic regression, suggesting that CD4/CD8 ratio may not be a reliable predictor for short-term mortality in hospitalized patients. It is undeniable that ART, CD4/CD8 ratio, and comorbidities have traditionally been regarded as key determinants of the long-term prognosis of PLWH and are the cornerstones of HIV management. Their important value in the long-term management of HIV/AIDS cannot be ignored. To our knowledge, no study has evaluated the prognostic value of L-LWR for in-hospital mortality in PLWH admitted for HIV/AIDS-related conditions. Higher L-LWR may be caused by higher LDH levels and persistent lymphocyte depletion. LDH is an enzyme involved in cellular energy metabolism and is released during inflammation-related cell damage. Serum LDH levels serve as a biomarker for cell injury, inflammation, and disease progression [30, 32–34]. LDH determination can be used to monitor disease progression and treatment response in PLWH [35–37]. Elevated LDH is associated with in-hospital mortality among PLWH [38].In addition, elevated LDH may occur in various clinical contexts. For example, elevated LDH levels are commonly observed in PLWH diagnosed with conditions such as acute Pneumocystis jirovecii infection [39], diffuse large B-cell lymphoma [40], and Talaromycosis [25]. Elevated LDH in PLWH may be due to HIV infection, implying extensive HIV production, high levels of other co-pathogens, irreversible damage to the immunoregulatory system, and translocation of microbial products across damaged mucosal surfaces. This inflammatory environment leads to end-organ damage through multiple potential pathways [41]. Lymphocytes are a type of white blood cell in the humoral immune system that play a crucial immune role in defending the body against infections and various diseases, especially in PLWH [1]. Causes of lymphocyte depletion include massive consumption due to viral infection and chronic immune activation, direct destruction of lymphocytes by the virus, inflammatory factor-induced cell apoptosis, etc [42, 43]. LWR refers to the proportion of lymphocytes in the total white blood cell count. Low LWR is an independent risk factor for hepatocellular carcinoma recurrence after liver transplantation and poor outcomes in decompensated cirrhosis [44, 45]. It is a novel marker for postoperative morbidity in colorectal cancer patients and poor prognosis in lung cancer [46, 47] and can serve as a quality indicator of disease severity in COVID-19 patients [48]. Advanced cancer patients with elevated LWR after palliative treatment had significantly prolonged survival time, possibly because patients with elevated LWR have stronger immune responses, as a bedside marker of immune status, the prognostic role of LWR should be further evaluated in prospective studies [49]. Although research on L-LWR is limited, a previous study suggested that high L-LWR levels (≥ 34) significantly impact the prognosis of patients with infective endocarditis [19]. LLR, which is closely related to L-LWR in origin, has been studied in the context of COVID-19 and is used to predict in-hospital mortality in patients [20, 50]. Integrating our research findings with the pathological characteristics of PLWH and existing literature, we propose that L-LWR serves as a robust predictor of in-hospital mortality for PLWH, carrying significant clinical implications. As a novel composite biomarker, unlike single laboratory parameters reflecting isolated biological processes, L-LWR may integrate multiple dimensions of disease burden, particularly the immune dysfunction, metabolic disorders, and physiological disruption damage specific to patients hospitalized for HIV/AIDS-related conditions. Therefore, L-LWR may offer a more accessible and economical tool for predicting short-term mortality than more intricate clinical evaluations. This is especially pertinent in settings with limited resources and restricted access to comprehensive laboratory tests, or within populations of PLWH who are more likely to be immunocompromised. During 2011–2019, Guangxi Province was a relatively economically underdeveloped region with relatively low ART uptake and limited internet access. These factors led to low HIV awareness among PLWH, which in turn reduced their willingness and adherence to long-term ART. This unique situation—the higher likelihood of immunocompromise among hospitalized patients—increases the utility of the L-LWR as a predictor for this vulnerable population. This study has several limitations. First, being a single-center study, its findings have not been externally validated, limiting their generalizability. Second, as a retrospective study, there are inherent limitations in data collection, including incomplete records regarding comorbidities and the inability to distinguish between acute and chronic complications in some cases. Third, the potential relationships between L-LWR and other diseases remain unclear. Therefore, further research is needed to confirm the reliability and applicability of our findings. Future studies should focus on validating L-LWR through prospective, multicenter studies to clarify their role in the clinical management of HIV/AIDS and other diseases. Conclusion In conclusion, our study highlights that L-LWR at admission is a novel and valuable predictor of in-hospital mortality in patients with HIV/AIDS-related conditions. As a marker reflecting short-term inflammation and immune status, L-LWR offers significant prognostic value. Monitoring elevated L-LWR levels can assist physicians in identifying patients at higher risk of mortality during hospitalization. Supplementary Information Below is the link to the electronic supplementary material. Supplementary Material 1 Supplementary Material 1 Supplementary Material 2 Supplementary Material 2 Supplementary Material 3 Supplementary Material 3 Supplementary Material 4 Supplementary Material 4 Supplementary Material 5 Supplementary Material 5