Introduction

In 2019, development and scaling up HIV prevention, diagnostic, and treatment strategies collectively have slowed new HIV infections globally, but not to the extent earlier models had predicted1. In part, this may be due to stable or growing HIV incidence among marginalized populations including sex workers in many settings. Around the world, ~1 in 10 sex workers is estimated to be living with HIV2. Across concentrated and generalized HIV epidemics, female sex workers consistently bear a disproportionate burden of HIV compared with other cisgender women of reproductive age3. Across low- and middle-income countries, sex workers have more than a 13 times increased odds of living with HIV compared with other women3. Available data of HIV prevalence among sex workers has increased, with a 2018 review finding data points from 101 countries2. Incidence data remain limited, but where available, suggest continued challenges in the coverage of effective HIV prevention and treatment interventions for sex workers2. Furthermore, emerging evidence suggests that the unmet HIV prevention and treatment needs within sex work significantly contributes to overall HIV transmission even within generalized epidemics4. Even in the presence of sustained programs for sex workers, mathematical models predict that 14–38% of all new HIV infections in Benin, Burkina Faso, and Kenya could directly or indirectly be due to sex work over the next 20 years4,5,6,7. In the absence of dedicated programs, this estimate increases to 58–89%4,5,6,7. Taken together, these results suggest an urgent need to improve prevention and treatment services for sex workers across HIV epidemics.

Despite expanded access to antiretroviral therapy, sex workers across sub-Saharan Africa continue to have suboptimal HIV prevention and treatment outcomes8. Progress in scaling up programs and sustaining coverage of HIV services is undermined by limited assessment of, and efforts to address structural determinants affecting HIV among sex workers2. Studies have primarily focused on individual-level biological and behavioral risks for HIV among sex workers with limited examination of higher level structural determinants2,9. For example, a systematic review found that fewer than half of epidemiological studies on HIV acquisition and transmission measure structural determinants and this was even less common in studies specifically among sex workers10. Consequently, recommendations have been made for increased integration of structural-level factors into HIV research among sex workers11. Although more studies assessing structural determinants of HIV among sex workers are emerging, few exist from across sub-Saharan Africa2.

The legal environment, including laws, enforcement practices, and justice systems, is a key structural determinant of HIV risk for sex workers and is often stated as a focus for the global HIV response12,13,14,15. Punitive legal environments consistently increase vulnerabilities among sex workers through further pushing sex work into unregulated and unsafe work environments, increasing economic and residential insecurities, and influencing HIV-risk behaviors14,16,17. Moreover, laws criminalizing sex work may both increase sex work-related stigmas and potentially contribute to HIV epidemic growth if the sequelae of these laws increases vulnerability and decreases engagement in HIV prevention and treatment services. HIV risks have been characterized in criminalized settings; however, limited opportunities have been available to compare individual health-related outcomes among sex workers across differing legal contexts. Systematic reviews and meta-analyses have leveraged qualitative and quantitative evidence to assess harms associated with sex work policies18. And ecological studies of country-level data have observed a relationship between HIV and sex work laws showing a lower HIV prevalence among sex workers in European countries with partial legalization of sex work compared with criminalized settings19. However, characterizing the influence of criminalization and punitive policies and stigmas towards sex work across settings with empirical, individual-level data, remains limited18,19,20,21.

Stigmas exist at individual, interpersonal, and structural levels, and represent a process in which an individual is labeled based on some characteristic linked to a stereotype, often resulting in limited opportunities and well-being22. Stigma measurement strategies and mitigation interventions have traditionally focused on HIV-related stigmas, though emerging research has focused on stigmas related to sexual behavior among key populations23,24. Sexual behavior stigmas can include anticipated, perceived, or enacted stigmas attributable to an individual’s sexual behavior, including engagement in sex work25. However, the majority of studies measuring stigmas among key populations have focused on stigmas affecting sexual and gender minorities, with only 2% of identified stigma measurement related to sex work26. Understanding sex work-related stigmas, especially across different legal contexts has direct implications for the implementation and effectiveness of HIV treatment programs. Where assessed, perceived, anticipated, and enacted stigmas consistently challenge progress along the HIV treatment cascade by limiting engagement in prevention, care, and treatment services27,28,29,30. Moreover, intersecting stigmas have been associated with prevalent HIV infection and limited uptake of services along the HIV treatment cascade across sub-Saharan Africa31,32,33. Separate from HIV-associated laws, stigma has also been identified as a driver of the HIV pandemic, and its elimination remains one of the three pillars of the UNAIDS plan to achieve zero new HIV infections by 203034. Both the World Health Organization and UNAIDS have recommended increasing efforts to mitigate stigma as critical to an effective HIV response35,36. However, understanding the different ways in which stigma potentiates individual-level HIV risks to inform stigma mitigation efforts across different legal contexts remain limited.

In response, this study aims to use individual-level data to characterize the relationship between sex work laws, stigmas, and HIV risks among female sex workers across sub-Saharan Africa. Collectively, findings from these analyses suggest that increasingly punitive and non-protective laws are associated with increased odds of prevalent HIV infection among sex workers. Furthermore, stigmas and sex work laws may operate synergistically in increasing HIV risks, with generally stronger associations between stigmas and HIV in punitive and non-protective settings compared with partially legalized settings. The results suggest that the increased harmful effects of stigmas in more punitive and non-protective legal contexts may be due to increased barriers in the provision or uptake of efficacious HIV prevention and treatment services, or impunity among perpetrators of stigma and lack of recourse for sex workers experiencing health and social stigmas, or more likely, a combination of the two.

Results

Study sample characteristics

A total of 7259 female sex workers are represented in this analysis.

The distribution of women across countries is: Burkina Faso (n = 698; 9.6%), Cameroon (n = 2255; 31.1%), Cote d’Ivoire (n = 466; 6.4%), Guinea-Bissau (n = 567; 7.8%), Lesotho (n = 744; 10.3%), Senegal (n = 758; 10.4%), South Africa (n = 410; 5.6%), Kingdom of eSwatini (n = 324; 4.5%), The Gambia (n = 354; 4.9%), and Togo (n = 683; 9.4%) (Table 1).

Table 1 Summary of data collection.

In total, 48.6% (n = 3526) are living in West Africa, 31.1% (n = 2255) in Central Africa, and 20.4% (1478) in Southern Africa (Table 2). Overall, 17.4% (1265/7259) of participants are living in countries where legal status of selling sex is not specified; 26.3% (1907/7259) where sex work is partially legalized, and 56.3% (4087/7259) where sex work is criminalized. Participants living in countries with generalized HIV epidemics represent 79.6% (5781/7259) of the study sample with 20.4% (1478/7259) in concentrated HIV epidemics.

Table 2 Study sample by region, legal status of sex work, and country-level HIV epidemic.

Demographic characteristics, HIV, disclosure, and stigmas

Demographic characteristics, HIV risk and status, disclosure, and stigmas are summarized in Table 3. The median age is 27 years (interquartile range (IQR) 22–34), and the median years engaged in sex work is 4 (IQR 2–8). The pooled HIV prevalence is 28.6% (95% Confidence Interval (95% CI): 27.6–29.7; N = 2070/7230).

Table 3 Demographic characteristics, HIV risk and infection, disclosure, and stigma by legal status of sex work.

Prevalent HIV infection and legal status of sex work

HIV prevalence in contexts with partial legalization is 11.6% (219/1894), 19.6% (248/1265) within contexts without legal specification, and 39.4% (1603/4071) within criminalized settings (Table 4). Legal status of sex work is associated with HIV (X2 p value < 0.001). When compared with settings with partial legalization, criminalized status (adjusted odds ratio [aOR]: 7.17; 95% CI: 2.71–18.95; p value < 0.001), and sex work not being legally specified (aOR: 2.35; 95% CI: 1.06–5.21; p value = 0.036) are associated with increased odds of HIV.

Table 4 HIV infection and country-level legal status.

Sensitivity analysis using a random sample of data from Cameroon showed similar results to the main sample (Supplementary Table 1).

Stigmas and prevalent HIV infection

Prevalent HIV infection is positively associated verbal harassment (aOR: 1.29; 95% CI: 1.12–1.50; p value = 0.001); blackmail (aOR: 1.39; 95% CI: 1.20–1.61; p value < 0.001); physical violence (aOR: 1.23; 95% CI: 1.02–1.49; p value = 0.029); and forced sex (aOR: 1.32; 95% CI: 1.13–1.54; p value < 0.001); and negatively associated with fear of being in public places (aOR: 0.67; 95% CI: 0.48–0.94; p value = 0.024) (Table 5).

Table 5 Pooled relationship between stigma and prevalent HIV infection among female sex workers.

Stigma exposure differs between participants with prior knowledge of living with HIV compared with those without prior knowledge of living with HIV or not living with HIV (Supplementary Table 2).

HIV and stigmas by legal status of sex work

The degree of association between stigmas and HIV varies by legal status of sex work (Mantel–Haenszel test of homogeneity (MH) p value: < 0.01) for all stigma measures assessed except denial of health services, verbal harassment, and forced sex. Specifically, in criminalized settings HIV is associated with fear of seeking health services (aOR: 95% CI: 1.01–1.53; p value: 0.041) and mistreatment in a healthcare setting (aOR: 2.15; 95% CI: 1.43–3.23; p value < 0.001), compared with partially legalized settings (Table 6).

Table 6 Relationship between stigma and HIV by legal status of sex work.

The relationship between HIV and uniformed officers refusal to provide protection varies by legal status (MH p value < 0.01) with an increased odds in settings without legal specification (aOR: 1.64; 95% CI: 1.29–2.08; p value < 0.001) and criminalized settings (aOR: 1.38; 95% CI: 1.10–1.72; p value = 0.005) compared with partially legalized settings. Blackmail is associated with HIV in non-specified settings (aOR: 1.50; 95% CI: 1.37–1.65; p value: < 0.001) and criminalized settings (aOR: 1.35; 95% CI: 1.07–1.71; p value: 0.010) compared with partially legalized settings. HIV is associated with physical violence in criminalized settings versus partially legalized settings (aOR: 1.34; 95% CI: 1.11–1.62; p value = 0.002).

Discussion

Punitive and non-protective sex work laws are associated with prevalent HIV infection among female sex workers in countries across sub-Saharan Africa. The prevalence of stigma is high among female sex workers and consistently associated with prevalent HIV infection, highlighting the importance of structural determinants alongside more proximal individual-level characteristics. The degree of the relationship between stigmas and HIV varies by legal status of sex work, suggesting that stigmas and legal status of sex work may operate jointly in increasing individual HIV burden. This study further demonstrates the persistence of certain types of stigmas across differing legal contexts and suggests that the potential impact of stigmas on HIV risk and ultimately burden may be greatest in punitive and non-protective settings. Finally, these results suggest the complexity of HIV risks among sex workers across sub-Saharan Africa transcending individual-level sexual practices, highlighting the need to continue to measure and address stigmas to inform a more effective and efficient HIV response.

The magnitude of the relationship between the legal status of sex work and individual HIV infection is highest among individuals in fully criminalized settings, followed by settings where the legal status of selling sex is not specified. These results are consistent with prior findings from ecological studies19 and highlight how laws serve as a structural determinant that contribute to individual-level health outcomes. Findings suggest that written laws, independent of enforcement practices, influence HIV outcomes and that explicit legality serves in protecting sex workers. Moreover, these results suggest that punitive and non-protective laws may contribute to an environment that perpetuates HIV risks among sex workers. These findings are consistent with earlier mathematical models that demonstrated that across generalized and concentrated HIV epidemics, decriminalization of sex work could have the largest effect on the course of country-level epidemics, averting one-third to almost one-half of incident HIV infections over the next decade10. This reduction would be through combined effects on violence, harassment by uniformed officers, and safer work environments collectively mediating HIV transmission pathways10. Despite these consistent results, the number of countries decriminalizing sex work has not increased over the last 5 years2,11.

The relationship between stigmas and HIV varies across different legal contexts of sex work, suggesting that stigmas and sex work laws interact in increasing HIV risks and ultimately burden. Sex workers living in settings with criminalized and non-specified laws generally show a stronger relationship between stigmas and HIV compared with partially legalized settings. Existing evidence suggests that sex workers living in punitive and non-protective settings may experience greater burdens of stigmas than women living in partially legalized settings37. However, in this study, women reporting any lifetime history of stigma is not clearly or consistently higher in criminalized or non-protective settings compared with partially legalized settings, highlighting that sex workers across legal environments experience stigmas. Although sex workers may still experience a greater frequency of stigmas over the course of their lifetime in punitive and non-protective settings, the periodicity of stigma experiences among women is not measured in this study. Given the near universality of stigmas affecting sex workers, the mechanisms associated with increased HIV burden may act by amplifying the barriers to safety, as well as efficacious health services. Specifically, sex workers in punitive and non-protective environments may be more susceptible to the harms related to stigmas affecting overall safety in society and in access to HIV prevention and treatment services. Furthermore, sex workers in partially legalized or more protective environments have been shown to have higher levels of social capital, resiliency, and options for support that can mitigate the impact of stigmas on HIV risks38. Ultimately, the mechanisms underpinning the synergies of stigmas and sex work laws in the burden of HIV among sex workers likely vary by the specific type of stigma. The consistency in the findings of the interaction between laws and stigma in especially punitive legal settings reinforce the importance of HIV prevention and treatment intervention strategies tailored for sex workers that consider the legal context during implementation.

Uptake of HIV testing, prevention, and treatment services remains low among sex workers across sub-Saharan Africa and globally, in part due to healthcare-related stigmas2,10,39. In these analysis, higher HIV burden among sex workers was associated with anticipated and perceived stigmas relating to seeking care in criminalized settings. Harmful effects of stigma are reinforced by the experience of intersecting stigmas among sex workers living with HIV attributable to both sex work and HIV status, as participants who reported to be aware of living with HIV prior to enrollment report higher levels of sex work-related stigmas. The combined or compounded effect of multiple stigmas may further influence uptake of services and health outcomes40,41,42. Leveraging innovative approaches to provide services outside of health facilities while working to mitigate observed individual and intersecting stigmas may facilitate improved service coverage. In this context, decentralized services have been able to serve sex workers who were not accessing traditional services and therefore may provide an avenue to increase coverage and access43,44,45. To date, few studies have evaluated stigma mitigation approaches for people living with HIV and even fewer have aimed to study stigma reduction for sex workers in healthcare settings across sub-Saharan Africa24. These results suggest the importance of protective structures within healthcare systems, such as the enforcement of anti-discriminatory policies and accountability mechanisms to ensure culturally and clinically competent services for all.

Violence affecting sex workers is prevalent across legal contexts and is associated with HIV among sex workers in this analysis, consistent with findings from other settings46. Violence has been associated with HIV risks, such as inconsistent condom use, difficultly in condom negotiation, recent condom failure, client condom refusal, and high client volume47,48,49. In this analysis, the relationship between physical violence and HIV varies by legal context, with an increased association in criminalized settings. Increased legal restrictions on sex work has been shown to move activities to more hidden settings to avoid detection by uniformed officers, alongside increased vulnerability to violence and HIV-risk behaviors such as unprotected sex50. Even when enforcement efforts prioritize clients or third parties, violence affecting sex workers persists51. In contrast, the degree of the relationship between sexual violence and HIV does not vary across legal contexts. Aligning with findings from other studies, this suggests that partial legalization, such as the removal of only some aspects of criminal laws and regulation of sex workers is necessary, but not sufficient for reducing sexual violence as a risk factor for HIV52. This is consistent with previous modeling and empirical work, suggesting that only through full decriminalization, such as full removal of laws targeting sex industry; access to safer work environments; and prevention of violence and harassment by police could law reform as a structural determinant avert violence and HIV infections10,51. Finally, empirical research pre and post law reform has shown that in settings where clients and third parties are criminalized but not sex workers, rates of both sexual violence was unchanged from full criminalization53.

Sex workers reporting lack of protection from uniformed officers is prevalent in this analysis, and likely true in much of the world54. The lack of protection explains the persistent violence and blackmail observed among sex workers across legal contexts, likely due to impunity of offenders. There have been limited recent efforts among countries or regions to end impunity for crimes and abuses against sex workers2. In this study, the relationship between blackmail and HIV is highest in non-protective settings, followed by criminalized settings. In other settings, repressive police practice has been associated with violence, as well as HIV and sexually transmitted infections18. Perceived stigmas related to policing practices is prevalent and associated with HIV infection in this analysis, suggesting that legal protections as well as training and accountability of law enforcement may support improved HIV outcomes. Here, there is no assessment of enacted stigmas by uniformed officers specifically, however, this has been observed in other settings55. For instance, qualitative assessments have reported abusive practices by uniformed officers against sex workers, including blackmail, arbitrary arrest, and violence56,57. Women have also reported that sex or money are used as compensation for release after arrests56,57. Among sex workers in Côte d’Ivoire, Burkina Faso, and Togo who had experienced physical violence and forced sex, a large proportion reported perpetration by a uniformed officer55,58. In this study, fear of being in public places is negatively associated with HIV prevalence overall, prior to stratification across legal contexts. In part, the lower HIV risk may emerge from protective behaviors such as avoiding street-based sex work, which has been associated with increased violence, extortion by uniformed officers, and increased HIV-related risk behaviors18,59. Combined structural interventions with uniformed officers involving advocacy with senior uniformed officers, and crisis response mechanisms have been shown to reduce uniformed officers arrests and violence, and create a safer work environment for sex workers60,61.

Several limitations in this study should be considered. Although data are clustered by site and country to account for the non-independent nature of observations within each site and within each country, individual country and site differences may be lost in the aggregation of data. Legal status categories were determined based on country-specific legislation where available, but not necessarily the enforcement practices and justice systems. Although we are not able to assess causality through cross-sectional data and cannot account for the relationship between HIV prevalence and stigmas over time, laws were established prior to HIV introduction within countries. At a minimum, this limits the possibility that laws criminalizing sex work were a result of or influenced by the HIV epidemic. It is possible that unmeasured confounders preceding both sex work laws and country-level epidemics may exist and feed independently into both, thus resulting in uncontrolled confounding. There may also be unmeasured confounders that are associated with sex work laws and/or stigmas, as well as causally associated with HIV, but not on the casual pathway between these exposures and outcomes. None of the countries included in this analysis meet the criteria for decriminalized legal status, and therefore this legal context could not be evaluated. Data were collected over a period of 7 years, which should be considered in the interpretation of the results. Enforcement practices, program funding, and other external measures over time may have influenced stigmas, HIV status, or HIV risk. Female sex workers living with HIV may experience intersectional or compounded stigmas due to HIV status and engagement in sex work, and therefore there is a need to further evaluate these intersectional stigmas.

In the context of a slowing HIV pandemic, epidemics among sex workers in most settings across sub-Saharan Africa are stable or growing. Although others are benefiting from improved prevention and treatment interventions, these data highlight that both sex work laws and stigmas prevent the effective provision and uptake of interventions for sex workers across sub-Saharan Africa. Moreover, the unmet HIV treatment needs among sex workers results in onward HIV transmissions that are relevant even in the most generalized HIV epidemics. The data presented here collectively demonstrate the importance of punitive and non-protective laws in driving HIV risks among sex workers. Furthermore, stigmas and sex work laws appear to operate synergistically in increasing HIV burden, with stigmas having a greater impact on HIV risk in punitive and non-protective settings. In 2020, there will be more than three times the number of infections compared with the stated goal of 500,000 new HIV infections, highlighting the need to do things differently if there is to be a chance of achieving zero new infections by 2030. Thus, whether the path forward is driven by human rights or public health principles, achieving zero new HIV infections in the foreseeable future can only be realized if we meaningfully address the structural determinants that contextualize individual HIV risks among sex workers across sub-Saharan Africa.

Methods

Data collection and participants

Primary data collection was conducted through 10 country-specific studies led by one investigative team. Respondent driven sampling (RDS) was used in each of the 10 country-specific studies between 2011 and 2018. All country-specific studies were cross-sectional. Data were collected across 21 sites in 10 countries: Burkina Faso (January–August 2013); Cameroon (November 2015–October 2016); Côte d’Ivoire (March 2015–February 2016); The Gambia (May 2017–May 2018); Guinea-Bissau (September–November 2017); Lesotho (February–September 2014); Senegal (February–November 2015); eSwatini (August–October 2011); South Africa (October 2014–April 2015); and Togo (January–June 2013).

RDS, a peer-recruitment method designed to sample marginalized populations, was administered independently across the country-specific sites to recruit female sex workers. Recruitment chains were initiated by seeds in each site, who were individuals selected in collaboration with local community-based organizations to represent heterogeneity in demographic characteristics and geographic representation. Initial seeds were provided with three coupons to recruit peers into the study. Women recruited by seeds and enrolled in the study were provided with three coupons for continued recruitment of peers. This process was repeated until reaching the target sample size of each country. Sample size calculations for the initial data collection were powered to estimate HIV prevalence at each site. The number of recruitment seeds by study site are provided in Table 1.

Participants were eligible if they self-reported female sex assigned at birth; were 18 years or older; attributed more than half of their income in the past 12 months to selling sex; and were capable of providing informed consent. Country-specific eligibility criteria included city or area of residence. All participants provided verbal or written informed consent. The study complied with all relevant ethical regulations for work with human participants. Country-specific data collection were reviewed and approved by Johns Hopkins School of Public Health Institutional Review Board and/or an ethical review board and related bodies in the country of data collection. Country-specific ethic committees include: Health Research Ethics Committee of Burkina Faso, National Ethics Committee of Cameroon, the Health Research Ethics Committee of Côte d’Ivoire, National Research Ethics Committee of Guinea Bissau, the Lesotho National Health Research Ethics Committee, the Senegalese National Health Research Ethics, Institutional Review Boards of the Human Sciences Research Council in South Africa, the Swaziland Scientific Ethics Committee, Scientific Coordination Committee in the Gambia, the Ethical Committee of Togo.

Interviewer-administered questionnaires were conducted, and socio-behavioral measures were self-reported. All interviews were conducted in a private location with trained study staff. Biological testing for HIV, including pre- and post-test counseling, was conducted consistent with country-specific national guidelines. Participants with a reactive test result were referred to care. Pre-test counseling and biological testing were conducted prior to administering the socio-behavioral questionnaires. Post-test counseling and HIV test results were reviewed with participants after completion of the socio-behavioral questionnaire.

Measures

Individual-level data from socio-behavioral questionnaires and biological testing are used for this analysis. Stigma measures are described in Supplementary Table 3. Consistent stigma metrics are used across countries that included items on ever experiencing stigma relating to healthcare, among family or friends, and the general community. Stigma measures were asked as attributable to engagement in sex work, except for measures of physical and sexual violence. Stigma measures were informed by a systematic review of stigma metrics and were validated with data from Togo and Burkina Faso26,62,63.

Countries are categorized into three regions: West Africa (Burkina Faso, Cote d’Ivoire, The Gambia, Guinea-Bissau, Senegal, and Togo); Central Africa (Cameroon); and Southern Africa (Lesotho, Kingdom of eSwatini, South Africa). Country-level HIV epidemic status is defined for each country as either generalized or concentrated. These categories leveraged the traditional UNAIDS and WHO definitions. Thus, a concentrated HIV epidemic includes countries in which HIV prevalence is consistently over 5% in at least one defined subpopulation, but < 1% among reproductive aged women; a generalized HIV epidemic has an HIV prevalence consistently exceeding 1% in adult women. UNAIDS estimates were used to categorize the country-level epidemics64.

Legal status of sex work for countries in this study is defined and categorized based on the legal approach: not specified, partially legalized, or criminalized (Supplementary Table 4). Not specified included countries in which there is not an explicit law legalizing or criminalizing the selling of sex. Partial legalization is defined as countries that have legalized an aspect or a mechanism of sex work under specific circumstances, including legal to sell or legal to solicit, whereas leaving other aspects criminalized. In some cases, legalization of sex work is regulated alongside a registration system for sex workers. Criminalized, is defined as illegal to sell sex, solicit sex, and organize commercial sex under any circumstance and stipulated punishment under the law. None of the countries in these analyses was considered decriminalized. This categorization was determined by leveraging existing legal frameworks for sex work18,65,66. The legal status of sex work for this analysis is defined by the written law and not based on enforcement practices.

Statistical analyses

Statistical models were guided by the Structural HIV Determinants Framework for Sex Work and the Logic Model of Public Health Law Research10,67.

Data are pooled across countries and analyzed as crude data; RDS-adjusted weighting is not applied across countries as women do not represent a single network of female sex workers, violating a key assumption of RDS68. Models are clustered by country and by site and represent valid sample estimates, but may differ from population-level estimates given lack of RDS-adjustment69.

Proportions of demographic characteristics, HIV risk and status, disclosure, and stigmas are described using crude estimates. Person’s Chi-squared is used to assess the relationship between demographic characteristics and legal status of sex work.

Legal status of sex work and HIV are assessed through simple and multivariable logistic regressions. Multivariable logistic regression models adjusted for age, education level, marital status, and years in sex work and account for clustering within sites and within countries. Although the country-level epidemic (concentrated vs. generalized) is associated with HIV prevalence, it is not considered a confounder in our conceptual model, but rather a mediator between sex work law and HIV prevalence, as sex work laws in each country preceded the introduction of HIV within the countries.

Logistic regression models are used to assess associations between various stigma exposures and the outcome of HIV status. Stigma exposure models were run separately due to collinearity between stigma items. Multivariable logistic regression models adjusting for country-level epidemic, age, education, marital status, and years in sex work, and respective disclosure variables when conceptually relevant (disclosure of sex work to family; disclosure of sex work to healthcare provider) were run for each stigma exposure. All models account for clustering by site and by country.

To explore joint mechanisms through which the relationship between stigma indicators and HIV status may be modified by legal status, the relationship between stigma indicators and HIV status is stratified by country-level legal status of sex work. The MH is used to assess differences between stigma and HIV across different legal statuses, using a significance level of p < 0.0170. Values for which a difference was observed were assessed through stratified multivariable adjusted models assessing stigma exposures on HIV status. Effect measure modification between stigma and HIV by legal status of sex work was assessed using an interaction term of stigma and legal status in logistic regressions with HIV modeled as the outcome. Effect measure models adjust for country-level epidemic, age, education, marital status, years in sex work, and respective disclosure variable when conceptually relevant; models account for clustering within sites and within countries.

Due to the large sample size from Cameroon, sensitivity analyses using a random sample of data from Cameroon (n = 700) were conducted.

All analyses were conducted in Stata v.15.1. (College Station, Texas, United States).

Reporting summary

Further information on research design is available in the Nature Research Reporting Summary linked to this article.