Competing risks of AIDS and death in people living with HIV: a left-truncated and right-censored retrospective cohort study in Khuzestan, Iran (2001–2022) Authors: Kayvan Kajkolahi, Mohsen Askarishahi, Kazem Alizadeh Barzian, Nima Daneshi, Mohammad Sadegh Loeloe Published: 2026 ABSTRACT ObjectiveThis study aimed to estimate the risks of AIDS progression and death among people living with HIV using left-truncated and right-censored survival methods. Competing-risk methods were used to evaluate AIDS progression in the presence of death as a competing event.MethodsA retrospective cohort study was conducted using data from Behavioral Disease Counseling Centers (BDCC) in East Khuzestan, Iran, from 2001 to 2022. Survival analyses were performed within a left-truncated and right-censored framework, in which the physician-estimated HIV infection date served as the biological time origin and HIV diagnosis was treated as delayed entry. Competing-risk methods were used to evaluate AIDS progression in the presence of death as a competing event. Late HIV diagnosis, defined as a baseline CD4 count below 350 cells/mm³, was a key variable of interest.ResultsThroughout the follow-up period, the cumulative incidence of death exceeded that of AIDS in most time intervals. Late diagnosis was associated with significantly higher hazards for both death and AIDS, with a two-fold increase in the hazard of death (HR = 2.1, p < 0.001). Other significant predictors of death included age ≥ 50 (HR = 2.4, p < 0.001), male sex (HR = 2.84, p = 0.014), and TB co-infection (HR = 2.02, p < 0.001).ConclusionAccounting for left truncation and right censoring is essential when analyzing registry-based HIV cohorts. Late HIV diagnosis was strongly associated with increased risks of both AIDS progression and death, highlighting the importance of earlier testing, timely diagnosis, and prompt linkage to care. Appropriate survival methods that accommodate delayed entry and competing risks can provide more accurate estimates of disease progression and mortality in HIV populations.Supplementary InformationThe online version contains supplementary material available at https://doi.org/10.1186/s12879-026-13852-z. Introduction Globally, approximately 1.3 million people acquired HIV in 2023, according to UNAIDS’ Global AIDS Update; recent WHO/UNAIDS fact sheets indicate a similar estimate for 2024. HIV is primarily transmitted through unsafe sexual contact, contaminated blood transfusions, sharing of needles, and from mother to child during childbirth or breastfeeding [1–3]. According to the most recent UNAIDS estimates (2023), approximately 43,000 people were living with HIV in Iran (uncertainty range: 30,000–77,000). Of all people living with HIV in Iran, an estimated 51% were aware of their status, 37% were receiving antiretroviral therapy (ART), and 33% had achieved viral suppression. The epidemic continues to disproportionately affect younger adults in Iran, with sexual transmission accounting for a growing share of new diagnoses [1, 3, 4]. The clinical management of people living with HIV (PLWH) has improved significantly in recent years. Effective antiviral drugs, better treatment adherence, compliance with prevention guidelines, and management of co-infections have enhanced the quality of patient care [5]. In industrialized countries, antiviral drugs have transformed HIV from a deadly disease into a manageable chronic condition [6]. Despite various national efforts in Iran—including harm reduction programs, integration of HIV care into primary healthcare, and mother-to-child transmission screening—the HIV epidemic continues to grow [4]. Previous studies have shown that delays in diagnosis and treatment initiation, as well as co-infections such as tuberculosis, negatively impact survival in HIV-positive individuals [1, 7]. The epidemic continues to disproportionately affect men aged 15–44 years. While injecting drug use remains an important route of HIV transmission, sexual transmission has become increasingly dominant in recent years [3]. In this study, we used data recorded from 2001 to 2022 to investigate AIDS progression and mortality among people living with HIV registered at the Behavioral Disease Counseling Centers (BDCCs) in East Khuzestan, Iran. This study was conducted in East Khuzestan, Iran, where HIV services are delivered through BDCCs, which are established throughout Iran. This retrospective cohort study examines data from HIV-positive individuals in East Khuzestan collected between 2001 and 2022. Because HIV infection occurs before clinical diagnosis, individuals entered observation only after surviving until HIV diagnosis and registration, creating a left-truncated data structure. Furthermore, many participants did not experience AIDS progression or death by the end of follow-up, resulting in right-censored observations. To accurately model these outcomes under such data constraints, we applied competing-risk methods that accommodate both left truncation and right censoring. This framework enables more reliable estimation of AIDS progression and mortality while accounting for delayed entry and incomplete follow-up. Therefore, The present study aimed to evaluate AIDS progression and mortality among people living with HIV while accounting for delayed entry, left truncation, and competing risks. In line with existing evidence and clinical reasoning, we formulated the following hypotheses:Individuals diagnosed late with HIV (baseline CD4 <350 cells/mm³) would have significantly higher hazards of both AIDS progression and death compared to those diagnosed early.The hazards of AIDS progression and death would differ across demographic and clinical covariates, with older age, male sex, and tuberculosis (TB) co-infection hypothesized to increase these risks.The route of HIV transmission would be associated with different survival outcomes, with people who inject drugs and those with unknown transmission routes hypothesized to experience poorer prognoses compared to mother-to-child transmission. Individuals diagnosed late with HIV (baseline CD4 <350 cells/mm³) would have significantly higher hazards of both AIDS progression and death compared to those diagnosed early. Individuals diagnosed late with HIV (baseline CD4 <350 cells/mm³) would have significantly higher hazards of both AIDS progression and death compared to those diagnosed early. The hazards of AIDS progression and death would differ across demographic and clinical covariates, with older age, male sex, and tuberculosis (TB) co-infection hypothesized to increase these risks. The hazards of AIDS progression and death would differ across demographic and clinical covariates, with older age, male sex, and tuberculosis (TB) co-infection hypothesized to increase these risks. The route of HIV transmission would be associated with different survival outcomes, with people who inject drugs and those with unknown transmission routes hypothesized to experience poorer prognoses compared to mother-to-child transmission. The route of HIV transmission would be associated with different survival outcomes, with people who inject drugs and those with unknown transmission routes hypothesized to experience poorer prognoses compared to mother-to-child transmission. Explicitly stating these hypotheses enables a clearer evaluation of the study objectives and facilitates a more rigorous interpretation of the findings. Materials and methods Study design and data sources This retrospective cohort study analyzed data from individuals diagnosed with HIV and registered at BDCC in East Khuzestan, Iran, from March 21, 2001 to March 20, 2022 (corresponding to the Iranian solar calendar). Patient-level data were extracted from medical records and included demographics, dates of HIV diagnosis, AIDS progression, death, and follow-up status. To ensure accurate capture of the diagnosis window, only patients who had a CD4 count measured within three months of their HIV diagnosis were included in the study. The CD4 measurement within 3 months of diagnosis was required because AIDS progression (CD4 < 200 cells/mm³) is a primary outcome of this study. Patients diagnosed with HIV who died before any CD4 measurement were excluded from the cohort. Event definition and competing risks The two primary outcomes were AIDS progression—defined as a CD4 count below 200 cells/mm³—and all-cause mortality. As death may occur before AIDS progression, it was treated as a competing event for that outcome. The competing risks framework provides more accurate estimates of the probability of AIDS progression in the presence of death as a precluding event [8]. Late HIV diagnosis was defined as a baseline CD4 count < 350 cells/mm³, consistent with WHO guidelines. In all regression models, ‘early diagnosis’ (CD4 ≥ 350 cells/mm³) was used as the reference category. Handling left truncation and right censoring The biological time origin for all analyses was the physician-estimated HIV infection date. HIV diagnosis was treated as the delayed-entry (left-truncation) time. Individuals entered the risk set only after surviving from the estimated infection date until diagnosis. Individuals who died or progressed to AIDS before being diagnosed were not recorded in the registry and are therefore missing from the dataset. This creates a left-truncation structure: we only observe those who survived long enough to be diagnosed and have their CD4 measured. To address this, we used left-truncated and right-censored (LTRC) survival models. Therefore, analyses were conducted conditional on survival from the estimated infection date until HIV diagnosis. Right censoring occurred when patients were alive and event-free at the end of follow-up (March 2022). In addition, to reduce potential bias from informative left truncation, we implemented inverse probability weighting (IPW) for the Cox proportional hazards model for death. The probability of inclusion in the analytic cohort (i.e., having a CD4 measurement within 3 months of HIV diagnosis and meeting the study eligibility criteria) was modeled using logistic regression with baseline covariates: age at diagnosis, sex, transmission route, and year of diagnosis. Stabilized weights were derived and incorporated only into the Cox model for death. IPW was not applied to the Fine-Gray model for AIDS, as this model uses internal weighting to account for competing risks. Full details of the IPW procedure are provided in Supplementary S2 (Inverse Probability Weighting (IPW) Details). Accordingly, weighted estimates are intended to represent HIV-infected individuals who survived until diagnosis and met the study eligibility criteria. This approach has been recommended for reducing bias under left-truncated data structures in registry-based survival studies [9] (see Fig. 1). The requirement that patients have a CD4 measurement within 3 months of diagnosis is an inclusion criterion and does not itself create left truncation. All censoring in this study was administrative (right censoring). Administrative censoring occurred at the end of the study period (March 20, 2022) for patients who were alive and event-free. No patients were lost to follow-up in this study, as the registry provided continuous updates until death or the study end. Estimation of HIV infection time The exact date of HIV infection is generally unobservable. However, an estimated date of HIV infection was available in the clinical records and had been determined by treating physicians based on the patient’s clinical history, documented risk exposures, previous HIV testing information when available, and routine clinical assessment. This physician-estimated infection date was used as the biological time origin for survival analyses. Physician-estimated infection dates were available for all patients included in the analysis and were extracted directly from the registry records. The date of HIV diagnosis was treated as the delayed-entry (left-truncation) time, and patients entered the risk set only after surviving from the estimated infection date until diagnosis. Consequently, all survival analyses were performed within a left-truncated and right-censored framework using delayed-entry methods. Statistical analysis Time-to-event was measured from the physician-estimated HIV infection date until the occurrence of AIDS, death, or administrative censoring. All survival analyses were adjusted for left truncation and right censoring (LTRC) using appropriate statistical techniques tailored for such data structures, including delayed entry and inverse probability weighting. The proportion of missing data was low for most variables (< 5%). However, missing values were present for transmission route (14.3%), job (5.8%), and prison history (9.5%). To avoid bias from complete-case analysis or treating ‘unknown’ as a valid category, we performed multiple imputation by chained equations (MICE) for all variables with missing data. Twenty imputed datasets were generated, and all survival models (Cox for death, Fine-Gray for AIDS, and cause-specific Cox) were fitted to each imputed dataset. Results were pooled using Rubin’s rules. The imputation model included all covariates, the event indicators (death and AIDS), and the Nelson-Aalen estimate of the cumulative hazard to improve imputation accuracy. The inverse probability weighting (IPW) procedure (described in the Handling Left Truncation section) was applied to reduce bias from informative left truncation. Survival time was measured from the physician-estimated HIV infection date. HIV diagnosis was treated as the delayed-entry (left-truncation) time, and patients entered the risk set only after surviving until diagnosis. Thus, all analyses were conducted within a left-truncated and right-censored framework, and estimates should be interpreted as conditional on survival until HIV diagnosis. In addition to Fine and Gray’s subdistribution hazards model, cause-specific Cox proportional hazards models were also fitted as a sensitivity analysis. The results of the sensitivity analyses (midpoint imputation for interval-censored AIDS events and Firth penalized cause-specific Cox model for the low-EPV AIDS model) are presented in Supplementary (Table S3. Sensitivity analyses). Both analyses yielded estimates consistent with the primary models, confirming that interval censoring bias is negligible and that the low EPV did not materially affect the estimates. Additionally, cause-specific Cox proportional hazards models were fitted as another sensitivity analysis; the results are presented in Supplementary S1 (Table S1. Cause-specific Cox proportional hazards models for death and AIDS progression) and were consistent in direction and significance with the Fine-Gray subdistribution models. AIDS progression was defined as the first recorded CD4 count below 200 cells/mm³, as information on clinical AIDS-defining conditions was not systematically available in the registry. Because CD4 measurements were obtained at periodic follow-up visits, the exact time of progression to AIDS was interval-censored between the last CD4 measurement ≥ 200 cells/mm³ and the first measurement < 200 cells/mm³. In the primary analysis, the date of the first recorded CD4 count < 200 cells/mm³ was used as the event date, consistent with standard practice in registry-based studies. To evaluate the potential impact of interval censoring, a sensitivity analysis using midpoint imputation was performed in a subset of patients. The results were comparable to those of the primary analysis, indicating that interval-censoring bias was unlikely to materially affect the study findings. The probability of entry (i.e., surviving from HIV infection to diagnosis with CD4 measured within 3 months) was modeled using a logistic regression model with the following baseline covariates: age at diagnosis (continuous), sex, transmission route, and year of diagnosis. The logistic model was specified as:\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\eqalign{ & {\rm{P}}\left( {{\rm{entry = 1|covariates}}} \right){\rm{ = }} \cr & {\rm{logit}}{{\rm{n}}^{{\rm{ - 1}}}}{\rm{(}}{{\rm{\beta }}_{\rm{0}}}{\rm{ + }}{{\rm{\beta }}_{\rm{1}}}{\rm{ \times age + }}{{\rm{\beta }}_{\rm{2}}}{\rm{ \times sex + }}{{\rm{\beta }}_{\rm{3}}}{\rm{ \times transmission + }}{{\rm{\beta }}_{\rm{4}}}{\rm{ \times diagnosis\_year)}} \cr}$$\end{document} Stabilized weights were calculated as:\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\rm{Weight}}\,{\rm{ = }}\,{\rm{P}}\left( {{\rm{entry}}\,{\rm{ = }}\,{\rm{1}}} \right){\rm{/P}}\left( {{\rm{entry}}\,{\rm{ = }}\,{\rm{1|covariates}}} \right)$$\end{document} Weight = P(entry = 1) / P(entry = 1 | covariates). where the numerator is the overall marginal probability of entry into the cohort. Weight diagnostics showed a mean of 1.02 (SD: 0.31), a median of 0.98, and a range of 0.67 to 2.84. No extreme weights (> 4) were observed, indicating good weight performance. In R, delayed-entry survival models were specified using the counting-process formulation Surv(entry_time, exit_time, event), where entry time corresponded to HIV diagnosis and exit time corresponded to AIDS progression, death, or censoring. Overall survival and hazard modeling To comprehensively assess the effects of covariates within a competing-risks framework, two complementary modeling strategies were employed. For AIDS progression, death was treated as a competing event and the Fine–Gray subdistribution hazards model, implemented in the cmprsk package in R, was used as the primary analysis because it directly estimates the effect of covariates on the cumulative incidence of AIDS over time. The Fine–Gray algorithm incorporates an internal weighting mechanism that retains individuals who experience the competing event in the risk set with appropriately reduced weight; therefore, no externally constructed inverse probability weights (IPW) were applied to these models. In contrast, standard Cox proportional hazards regression was used as the primary model for death. To evaluate the robustness of the findings, cause-specific Cox proportional hazards models were also fitted as sensitivity analyses for both AIDS and death, and the results were consistent with the primary analyses (Supplementary S1). IPW was applied only to the Cox models to reduce potential selection bias related to delayed entry and cohort inclusion. It is important to distinguish between these two weighting mechanisms: externally constructed IPW was used in Cox models, whereas the Fine–Gray model uses internal weighting inherent to its competing-risks algorithm [8]. For death (which has no competing event), standard Cox proportional hazards regression was used as the primary model. For AIDS progression (with death as a competing risk), the Fine-Gray subdistribution hazard model was used as the primary model because it directly estimates the effect of covariates on the cumulative incidence of AIDS over time. The Fine-Gray subdistribution hazard ratio quantifies the relative change in the cumulative probability of AIDS over time, accounting for the fact that death precludes AIDS. In contrast, the cause-specific hazard ratio (from Cox models) estimates the effect of a covariate on the instantaneous hazard of an event among individuals who are still event-free (i.e., have not yet experienced any event). These two quantities answer different clinical questions: the subdistribution hazard is relevant for prognosis and cumulative risk (e.g., “What is the probability of developing AIDS over time, given that death may occur first?“), while the cause-specific hazard is relevant for understanding the instantaneous rate of events in a hypothetical scenario where competing events are removed. We present both for completeness, with Fine-Gray as the primary analysis for AIDS and Cox as the primary analysis for death. Nonparametric and parametric distribution estimation To estimate survival from the physician-estimated HIV infection date within a left-truncated framework, two complementary approaches were applied. First, the Nonparametric Maximum Likelihood Estimator (NPMLE), specifically the Aalen–Johansen estimator, was used under left truncation and right censoring conditions. This estimator, implemented via the survival package in R, generalizes the Kaplan–Meier method to competing risks.This method appropriately accounts for delayed entry and right censoring in survival data. For comparison, a parametric estimator based on the Special Exponential Family (SEF) was also fitted using the flexsurv package [10]. Model comparison was carried out using the Akaike Information Criterion (AIC), allowing assessment of model fit across approaches. Visualizations included confidence bands for the cumulative distribution functions (CDFs) and cumulative incidence curves to support interpretability of the survival experience across methods. Model covariates Multivariable Cox proportional hazard models were constructed to evaluate factors associated with survival outcomes, adjusting for several baseline covariates. These included age at diagnosis (categorized as < 30, 30–40, 40–50, and > 50 years), gender, baseline CD4 count (< 200, 200–350, and > 350 cells/mm³), marital status, tuberculosis co-infection (TB), and the route of HIV transmission, such as injection drug use or mother-to-child transmission. HIV diagnosis timing was classified as early or late, with late diagnosis defined by a baseline CD4 count below 350 cells/mm³. To ensure the validity of the Cox proportional hazards models, the proportional hazards assumption was evaluated using Schoenfeld residuals. Collinearity among covariates was assessed using variance inflation factors (VIF). All VIF values were below 2, indicating no significant multicollinearity. This was particularly important given the small cell sizes in some transmission route categories (e.g., mother-to-child transmission, n = 3, which was collapsed into ‘other’). In addition, we included diagnosis period as a binary covariate (2001–2009 vs. 2010–2022) to account for potential changes in HIV care, ART access, and testing campaigns over time. The full multivariable model included 14 parameters (age: 3, CD4: 1, sex: 1, marital status: 1, education: 1, transmission route: 2, TB co-infection: 1, job: 2, prison history: 1, and diagnosis period: 1). With 103 deaths and 76 AIDS events, the events-per-variable (EPV) ratio was approximately 7.4 for death and 5.4 for AIDS. Although these values are below the conventional threshold of 10, previous simulation studies have shown that EPV values above 5 may still provide reliable estimates in many settings [11]. To evaluate model stability, sensitivity analyses using Firth’s penalized cause-specific Cox regression were conducted and yielded results consistent with the primary analyses. Nevertheless, estimates with wide confidence intervals should be interpreted with caution [1, 4, 7]. Software and packages All statistical analyses were performed in R (version 4.4.1) using specialized packages tailored for survival analysis under left truncation and competing risks. Cox proportional hazards models and NPMLE estimates were implemented via the survival package. The cmprsk package was used for Fine and Gray competing risks models, and riskRegression provided IPW adjustments to reduce selection bias from delayed entry [12]. Parametric modeling with the Special Exponential Family (SEF) was conducted using flexsurv, while truncation diagnostics, including Kendall’s tau, were carried out with SurvTrunc. Visualization of results was facilitated by ggplot2 and survminer. Fig. 1Illustration of left truncation and right censoring in the study cohort. The biological time origin is the physician-estimated HIV infection date. Individuals are observed only if they survive until HIV diagnosis (delayed-entry time). Individuals who died or progressed to AIDS before diagnosis are not observed in the registry and are therefore left truncated. Right censoring occurs when no event is observed by the end of the study period. The requirement for a CD4 measurement within 3 months of diagnosis is an inclusion criterion and does not constitute a separate entry time Illustration of left truncation and right censoring in the study cohort. The biological time origin is the physician-estimated HIV infection date. Individuals are observed only if they survive until HIV diagnosis (delayed-entry time). Individuals who died or progressed to AIDS before diagnosis are not observed in the registry and are therefore left truncated. Right censoring occurs when no event is observed by the end of the study period. The requirement for a CD4 measurement within 3 months of diagnosis is an inclusion criterion and does not constitute a separate entry time Ethics statement This study was approved by the Research Ethics Committee of Behbahan Faculty of Medical Sciences (IR.BEH.REC.1401.064). All data were obtained from routine clinical records and anonymized prior to analysis. Due to the retrospective nature of the study and use of de-identified data, the requirement for informed consent was waived by the ethics committee. Results Data from 189 patients between 2001 and 2022, whose first CD4 count was measured within 3 months of diagnosis, were reviewed. During follow-up after cohort entry, 103 patients died and 76 patients progressed to AIDS. No patients were lost to follow-up during the study period. All censoring was administrative. The average age of these patients was 45.01 ± 10.47 years, and 160 (84.7%) were men. Of the 189 patients, 103 (54.5%) were diagnosed late and 86 (45.5%) were diagnosed early. The average age of people with a late diagnosis was 48.98 ± 10.80 years, significantly higher than people with a timely diagnosis at 40.26 ± 10.94 years (p < 0.001). The median survival time was significantly longer in the early diagnosis group (164.7 months, 95% CI: 121.0–208.4) than in the late diagnosis group (104.8 months, 95% CI: 90.2–119.4; log rank p < 0.001). All survival times were estimated from the physician-estimated HIV infection date, with HIV diagnosis treated as delayed entry. Figure 2 presents the cumulative distribution function for time from the physician-estimated HIV infection date to death, estimated within a left-truncated and right-censored framework. The NPMLE estimate (black line) with 95% confidence bands shows that the median survival time was 126 months (95% CI: 84–167). The parametric SEF model (red dashed line) yielded similar estimates, with an AIC of 401.7 compared to 390.5 for the NPMLE, indicating a slightly better fit for the nonparametric approach. Both methods properly account for right-censored observations. Table 1 presents the baseline characteristics of patients stratified by timing of HIV diagnosis. Compared to those with an early diagnosis, patients with late diagnosis were older on average (49.0 vs. 40.3 years, p < 0.001) and more likely to be female (24.3% vs. 4.7%, p < 0.001). The prevalence of injecting drug use as the transmission route was markedly higher among the early diagnosis group (94.2% vs. 26.2%), while sexual transmission was more common among those diagnosed late (45.6% vs. 8.1%). The late-diagnosis group had a significantly higher proportion of individuals classified as literate compared to the early diagnosis group (53.4% vs. 18.6%, p < 0.001). Marital status and TB co-infection did not differ significantly between groups. Table 1Baseline characteristics of patients with early vs. late HIV diagnosis (n = 189)CharacteristicEarly diagnosis (n = 86)Late diagnosis (n = 103)Missing, n (%)Age, mean ± SD40.3 ± 10.949.0 ± 10.80Sex0Female4 (4.7%)25 (24.3%)Male82 (95.3%)78 (75.7%)Marital status0Married42 (48.8%)41 (39.8%)Single44 (51.2%)62 (60.2%)Education0Illiterate70 (81.4%)48 (46.6%)Literate16 (18.6%)55 (53.4%)Transmission route27 (14.3%)Injecting drug use81 (94.2%)27 (26.2%)Sexual contact7 (8.1%)47 (45.6%)Mother-to-child1 (1.2%)2 (1.9%)Unknown/other0 (0%)27 (26.2%)TB co-infection0No84 (97.7%)96 (93.2%)Yes2 (2.3%)7 (6.8%)Job11 (5.8%)Employed38 (44.2%)41 (39.8%)Unemployed44 (51.2%)55 (53.4%)Unknown4 (4.6%)7 (6.8%)Prison history18 (9.5%)No70 (81.4%)80 (77.7%)Yes8 (9.3%)13 (12.6%)Unknown8 (9.3%)10 (9.7%)† ART status (ever received)58 (67.4%)69 (67.0%)0† ART status available only overall; percentages calculated based on non-missing values Table 1Baseline characteristics of patients with early vs. late HIV diagnosis (n = 189)CharacteristicEarly diagnosis (n = 86)Late diagnosis (n = 103)Missing, n (%)Age, mean ± SD40.3 ± 10.949.0 ± 10.80Sex0Female4 (4.7%)25 (24.3%)Male82 (95.3%)78 (75.7%)Marital status0Married42 (48.8%)41 (39.8%)Single44 (51.2%)62 (60.2%)Education0Illiterate70 (81.4%)48 (46.6%)Literate16 (18.6%)55 (53.4%)Transmission route27 (14.3%)Injecting drug use81 (94.2%)27 (26.2%)Sexual contact7 (8.1%)47 (45.6%)Mother-to-child1 (1.2%)2 (1.9%)Unknown/other0 (0%)27 (26.2%)TB co-infection0No84 (97.7%)96 (93.2%)Yes2 (2.3%)7 (6.8%)Job11 (5.8%)Employed38 (44.2%)41 (39.8%)Unemployed44 (51.2%)55 (53.4%)Unknown4 (4.6%)7 (6.8%)Prison history18 (9.5%)No70 (81.4%)80 (77.7%)Yes8 (9.3%)13 (12.6%)Unknown8 (9.3%)10 (9.7%)† ART status (ever received)58 (67.4%)69 (67.0%)0† ART status available only overall; percentages calculated based on non-missing values Baseline characteristics of patients with early vs. late HIV diagnosis (n = 189) † ART status available only overall; percentages calculated based on non-missing values Fig. 2Cumulative distribution function for time from the physician-estimated HIV infection date to death. The black line shows the NPMLE estimate (Aalen–Johansen estimator) with 95% confidence bands (gray shaded area). The red dashed line shows the parametric estimate based on the special exponential family (SEF) model. The x-axis represents time since the physician-estimated HIV infection date (months), and the y-axis represents the cumulative probability of death. Estimates were obtained within a left-truncated and right-censored framework that accounts for delayed entry at HIV diagnosis. The median survival time was 126 months (95% CI: 84–167) Cumulative distribution function for time from the physician-estimated HIV infection date to death. The black line shows the NPMLE estimate (Aalen–Johansen estimator) with 95% confidence bands (gray shaded area). The red dashed line shows the parametric estimate based on the special exponential family (SEF) model. The x-axis represents time since the physician-estimated HIV infection date (months), and the y-axis represents the cumulative probability of death. Estimates were obtained within a left-truncated and right-censored framework that accounts for delayed entry at HIV diagnosis. The median survival time was 126 months (95% CI: 84–167) Figure 3 presents the cumulative incidence curves for AIDS and the composite endpoint of death or AIDS, estimated using the Aalen-Johansen estimator. Because our data are left-truncated, these curves represent conditional probabilities given survival to HIV diagnosis (the observed entry time). The lower curve shows the cumulative incidence of AIDS, and the upper curve shows the cumulative incidence of the composite endpoint (death or AIDS). The difference between the curves represents the cumulative incidence of death without a prior AIDS diagnosis. At all time points, the probability of death exceeded the probability of AIDS, reflecting the high prevalence of late diagnosis in our cohort where some patients may die before AIDS can be clinically confirmed. Fig. 3Cumulative incidence curves for AIDS and the composite endpoint of AIDS or death. The lower curve shows the cumulative incidence of AIDS, and the upper curve shows the cumulative incidence of the composite endpoint (death or AIDS). The vertical distance between the two curves at any given time point represents the cumulative incidence of death without prior AIDS diagnosis. Because our data are left-truncated, these curves represent conditional probabilities given survival to HIV diagnosis (the delayed-entry time). Curves were estimated using the Aalen-Johansen estimator for left-truncated and right-censored data Cumulative incidence curves for AIDS and the composite endpoint of AIDS or death. The lower curve shows the cumulative incidence of AIDS, and the upper curve shows the cumulative incidence of the composite endpoint (death or AIDS). The vertical distance between the two curves at any given time point represents the cumulative incidence of death without prior AIDS diagnosis. Because our data are left-truncated, these curves represent conditional probabilities given survival to HIV diagnosis (the delayed-entry time). Curves were estimated using the Aalen-Johansen estimator for left-truncated and right-censored data According to Table 2, Cumulative incidence functions (CIFs) and their 95% confidence intervals were estimated at prespecified time points (30, 60, 90, 120, 150, and 180 months) using bootstrap resampling. The probability of death at all times was higher than the probability of observing AIDS. This pattern may be partly explained by the high prevalence of late diagnosis in our cohort, since some patients may die before an AIDS diagnosis can be clinically confirmed. However, other factors such as incomplete clinical assessments, comorbidities, or under-reporting of AIDS-defining conditions may also contribute. As a result, some people may experience the event of death before the diagnosis of AIDS is certain for them. Table 2Cumulative incidence probabilities (with 95% confidence intervals) of AIDS, death, and the composite endpoint (AIDS or death) at 30, 60, 90, 120, 150, and 180 months since the physician-estimated HIV infection date, as well as the probability of remaining free of both events (Survival)Months after estimated HIV infectionAIDS (95% CI)Death (95% CI)AIDS or Death (95% CI)Survival (95% CI)300.086 (0.054–0.133)0.186 (0.138–0.246)0.272 (0.215–0.338)0.728 (0.662–0.785)600.144 (0.102–0.200)0.342 (0.279–0.411)0.486 (0.417–0.555)0.514 (0.445–0.583)900.160 (0.115–0.217)0.396 (0.330–0.465)0.556 (0.486–0.623)0.444 (0.377–0.514)1200.203 (0.153–0.264)0.403 (0.337–0.473)0.606 (0.537–0.671)0.394 (0.329–0.463)1500.258 (0.202–0.323)0.408 (0.342–0.478)0.666 (0.598–0.728)0.334 (0.272–0.402)1800.324 (0.263–0.392)0.411 (0.345–0.481)0.735 (0.669–0.792)0.265 (0.208–0.331) Table 2Cumulative incidence probabilities (with 95% confidence intervals) of AIDS, death, and the composite endpoint (AIDS or death) at 30, 60, 90, 120, 150, and 180 months since the physician-estimated HIV infection date, as well as the probability of remaining free of both events (Survival)Months after estimated HIV infectionAIDS (95% CI)Death (95% CI)AIDS or Death (95% CI)Survival (95% CI)300.086 (0.054–0.133)0.186 (0.138–0.246)0.272 (0.215–0.338)0.728 (0.662–0.785)600.144 (0.102–0.200)0.342 (0.279–0.411)0.486 (0.417–0.555)0.514 (0.445–0.583)900.160 (0.115–0.217)0.396 (0.330–0.465)0.556 (0.486–0.623)0.444 (0.377–0.514)1200.203 (0.153–0.264)0.403 (0.337–0.473)0.606 (0.537–0.671)0.394 (0.329–0.463)1500.258 (0.202–0.323)0.408 (0.342–0.478)0.666 (0.598–0.728)0.334 (0.272–0.402)1800.324 (0.263–0.392)0.411 (0.345–0.481)0.735 (0.669–0.792)0.265 (0.208–0.331) Cumulative incidence probabilities (with 95% confidence intervals) of AIDS, death, and the composite endpoint (AIDS or death) at 30, 60, 90, 120, 150, and 180 months since the physician-estimated HIV infection date, as well as the probability of remaining free of both events (Survival) Using Schoenfield’s residuals test, the PH hypothesis was checked, and this hypothesis was valid for all covariates with P > 0.1. The results of Cox regression are shown in Table 3. The hazard of death was almost twice as high for the late diagnosis group as for the early diagnosis group (HR = 2.1, 95% CI: 1.38–3.21). For the age group over 50 years compared to those under 30, the hazard of death was 2.4 times higher (HR = 2.4, 95% CI: 1.57–3.72). The hazard of death for men was almost three times that of women (HR = 2.8, 95% CI: 1.23–6.45). The hazard of death in singles is almost twice that of married people (HR = 1.8, 95% CI: 1.10–2.69). As shown in Table 3, transmission route was associated with death and AIDS outcomes, with injecting drug use as the reference category. Tuberculosis co-infection also nearly doubled the hazard of death (HR = 2.02, 95% CI: 1.45–2.83). In the late diagnosis group, the hazard of AIDS progression was 2.4 times higher (HR = 2.4, 95% CI: 1.92–3.91). Compared to patients younger than 30 years, the hazard of AIDS was higher in those aged 30–40 years (HR = 2.1, 95% CI: 1.32–3.91), 40–50 years (HR = 2.7, 95% CI: 1.01–4.25), and above 50 years (HR = 2.2, 95% CI: 1.31–3.74). Men also had an increased hazard of AIDS compared to women (HR = 1.9, 95% CI: 1.10–3.38). Similarly, unmarried individuals had a higher hazard of AIDS progression compared to married individuals (HR = 1.7, 95% CI: 1.09–2.77). Finally, tuberculosis co-infection was associated with more than a two-fold increase in the hazard of AIDS progression (HR = 2.3, 95% CI: 1.03–5.30). These associations were statistically significant at the 0.05 level. The full results of the cause-specific hazards models are presented in Supplementary S1. Sensitivity analyses using cause‑specific hazards models (full results provided in Supplementary S1) yielded associations that were consistent in direction and statistical significance with those obtained from the Fine‑Gray subdistribution models, even though these two approaches estimate different quantities. Table 3Primary (Cox for death; Fine-Gray for AIDS) and sensitivity (cause-specific Cox) models for factors associated with death and AIDS in people living with HIVVariableDeathAIDSHR95% CIp-valueHR95% CIp-valueBaseline CD4 (ref: ≥350, Early)< 350 (Late diagnosis)2.101.38–3.21< 0.0012.391.92–3.91< 0.001Age (ref: <30 years) p-overall < 0.001 p-overall < 0.001 30–40 years1.760.93–3.320.0852.071.32–3.910.00140–50 years2.231.01–4.920.0472.701.01–4.250.046> 50 years2.421.57–3.72< 0.0012.211.31–3.740.002Sex (ref: Female)Male2.841.23–6.450.0141.931.10–3.380.022Marital status (ref: Married)Single1.771.10–2.690.0191.731.09–2.770.020Education (ref: Illiterate)Literate1.240.72–2.130.4301.200.82–1.750.310*Transmission route (ref: Injecting drug use) p-overall = 0.041 p-overall = 0.67 Sexual contact0.500.24–1.050.0681.980.45–8.700.37Unknown0.660.43–1.010.0581.260.54–2.940.59TB co-infection (ref: No)Yes2.021.45–2.83< 0.0012.341.03–5.300.041Job (ref: Employed) p-overall = 0.72 p-overall = 0.45 Unemployed0.970.62–1.520.9101.320.81–2.150.260Unknown0.880.44–1.780.7200.910.55–1.500.710Prison history (ref: No)Yes1.210.53–2.710.6501.120.54–2.320.760Diagnosis period (ref: 2001–2009)2010–20221.150.78–1.690.480.920.64–1.320.65*The mother-to-child transmission category (n=3) was collapsed into 'other' due to small sample size and unstable estimates Table 3Primary (Cox for death; Fine-Gray for AIDS) and sensitivity (cause-specific Cox) models for factors associated with death and AIDS in people living with HIVVariableDeathAIDSHR95% CIp-valueHR95% CIp-valueBaseline CD4 (ref: ≥350, Early)< 350 (Late diagnosis)2.101.38–3.21< 0.0012.391.92–3.91< 0.001Age (ref: <30 years) p-overall < 0.001 p-overall < 0.001 30–40 years1.760.93–3.320.0852.071.32–3.910.00140–50 years2.231.01–4.920.0472.701.01–4.250.046> 50 years2.421.57–3.72< 0.0012.211.31–3.740.002Sex (ref: Female)Male2.841.23–6.450.0141.931.10–3.380.022Marital status (ref: Married)Single1.771.10–2.690.0191.731.09–2.770.020Education (ref: Illiterate)Literate1.240.72–2.130.4301.200.82–1.750.310*Transmission route (ref: Injecting drug use) p-overall = 0.041 p-overall = 0.67 Sexual contact0.500.24–1.050.0681.980.45–8.700.37Unknown0.660.43–1.010.0581.260.54–2.940.59TB co-infection (ref: No)Yes2.021.45–2.83< 0.0012.341.03–5.300.041Job (ref: Employed) p-overall = 0.72 p-overall = 0.45 Unemployed0.970.62–1.520.9101.320.81–2.150.260Unknown0.880.44–1.780.7200.910.55–1.500.710Prison history (ref: No)Yes1.210.53–2.710.6501.120.54–2.320.760Diagnosis period (ref: 2001–2009)2010–20221.150.78–1.690.480.920.64–1.320.65*The mother-to-child transmission category (n=3) was collapsed into 'other' due to small sample size and unstable estimates Primary (Cox for death; Fine-Gray for AIDS) and sensitivity (cause-specific Cox) models for factors associated with death and AIDS in people living with HIV *The mother-to-child transmission category (n=3) was collapsed into 'other' due to small sample size and unstable estimates Discussion This is one of the few registry-based survival studies in Iran to comprehensively investigate late HIV diagnosis as a key risk factor for both AIDS and mortality using left-truncated and right-censored (LTRC) methods within a competing risks framework. The first study addressing this issue in Iran was conducted by Mohammadi et al. in 2021 [1]. In this study, we found that late diagnosis, older age, male sex, being unmarried, injection drug use, and TB co-infection were associated with higher hazards. Death may occur before AIDS diagnosis for several reasons. One important reason is the lack of timely laboratory testing. Patients may not seek care or may refuse testing. Consequently, delayed diagnosis and ART initiation can increase mortality and disease transmission. Therefore, we investigated the results of late diagnosis on the survival of patients in several different ways. For this, we investigated AIDS progression and mortality using a left-truncated framework in which HIV diagnosis was treated as delayed entry. Despite a smaller sample size, our study yielded findings similar to Mohammadi et al. (2021), but with a stronger statistical approach that reduces selection bias from left truncation [1]. Our definition of AIDS based solely on CD4 count < 200 cells/mm³ (immunological AIDS) has important implications for comparability with other studies. Many previous HIV cohort studies, particularly those from earlier eras or resource-limited settings, have used clinical AIDS-defining events (e.g., opportunistic infections, wasting syndrome, Kaposi’s sarcoma) as the primary endpoint, either alone or in combination with CD4 criteria. Studies that rely only on clinical AIDS criteria may identify different patient populations and report different incidence rates and risk factor associations compared to our immunological definition. Conversely, studies that use only CD4 criteria may miss patients who develop clinical AIDS without a documented CD4 decline below 200 (e.g., due to infrequent monitoring). Therefore, our findings are most directly comparable to studies that also used immunological criteria for AIDS definition. Future research should incorporate both immunological and clinical endpoints to facilitate broader comparability and provide a more complete picture of HIV progression. Interestingly, a considerable proportion of deaths occurred without a prior AIDS diagnosis, which may reflect opportunistic infections that were not formally documented as AIDS events, comorbidities such as tuberculosis or hepatitis, drug overdose among injection drug users, or incomplete documentation of AIDS-defining conditions. In this study we found that the probability of death at different times was higher than the probability of observing AIDS. This pattern may be partly related to the high prevalence of late diagnosis in our cohort, as some patients may die before AIDS is clinically confirmed, but other explanations such as under-reporting or competing comorbidities may also contribute. We also showed that the hazard of AIDS and death in the group of people with late diagnosis was more than double that of people with timely diagnosis. During the study period (2001–2022), access to ART in Iran increased substantially, particularly after 2010 with the scale-up of national HIV programs. Expanded ART coverage may have prolonged survival even among those diagnosed late, while testing campaigns and stigma reduction efforts could have improved earlier diagnosis and treatment adherence, thereby modifying the observed trends in AIDS and mortality. Older individuals are more likely to be diagnosed late and to experience adverse outcomes such as AIDS progression and death. Studies suggest that older patients have a lower risk perception of HIV and are, therefore, less likely to be tested for HIV [13] Late diagnosis is one of the important factors of mortality in the elderly [14]. Consistent with previous studies, men were less likely to seek healthcare services, and those who inject drugs—predominantly male—had a higher risk of death. Studies have reported that the likelihood of late diagnosis among people who inject drugs (PWID) is nearly twice that of other transmission groups [15, 16]. As we have shown, the risk of death for these people is higher than for other methods of disease transmission. Studies showed that the probability of late diagnosis in PWID was twice as high as in other people [1, 17]. Due to severe social discrimination and stigma against drug abuse and HIV in Iran, PWID avoids seeking medical services, including HIV testing. The literature has established that ART is less prevalent in PWID than in people who do not inject drugs. In addition, in the counties that have free health services for HIV-positive patients, the use of medical care is very low due to the social situations and family problems of the patients [18]. Simultaneous infection with tuberculosis was another risk factor of death and accelerated progression to AIDS. TB co-infection has also been associated with a higher risk of late HIV diagnosis, possibly due to overlapping clinical presentations or delayed access to care [19]. In our models, individuals with mother-to-child transmission had the lowest relative hazards of AIDS progression and death compared to other transmission groups. However, this finding should be interpreted cautiously because the number of individuals with mother-to-child transmission in our cohort was very small. This finding is consistent with the expectation that effective prevention and screening programs in this group may lead to earlier detection and more favorable outcomes. In Iran, good prevention, care and treatment services are provided for mothers and children [1]. These findings have important implications for public health policymakers and HIV care providers in Iran. The percentage of late diagnoses is high and needs more attention. Policymakers should design programs to screen high-risk subgroups and encourage them to seek early diagnosis and treatment. Iranian policymakers should increase HIV testing so that a significant percentage of HIV-infected individuals receive HIV testing [20]. Overall, these findings emphasize the urgent need for earlier HIV testing, targeted programs for injection drug users, continued expansion of ART coverage, and strengthened HIV surveillance and clinical information systems to reduce premature mortality and improve the completeness of AIDS-related outcome documentation. A key strength of this study is the use of left-truncated and right-censored (LTRC) survival models, which appropriately account for the fact that only individuals who survived until HIV diagnosis and study entry were observed. Individuals who died before diagnosis were not represented in the registry, and delayed entry could otherwise introduce selection bias. LTRC methods help reduce this bias and provide estimates that are conditional on survival until HIV diagnosis. The biological time origin was the physician-estimated HIV infection date, while HIV diagnosis was treated as delayed entry, ensuring that survival estimates appropriately accounted for left truncation. Like all studies, this study has several limitations. First, it relied on retrospective registry data, which may be subject to recording errors or missing information. Although we used survival analysis methods that account for left truncation to reduce selection bias, unmeasured confounding remains a limitation. Specifically, some key variables, such as baseline viral load (measured at or near the time of HIV diagnosis) and socioeconomic status, were not available in the registry data. These factors could act as potential confounders of the associations observed between baseline demographic/clinical characteristics and subsequent outcomes. Viral load measurements after treatment initiation would represent intermediate variables and are not considered confounders in this context. Regarding ART adherence, although this information is recorded in the national data-gathering software, it was not accessible to us at the time of data collection for this study. Future research with broader access to these variables can provide a more comprehensive assessment. Furthermore, treatment protocols and access to ART may have evolved over the study period (2001–2022), potentially influencing survival outcomes in ways not fully captured in our models. These limitations should be considered when interpreting our findings and designing future research. To handle missing data, particularly the 14.3% missingness in transmission route, we used multiple imputation (MICE). However, some residual bias may remain if data were not missing at random. A limitation of this study is that the date of HIV infection was not directly observed but was based on physician-estimated infection dates recorded in the registry. Although these estimates were routinely used in clinical practice and allowed implementation of left-truncated survival methods, some degree of measurement error is inevitable. Misclassification of infection timing could affect the estimated duration of delayed entry and may have introduced residual bias into the survival analyses. Future studies using biological markers or more precise methods for estimating infection timing may help further reduce this source of uncertainty. Another limitation is the lack of several potentially important prognostic variables in the registry dataset. Baseline viral load, socioeconomic indicators, detailed ART adherence information, and precise time-dependent ART data (including exact treatment initiation dates relative to AIDS progression) were not available for analysis. Consequently, we were unable to adjust for these factors in the multivariable models or evaluate their independent effects on disease progression and mortality. These variables are well-established determinants of HIV outcomes and may have confounded some of the observed associations. Furthermore, because ART initiation relative to AIDS progression could not be reliably determined, no causal inferences regarding the effect of ART on survival outcomes can be made. Future studies with more comprehensive clinical and treatment data are needed to address these limitations [21]. A limitation of our study is that AIDS progression was defined only by CD4 count < 200 cells/mm³. While this threshold is widely accepted, other clinical criteria for AIDS could not be incorporated due to lack of systematic recording in the dataset. Furthermore, since CD4 counts were measured periodically, the exact timing of CD4 decline below 200 was interval-censored. In our analysis we used the date of the first CD4 < 200 record, which may introduce some imprecision, although the relatively frequent CD4 monitoring in our setting (typically every 6–12 months) likely minimized bias. Importantly, viral load data, ART adherence information, and socioeconomic indicators were not available in the registry. These factors are well-established predictors of HIV outcomes and may confound the associations observed in our study. Future prospective cohort studies in Iran should incorporate these variables to enable a more precise estimation of disease progression and treatment effects. A methodological limitation of this study is that continuous risk factors such as age and CD4 count were categorized. Although categorization improves clinical interpretability and aligns with WHO definitions and previous studies in Iran [1, 6], we acknowledge that this approach may reduce statistical power and mask non-linear relationships. The reviewer correctly notes that restricted cubic splines would provide a more nuanced characterization of these effects. Future studies with larger sample sizes should consider flexible modeling approaches, such as restricted cubic splines, to capture continuous effects more accurately and to explore potential non-linear associations between these variables and HIV outcomes. Another limitation is potential outcome misclassification. Some patients classified as ‘death without AIDS’ may in fact have had undiagnosed AIDS at the time of death, particularly if AIDS-defining illnesses or CD4 measurements were missing close to death. This may have led to an underestimation of AIDS incidence and an overestimation of direct mortality in our cohort. We acknowledge that more sophisticated methods for interval-censored competing risks data exist. However, given the relatively short monitoring intervals (6–12 months) compared to the median follow-up (> 8 years), the bias introduced by treating the event time as the date of first recorded CD4 < 200 is likely minimal. Future studies with larger sample sizes should consider interval-censored competing risks models. Despite these limitations, an important strength of our study is the use of routinely collected registry data to investigate HIV progression and mortality at the population level. Registry-based and large-scale observational datasets have increasingly been used in Iranian health research to evaluate disease patterns, estimate prognostic outcomes, and develop evidence-based public health strategies across different clinical domains [22–25]. These experiences support the feasibility and value of using real-world data for epidemiological research in Iran and reinforce the methodological framework applied in the present study. In our analytical framework, HIV diagnosis was treated as the delayed-entry time rather than the biological time origin, allowing survival estimates to be interpreted conditional on survival until diagnosis. 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