{'fraction_non_alphanumeric': 0.03709422011084719, 'fraction_numerical': 0.026563737133808392, 'mean_word_length': 5.1002173388070515, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 2, 'https://': 0, 'lorem ipsum': 0, 'www.': 3, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 23, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Sex stratification of the trends and risk of mortality among individuals living with HIV under different transmission categories

We retrospectively examined 33,142 persons living with HIV (PLWH) in Taiwan from a nationwide database to assess sex-stratified trends and risk of all-cause mortality under different transmission categories from 1984 to 2016. Overall, 61.25% were men who have sex with men (MSM), 14.37% were men who have sex with women (MSW), 18.32% were male persons who inject drugs (M-PWID), 3.30% were women who have sex with men (WSM), and 2.74% were female PWID (F-PWID). All-cause mortality (per 100 person-years) among heterosexual people and PWID was higher in men (4.04 and 3.39, respectively) than in women (2.93 and 2.18, respectively). In each sex-stratified transmission category, the all-cause mortality reduced substantially from 1984–1996 to 2012–2016, but evolved distinctly from 2007–2011 to 2012–2016. Since 2007–2011, the decline in all-cause mortality has slowed notably in the groups with sexually transmitted HIV, but has increased in PWID, surpassing even that among groups with sexually transmitted HIV in 2012–2016. PLWH with sexually transmitted HIV had lower risks of all-cause mortality than PWID, regardless of sex. Sex and transmission category did not interact significantly on all-cause mortality. Understanding the reasons for the distinct evolving trends of all-cause mortality in each transmission category serves as a reference for developing strategies to reduce mortality in PLWH in Taiwan further.

www.nature.com/scientificreports/ universal access to free ART in 1997, and the nationwide initiation of a program offering free anonymous counseling and HIV testing services to sexually active populations in 1997 6,7 . Between the mid-2000s and the 2010s, another series of policies was implemented: an HIV case management program in 2007, the initiation of ART at higher CD4 + -count thresholds in 2013, and the introduction of a single-tablet regimen in 2016. However, no studies have employed nationwide surveillance data in examining the mortality trends among PLWH in Taiwan since the mid-2000s. Differences in mortality between different transmission categories (i.e., men who have sex with men [MSM], persons who inject drugs [PWID], and heterosexual people) among PLWH are a subject of debate and concern [8][9][10][11] . Depending on the transmission category, PLWH have specific lifestyle or sociodemographic characteristics that are significantly associated with their mortality risk [8][9][10][11] . Compared with individuals infected through sexual contact, those infected through intravenous drug use have a significantly higher risk of all-cause mortality 6,8,11,12 . This includes mortality attributable to external causes, particularly overdose and suicide 9,10,13 , as well as virological or immunological failure 12 or non-AIDS infectious diseases 14 . Assessments of differences in mortality between MSM and men who have sex with women (MSW) have yielded conflicting results. Some reports have indicated that MSM have higher survival rates than MSW due to better adherence to ART 6,15-17 , whereas two retrospective cohort studies, conducted in Brazil 18 and Denmark 19 , respectively, did not support a difference in mortality between MSM and MSW.
Notably, differences in mortality between different transmission categories may be confounded or modified by sex. Studies conducted in Europe 20 , China 15,21 , Kenya 22 , and South Africa 23 have reported that female PLWH have a lower risk of mortality than male PLWH. This is possibly because of women's better adherence to ART 15,21 , lower rate of substance use 24 , or more favorable immune response to combined ART (cART) 25 . Therefore, a lower proportion of HIV acquisition through injecting drugs in women may explain potential differences in mortality between transmission categories 26,27 . However, no sex differences in all-cause mortality were observed in the United States or Canada 20 . Moreover, differences in mortality by transmission category may also be modified by sex differences. A study determined that compared with male PWID, female PWID were more likely to have high-risk sex 28 , thereby increasing their risk of mortality from sexually transmitted diseases such as hepatitis. A cohort study conducted in Europe found greater sex differences in all-cause mortality among heterosexual people than among PWID (interaction P = 0.043) 20 . However, a retrospective cohort study conducted in Puerto Rico in 2003-2014 revealed that the relative risk of mortality between PWID and heterosexual people was comparable among the sexes 29 . Given that the sex distribution of heterosexual people and PWID can differ considerably 26,27 , sex-stratified analyses are warranted to quantify mortality among PLWH under distinct transmission categories, as well as to address persistent disparities or health inequities more systematically.
In this retrospective nationwide cohort study, we first explored trends in overall and sex-stratified all-cause mortality among PLWH in Taiwan under various transmission categories between 1984 and 2016. We then estimated the differences in overall and sex-stratified all-cause mortality between different transmission categories. Baseline sociodemographic characteristics among various transmission categories, overall and by sex. The baseline sociodemographic characteristics of the patient groups are summarized in Table 1.
Among the transmission categories, significant sociodemographic, specimen source, and geographic differences were observed. After stratification by sex, the sociodemographic characteristics and specimen sources of male PLWH exhibited a similar distribution to that of the overall study population.
Overall all-cause mortality in various transmission categories. Overall, the median follow-up duration was 6.17 years (interquartile range [IQR] = 8). The median follow-up duration for MSM was significantly shorter than that for heterosexual people and PWID (P < 0.001, Table 2). The differences among transmission categories observed during follow-up were comparable among sexes.
Evolving trends of all-cause mortality in various transmission categories across the four study periods by sex. In both sexes, the trend of all-cause mortality in different at-risk subgroups was similar to that for the overall cohort; however, mortality incidence was lower in women than in men.
In men, the all-cause mortality (per 100 person-years) was the highest in 1984-1996 for groups infected through sexual contact (    Key population-level variations in all-cause mortality. Among all PLWH, with PWID as the reference category, the crude hazard ratio (cHR) for all-cause mortality was significantly reduced for MSM (cHR: 0.42, 95% CI 0.39-0.45, P < 0.001). The same was true for the adjusted HR (aHR; 0.34, 95% CI 0.32-0.38, P < 0.001). The cHR of all-cause mortality for heterosexual people, with PWID as the reference category, was 1.16 (95% CI 1.08-1.25, P < 0.001). This result was inverted (aHR: 0.50, 95% CI 0.45-0.56, P < 0.001) after adjustment in the multivariable Cox regression model ( Table 2).
In multivariable Cox regression models, male sex (aHR = 1.39; 95% CI 1.24 − 1.56) was associated with an elevated risk of all-cause mortality. No significant transmission category-sex interaction was noted (P = 0.356).
In female PLWH (with PWID as the reference category), the cHR of all-cause mortality for heterosexual women (cHR: 1.33, 95% CI 1.09-1.62, P = 0.004) was inverted following Cox regression (aHR: 0.45, 95% CI 0.33-0.62, P < 0.001). Table 2. Association of transmission categories with all-cause mortality, overall and within each sex. Abbreviation: AIDS, acquired immunodeficiency syndrome; CI, confidence interval; HEX, heterosexual; HIV, human immunodeficiency virus; PWID, persons who inject drugs; PWID-M, male injection drug use; PWID-W, female injection drug use; IQR, interquartile range; MSM, man who have sex with man; MSW, man who has sex with woman; WSM, woman who has sex with man. *Adjusted hazard ratio (HR) with 95% CI was estimated after adjustment for age group, sex, period of HIV diagnosis, HIV transmission category, marital status, occupation, specimen source, HIV diagnosis region, and AIDS event in all set; and age group, period of HIV diagnosis, HIV transmission category, marital status, occupation, specimen source, HIV diagnosis region, and AIDS event in sex-stratified analyses. **We found no significant interaction between sex and HIV-related risk on the all-cause mortality.

Discussion
Since the 1990s, Taiwan has implemented measures to enable the early diagnosis of HIV through active and passive surveillance systems 30 . Under improvements in therapies for opportunistic illnesses and the introduction of universal access to free ART, substantial declines in all-cause mortality from the 1980s to mid-2000s have been observed. Starting in the mid-2000s, this decline slowed gradually. The curve of decline is consistent with those presented in studies conducted in other developed regions [31][32][33] . However, the all-cause mortality rate has evolved distinctly in different sex-stratified transmission categories since the mid-2000s. Specifically, the decline in all-cause mortality has slowed notably in groups with sexually transmitted HIV (MSM, MSW, WSM) since  First, the slowing of the decline in all-cause mortality among MSM, MSW, WSM in our study population may be partly explained by the persistently high prevalence of late HIV presentation among those with sexually transmitted HIV in Taiwan over the past 2 decades 34,35 . This high prevalence, which contributes to AIDS-related deaths 30,36 , may partially nullify the benefits conferred by the reduction of mortality from improved medical care, the implementation of universal ART, and the introduction of a single-tablet regimen. Second, 2003 notably marked the beginning of the rapid spread of the circulating recombinant form (CRF) 07_BC HIV strain among PWID 37,38 . In 2005, the implementation of harm reduction therapy rapidly contained the epidemic 39 , and the annual incidence of HIV cases among PWID has remained low since. The rising mortality rate among PWID in 2012-2016 in the present study may be due to a cohort effect stemming from the CRF07_BC epidemic in 2003. Considering the slow immunological progression caused by HIV CRF07_BC strain 40 , premature aging among PLWH 41 , and higher exposure to harmful lifestyles among PWID 9,10,13,41 , non-AIDS-related deaths are postulated to be the primary category of rising mortality observed in 2012-2016. In summary, to further reduce mortality in PLWH in Taiwan, strategies should be tailored to specific transmission categories: optimizing measures to expand targeted HIV testing for sexually at-risk populations to enhance early diagnosis of HIV infection, and intensifying surveillance of non-AIDS comorbidities and interventions to reduce harmful lifestyles among PWID PLWH.
Because of the limited availability of data on the causes of mortality, we could not evaluate the evolving trends of AIDS-related and non-AIDS-related deaths among PLWH. According to other studies, the substantial reduction in overall mortality over the past 3 decades has mainly been driven by AIDS-related causes in countries where sexual contact is the predominant route of HIV transmission 32,42,43 . Because early mortality is a proxy for AIDS-related mortality 30 , the significant decline in the proportion of early mortality across the three transmission categories suggests a significant trend of decline in AIDS deaths across these transmission categories. However, in 2012-2016, the early mortality rate in the groups with sexually transmitted HIV was not particularly low at 20%. Across the four periods of HIV diagnosis, deaths occurring > 180 days following HIV diagnosis remained considerable among PWID. This indicates the persistently high burden of non-AIDS-related deaths among PWID. Further examination of cause-specific mortality is necessary to elucidate its trends in various transmission categories and then guide the implementation of relevant interventions.
In the present study, the absolute all-cause mortality was higher among heterosexual people than among PWID (3.82 vs. 3.23 per 100 person-years). However, in both sexes, the association of all-cause mortality between PWID and heterosexual people was inverted after adjustment for confounders. Among PLWH, compared with PWID, heterosexual people are more prone to experiencing an AIDS event at presentation and during followup 26,35 . Furthermore, they tend to be older than PWID at the time of HIV diagnosis 26 . Both an AIDS event and older age at HIV diagnosis can increase the risk of all-cause mortality 30 . We determined that the aHR for the effect of heterosexuality (vs. PWID) on all-cause mortality in a model excluding age groups and AIDS events (supplementary file 1) was comparable to the crude HR for the effect of heterosexuality (vs. PWID) on all-cause mortality in the entire cohort (Table 2). When either age group or AIDS events were considered in the model, the aHR was reduced by more than 10%, suggesting that these two variables are confounders in the association between heterosexuality (vs. PWID) and all-cause mortality (Supplementary Table S1 online).
Consistent with findings presented in other studies, PWID had the highest risk of all-cause mortality in our study population 6,8,11,12 . The causes of this increased risk of all-cause mortality among PWID may be external, such as overdose, suicide 9,10,13 , or repeated intravenous injections, which can lead to non-AIDS infectious diseases (e.g., hepatitis C virus coinfection and infective endocarditis) 14,42,44 . Moreover, PWID frequently face numerous socioeconomic challenges, such as low education levels, incarceration (previous or current) 45 , economic difficulties, lack of social and family support, and associated psychiatric comorbidities 46,47 . These difficulties may prevent the successful and continual engagement and retention of PWID on the HIV care continuum.
The evidence on whether all-cause mortality differs between MSM and MSW is conflicting. Nationwide cohort studies conducted in Denmark and Brazil have revealed no such differences 18,19 . By contrast, in line with the results of a study conducted in China, we observed higher survival among MSM than among MSW 48 . A possible explanation is that MSM have closer connections to the HIV care continuum and better compliance with cART than do MSW. A UK investigation reported that MSM had a lower risk of virological failure than heterosexual people 16 . Furthermore, a study examining data from Thailand, Hong Kong, Malaysia, the Philippines, and Indonesia indicated that ART adherence was higher among MSM than among heterosexual people 17 .
Studies exploring sex differences in mortality have presented contradictory findings. A surveillance study of 19 PLWH cohorts in Europe and North America reported lower rates of all-cause mortality among female PLWH in Europe but no sex differences in Canada or the United States 20 . A retrospective cohort study conducted in China determined that male PLWH had higher risks of all-cause mortality than female PLWH 15 . These discrepancies may reflect differences in socioeconomic profiles or unmeasured confounders that correspond to uneven risks of unhealthy lifestyle (e.g., smoking or other lifestyle factors) among men and women 49 . Consistent with our findings, a global systematic review and meta-analysis of 65 studies concluded that female PLWH had higher survival than male PLWH in both resource-rich and resource-limited regions 50 . Although the studies related to the role of sex on adherence to ART are inconsistent 15,21,51 , the higher risk of all-cause mortality in male PLWH may be due to their higher risk of progression to AIDS, immunological and virological failure, and lower adherence to ART and care 15,21 . However, sex differences in immune responses may also complicate the association between non-AIDS-related mortality and sex. Female PLWH tend to have higher levels of immune activation and interferon-stimulated gene expression than male PLWH 52,53 , which likely influence the development of sex-related non-AIDS comorbidities. Moreover, male PLWH have higher risks of dying from non-AIDS-related causes, including substance use and external factors 20 . Therefore, future studies should elucidate the sex differences in www.nature.com/scientificreports/ AIDS-related deaths and non-AIDS-related deaths among PLWH in Taiwan. A European study found greater sex differences in all-cause mortality among heterosexual people than among PWID 20 . In the present study, we didn't observe significant transmission category-sex interaction. This between-study discrepancy might be due to the uneven distribution of risks of sex-related non-AIDS comorbidities between PWID and heterosexual people in European populations rather in our study population. This study has two key strengths. First, it is the first study to conduct sex-stratified analyses of all-cause mortality among PLWH in different transmission categories in Taiwan for the past 3 decades. Second, the nationwide and population-based design, combined with the extended follow-up duration and almost complete follow-up records, minimized selection and referral biases. However, our study has several limitations. First, HIV acquisition was self-reported and categorized into mutually exclusive classifications. Therefore, we could not identify people in more than one type of HIV exposure group (e.g., MSM who may also be PWID), which would result in higher risks of all-cause mortality 6 . Second, although we divided the events of all-cause mortality by time since HIV diagnosis to provide a proxy for AIDS-related mortality (if the event developed within 180 days of diagnosis), we were unable to precisely differentiate between AIDS-related and non-AIDS-related deaths because of the limited information available on specific causes of death 18 . Third, we lacked information on such well-established confounders as social trust 54 , income, education level, substance use 24 and alcohol 55 use, comorbidities, timing of ART initiation and classes of antiretroviral agents, and adherence to HIV care and ART. These unexamined variables may account for some of the observed associations of all-cause mortality between different transmission categories. Finally, health-care providers in Taiwan are not required to record patients' gender identity on reporting patient information. However, gender identity may be associated with HIV risk behaviors and socioeconomic status, which may in turn affect compliance with ART, HIV care, and mortality 56,57 .
In summary, we determined that under the implementation of a series of HIV prevention and management strategies, the trend of all-cause mortality among PLWH in Taiwan declined from 1984 to 2016. This decline leveled off after 2007, and the evolution of the trend in each transmission category became distinct. These observations indicate the emerging need to analyze specific causes of death among PLWH and to implement interventions relevant to individuals in each transmission category. The elevated risk of all-cause mortality among heterosexual people was inverted following adjustment for the confounders of AIDS events and older age at diagnosis. In both sexes, differences in all-cause mortality associated with the transmission categories remained, with PWID being the most at-risk population, followed by heterosexual people and MSM. Our data extend the understanding of all-cause mortality in PLWH in Taiwan and serve as a reference for the development of intervention strategies for each mode of HIV acquisition.

Methods
Data sources, study design, and setting. We retrospectively screened for new diagnoses of PLWH from a nationwide HIV/AIDS database under the Taiwan Centers for Disease Control (TCDC)-operated Notifiable Diseases Surveillance System (NDSS). The researchers can apply to the Health and Welfare Data Science Center, Ministry of Health and Welfare for the HIV/AIDS database. The HIV/AIDS database updated annually 26,35 . Health-care providers must report patient information to TCDC-operated NDSS-including the national identification number, sex, date of birth, date of HIV/AIDS diagnosis, occupation, specimen source, HIV transmission categories, region of HIV diagnosis, and marital status-within 24 h of HIV diagnosis. In this context, AIDS reporting requirements are based on the case definition of AIDS presented by the US Centers for Disease Control and Prevention in 1993 58 . The HIV/AIDS database records an AIDS event only once per patient. Trained public health personnel maintain records on the status of each individual-that is, whether they are alive, dead, or no longer in Taiwan (designated as departure).
All data in the HIV/AIDS database are deidentified to protect personal privacy, and researchers analyze the data anonymously under the ambit of personal data protection laws. The Institutional Review Board of Kaohsiung Medical University Hospital approved the study protocol [approval no. KMUHIRB-E (II)-20200084]. The informed consent was waived by the Institutional Review Board of Kaohsiung Medical University Hospital. The study was conducted in adherence to the principles of the Declaration of Helsinki, and the use of the TCDC database for the present investigation was authorized by Taiwan's Ministry of Health and Welfare, with all authors signing a confidentiality agreement.
Study population. Details of the enrollment process were described previously 26 . In brief, we searched the database for data on PLWH with new HIV diagnoses in the period from January 1984 to December 2016. PLWH who were aged < 15 years, had a departure status, unknown HIV transmission route, unknown sex, or incomplete records were excluded from further analysis, as were individuals belonging to a transmission category irrelevant to our study (e.g., blood transfusion). We examined data from the date of HIV diagnosis to each individual's death or December 31, 2016, whichever occurred first. The enrolled individuals were first grouped by transmission category (MSM, heterosexual people, and PWID) and then categorized into subgroups by sex: MSM, MSW, WSM, M-PWID, and F-PWID.
Working definitions. We analyzed covariates measured at baseline. These are listed as follows: age (≤ 30, 31-50, and ≥ 51 years), sex, period of HIV diagnosis (1984-1996, before highly active ART [HAART]; 1997-2006, early-HAART; 2007-2011, mid-HAART; or 2012-2016, contemporary HAART), transmission category, marital status (unknown, unmarried, or married), occupation (unknown, student, unemployed, or employed), specimen source (designated hospital, military screening, blood donation, imprisonment screening, or others), and region of HIV diagnosis 35  www.nature.com/scientificreports/ The time points of the mortality events were categorized according to the timing of their occurrence after HIV diagnosis (i.e., ≤ 180 and > 180 days) as a proxy for possible AIDS-related mortality 30 . Because of the limited availability of data on the causes of mortality in the reporting system, the reported deaths were considered under the umbrella of all-cause mortality.

Statistical analysis.
To assess the distribution of sociodemographic variables, specimen source, AIDS events during observation, and all-cause mortality rates per 100 person-years during observation (overall, by sex, and by transmission category), we applied the Kruskal-Wallis and chi-square tests to continuous and categorical variables, respectively.
In comparisons of all-cause mortality (overall and sex stratified) among MSM or heterosexual people with PWID, we employed Cox proportional hazards models in assessing hazard ratios (HRs; both unadjusted and adjusted) with 95% CIs. Potential risk factors-namely age group, sex, period of HIV diagnosis, at-risk population, marriage, occupation, specimen source, and region of HIV diagnosis-were incorporated into the Cox proportional hazards model, with AIDS events as a time-updated variable.
The cHR of all-cause mortality in a comparison of heterosexual people and PWID was inverted following adjustment for confounders in the multivariable Cox regression model. To investigate these potential confounders, we employed various models to estimate the aHR of all-cause mortality in a comparison of heterosexual people and PWID.
After excluding MSM, we tested for interactions between transmission category and sex in separate Cox proportional hazards models. Scaled Schoenfeld residuals and Schoenfeld-like residuals were used to test the proportional hazards assumption by age group, sex, period of HIV diagnosis, region of HIV diagnosis, at-risk population, marital status, occupation, and specimen source in the multivariable Cox regression model.
Differences were considered significant at P < 0.05. Statistical analyses were performed using SAS software, Version 9.4 of the SAS System (SAS Institute, Cary, NC, USA).