Introduction

San Francisco, particularly the Castro District, is considered by many to be a “gay Mecca.” Political, social, and economic forces shaped the Castro neighborhood’s identity during the second-half of the twentieth century [1]. During the 1960s and 1970s, the Castro District helped create a sense of belonging to a community, a pocket of acceptability in an otherwise hostile country, and a space for gay sexual expression for gay men or men who have sex with men (MSM). As a result, large numbers of MSM migrated to San Francisco during the 1960s and 1970s, and by 1980 an estimated 17% of the city’s population was gay [2, 3]. The first AIDS case in San Francisco was reported in 1980 and the Castro District, home to most MSM in the city, was heavily affected by the AIDS epidemic in the 1980s. By the time the etiologic agent of AIDS (human immunodeficiency virus or HIV) was discovered and the first diagnostic test for HIV was approved in 1985, approximately 50% of MSM in San Francisco were HIV-positive [4]. Initially, life expectancy with AIDS was poor, with a median survival of 11 months for persons diagnosed with AIDS between 1980 and 1984 [5]. Life expectancy increased when the first antiretroviral drug was approved by the FDA in 1987, and the median survival of individuals diagnosed with AIDS between 1990 and 1995 had increased to 38 months [5].

The ability of HIV-positive individuals to migrate has increased as a result of lengthened survival. Data from the San Francisco Department of Public Health (SFDPH) indicate that HIV-positive individuals are migrating into and out of San Francisco. Approximately 29% of HIV-positive individuals receiving HIV care in San Francisco in 2014 were living elsewhere at HIV diagnosis, indicating substantial in-migration from other areas [5]. Between November 2012 and May 2015, SFDPH conducted a pilot project in which HIV-positive adults presumed to reside in San Francisco were sampled from the HIV registry and recruited for participation in a survey. Approximately 25% of those sampled and located no longer resided in San Francisco at the time of recruitment, indicating significant out-migration among persons living with HIV. HIV serostatus may influence in-migration because of the desire to migrate to an area perceived as having less HIV stigma, better quality or access to medical care and HIV-related services, or more affordable health care. On the other hand, HIV serostatus may influence out-migration because of the need to live in a place with a lower cost of living or the desire to move closer to family or potential caregivers.

Direct estimation of migration among MSM is not possible because a single data source that contains all necessary information does not exist. The US Census does not collect data on sexual orientation or behavior, which results in difficulty obtaining estimates of MSM population size and migration from this robust data source. In the Urban Men’s Health Study, MSM in New York, San Francisco, Chicago, and Los Angeles were surveyed via telephone, 82% reported in-migrating to these urban areas since turning 18 years of age, and in-migration proportions differed by race and age [6]. There are currently no reliable cohort studies that are tracking out-migration of MSM from San Francisco as it is difficult to distinguish whether an individual who has been lost to follow-up has out-migrated or has passively refused. The National HIV Behavioral Surveillance (NHBS) survey collects self-reported survey data on in-migration for MSM into San Francisco, and there is limited information on out-migration by HIV-positive MSM in San Francisco from HIV surveillance data. While a case record in the HIV surveillance database may be updated as part of routine HIV case surveillance activities if the individual has migrated out of San Francisco, this source is not reliable for estimating out-migration because the time at which out-migration occurred is difficult to ascertain through HIV surveillance data, and there are substantial discrepancies between HIV surveillance data and self-reported current residence. Further, there are no data sources on out-migration for HIV-negative MSM in San Francisco.

Migration patterns of MSM in San Francisco have, to our knowledge, never been described. Understanding migration patterns is crucial in determining how migration by HIV-positive and HIV-negative individuals could influence HIV transmission. An accurate estimate of population size is essential for allocating resources. Due to the difficulty of directly estimating migration of MSM, a modeling approach was relied on to estimate in- and out-migration of MSM by HIV serostatus and by race, as those in different racial groups are disproportionately affected by HIV and also may have different migration patterns. The analysis was limited to white MSM, black MSM, and all MSM combined, due to the small numbers of MSM of other races (i.e., Asian) and ethnicities in San Francisco. Here, we describe methods, results, and implications for a novel approach to estimate in- and out-migration patterns of MSM, and consequently population size, by HIV serostatus and race in San Francisco.

Methods

Data Sources and Estimated Parameters

National HIV Behavioral Surveillance

Data from the NHBS project in San Francisco were used to estimate the number of MSM with unrecognized HIV (u t HIV +) and the proportion of MSM who moved to San Francisco in the prior 12 months who were HIV-positive (n Δt ). NHBS data provided the proportion of MSM living with unrecognized HIV [7]. The inverse of this proportion was divided by the total known HIV-positive MSM (k t HIV +) to obtain the total number of HIV-positive MSM (MSM t HIV +). NHBS is a CDC-funded, national HIV behavioral surveillance project that collects data on MSM in San Francisco through standardized behavioral surveys, including HIV-antibody and incidence testing. NHBS did not sample MSM every year; data from 2004, 2008, 2011, and 2014 were used for estimating parameters in the model. Data for missing years were imputed by linear interpolation.

MSM Population Estimates

We used previously published data on estimated MSM population size for all race/ethnicities combined in 2006 (n = 63,577) as the estimated starting population size for the model (MSM t ) [8]. To calculate the MSM population size in 2006 for WMSM and BMSM, the means of the proportions for each race were calculated from NHBS 2004 and 2008 (because 2006 was the halfway point between these time points) and multiplied by the total estimated MSM population size in 2006 [7]. Our assumption concerning the proportion of the male population that is MSM in San Francisco (p MSM ) was derived using the above estimated MSM population sizes (all, white and black subgroups) in 2006 and then dividing by the corresponding total San Francisco adult male population sizes in 2006 reported by the US Census Bureau. This yielded an estimate that 19% of all adult males in San Francisco were MSM, whereas 23% of all black adult males were MSM and 21% of all white adult males were MSM.

US Census Bureau American Community Survey

The US Census Bureau American Community Survey (ACS) collects demographic information and migration status for a subsample of persons and households in the US Census. Data are given weights that were used to calculate population estimates. Data from ACS single-year estimates for the years 2006–2014 were used to estimate the total number of adult male in-migrants and out-migrants for San Francisco. The estimated proportion of all adult men who are MSM (p MSM ) was then applied to obtain the total number of MSM in-migrants (i Δt ) and out-migrants (o Δt ).

HIV Surveillance Data

California law requires that all HIV laboratory tests be reported to the local health department by both the diagnosing provider and the laboratory performing the test [9]. The San Francisco Department of Public Health collects diagnostic, demographic, mode of HIV acquisition, and vital status information for all reported persons with HIV [10, 11]. This information is stored in the Enhanced HIV/AIDS Reporting System (eHARS) case registry. HIV surveillance data were used to estimate the current number of MSM living in San Francisco with known HIV diagnosis (k t HIV +), new HIV diagnoses each year or “seroconversions” (s Δt ), and deaths in HIV-positive MSM (d Δt HIV +). Additionally, the number of deaths for adult male San Francisco residents each year from 2006 to 2013, from the San Francisco Department of Public Health Vital Records, was multiplied by the proportion of all adult men who are MSM (p MSM ) to yield the estimated number of deaths in MSM each year (d Δt ). To calculate the number of deaths among HIV-negative MSM (d Δt HIV −), the deaths among HIV-positive MSM (d Δt HIV +) were subtracted from all MSM deaths (d Δt ), as explained in Table 1.

Table 1 Migration model parameters and description as to how the parameter was either estimated from external data or derived from other model parameters

Model Overview

A mathematical model was built according to a simple population growth model. For example, Eq. 1 can be used to calculate the MSM population size in San Francisco on January 1, 2008 (MSM t + 1) as equal to the population size that existed on January 1, 2007 (MSM t ), plus the MSM who entered the population during 2007 (in Δt ), minus the MSM who exited the population during 2007 (out Δt ). Note that in our equations Δt denotes a time period from time t to time t + 1, whereas t and t + 1 both denote a specific time point. This model was stratified by HIV serostatus (Eqs. 1a, 1b, and 2) and subsequently by white and black race (equations not shown). Methods used to calculate the model for the entire MSM population (all race/ethnicities) are described below. We applied the same modeling approach to create separate models for white MSM (WMSM) and black MSM (BMSM). Homeless persons were included in NHBS data, MSM population size estimates, and HIV surveillance data; however, those who were homeless and then migrated into and out of San Francisco and were also living on the street may have been missing in US Census ACS data. All modeling analyses used R version 3.2.2 and US Census data were analyzed in SAS version 9.3.

$$ M S{M}_{t+1}= M S{M}_{\varDelta t}+ i{n}_{\varDelta t}- o u{t}_{\varDelta t} $$
(1)
$$ M S{M_{t+1}}^{HIV+}= M S{M_t}^{HIV+}+ i{n_{\varDelta t}}^{HIV+}- o u{t_{\varDelta t}}^{HIV+} $$
(1a)
$$ M S{M_{t+1}}^{HIV-}= M S{M_t}^{HIV-}+ i{n_{\varDelta t}}^{HIV-}- o u{t_{\varDelta t}}^{HIV-} $$
(1b)
$$ \left( MS{M_{t+1}}^{HIV+}+ MS{M_{t+1}}^{HIV-}\right)=\left( MS{M_t}^{HIV+} + MS{M_t}^{HIV-}\right)+\left( i{n_{\varDelta t}}^{HIV+}+ i{n_{\varDelta t}}^{HIV-}\right)-\left( ou{t_{\varDelta t}}^{HIV+} + ou{t_{\varDelta t}}^{HIV-}\right) $$
(2)
$$ i{n_{\varDelta t}}^{HIV+} = {i_{\varDelta t}}^{HIV+}\kern0.5em +{s}_{\varDelta t} $$
(3)
$$ i{n_{\varDelta t}}^{HIV-} = {i_{\varDelta t}}^{HIV-} $$
(4)
$$ {i}_{\varDelta t}={i_{\varDelta t}}^{HIV+} + {i_{\varDelta t}}^{HIV-} $$
(5)
$$ o u{t_{\varDelta t}}^{HIV+} = {o_{\varDelta t}}^{HIV+}+{d_{\varDelta t}}^{HIV+} $$
(6)
$$ o u{t_{\varDelta t}}^{HIV-} = {o_{\varDelta t}}^{HIV-} + {d_{\varDelta t}}^{HIV-}+{s}_{\varDelta t} $$
(7)
$$ {o}_{\varDelta t}={o_{\varDelta t}}^{HIV+} + {o_{\varDelta t}}^{HIV-} $$
(8)
$$ M S{M_t}^{HIV+}={u_t}^{HIV+} + {k_t}^{HIV+} $$
(9)
$$ M S{M}_{t+1}=\left({u_t}^{HIV+} + {k_t}^{HIV+} + MS{M_t}^{HIV-}\right)+\left({i_{\varDelta t}}^{HIV+}+{s}_{\varDelta t}+{i_{\varDelta t}}^{HIV-}\right)\kern0.5em -\left({o_{\varDelta t}}^{HIV+}\kern0.5em +{d_{\varDelta t}}^{HIV+} + {o_{\varDelta t}}^{HIV-} + {d_{\varDelta t}}^{HIV-}+{s}_{\varDelta t}\right) $$
(10)

We accounted for MSM who entered the population during a specific timeframe of 1 year (in Δt ). Equation 3 shows that those entering the HIV-positive population (in Δt HIV +) equaled the sum of HIV-positive in-migrants (i Δt HIV +) and those who acquired HIV (or “seroconverters”) during the timeframe (s Δt ). HIV-negative in-migrants (i Δt HIV −) accounted for all who entered the HIV-negative population (in Δt HIV −) in the model (Eq. 4). The total in-migrants (i Δt ) are the sum of the HIV-negative in-migrants (i Δt HIV −) and HIV-positive in-migrants (i Δt HIV +) (Eq. 5).

We also accounted for exiting from the population (out Δt ). Individuals could exit the HIV-positive population (out Δt HIV +) either through out-migration (o Δt HIV +) or by death (d Δt HIV +), including death from HIV or any other cause (Eq. 6). Exiting the HIV-negative population (out Δt HIV −) occurred by out-migration (o Δt HIV −), death from any cause among HIV-negative MSM (d Δt HIV −), and HIV seroconversion, when previously HIV-negative persons moved into the HIV-positive population (s Δt ) (Eq. 7). The total out-migrants (o Δt ) are the sum of the HIV-negative out-migrants (o Δt HIV −) and HIV-positive out-migrants (o Δt HIV +) (Eq. 8). Not all HIV-positive MSM are aware of their HIV status, so the model differentiates the HIV-positive population size (MSM t HIV +) between unknown HIV (u t HIV +) and known HIV (k t HIV +), as in Eq. 9. Substituting Eqs. 3, 4, 6, 7, and 9 into Eq. 2 yields Eq. 10, which describes each individual parameter that was used in our migration model. In Eq. 10, s Δt was constrained to equal s Δt in Eqs. 3 and 7.

Derivation of Other Model Components

The remaining model components were derived after all estimated parameters were calculated from the data sources as described above. The numbers of MSM with known (k t HIV +) and unrecognized (u t HIV +) HIV were estimated using information from eHARS and NHBS, and the sum of these yielded the total number of HIV-positive MSM for a given time period (MSM t HIV +). Subtracting the total number of HIV-positive MSM from the total population of MSM (MSM t ) yielded the estimated number of HIV-negative MSM for each time period (MSM t HIV −).

$$ {i_{\varDelta t}}^{HIV+}=\kern0.5em {n}_{\varDelta t}*{i}_{\varDelta t} $$
(11)
$$ {i_{\varDelta t}}^{HIV-}=\kern0.5em \left(1-{n}_{\varDelta t}\right)*{i}_{\varDelta t} $$
(12)

After using ACS data to calculate the total number of MSM in-migrants (i Δt ), we used the proportion of in-migrants in the past 12 months who were HIV-positive (n Δt ) from NHBS data to obtain the number of in-migrants who were HIV-positive and HIV-negative, as in Eqs. 1112. Next, we used the number of seroconversions (s Δt ) to estimate the total in HIV-positive (in Δt HIV +), total in HIV-negative (in Δt HIV −), and total in (in Δt ), as in Eqs. 3, 4, and 5.

Deriving the number of out-migrants by HIV serostatus was the main objective for this model. To generate this estimate, we first used Eq. 1a and then re-arranged it to solve for total out HIV-positive (out Δt HIV +), yielding Eq. 13.

$$ o u{t_{\varDelta t}}^{HIV+}= M S{M_t}^{HIV+}+ i{n_{\varDelta t}}^{HIV+} - M S{M_{t+1}}^{HIV+} $$
(13)

Likewise, we re-arranged Eq. 1b to derive the total number of HIV-negative men who “exited” the population (out Δ HIV −), yielding Eq. 14.

$$ o u{t_{\varDelta t}}^{HIV-}= M S{M_t}^{HIV-}+ i{n_{\varDelta t}}^{HIV-}- M S{M_{t+1}}^{HIV-} $$
(14)

The total number of MSM leaving the population (out Δt ) is the sum of HIV-positive MSM out-migrants (out Δt HIV +) and HIV-negative MSM out-migrants (out Δt HIV −).

Next, we estimated the numbers of HIV-positive out-migrants (o Δt HIV +) and HIV-negative out-migrants (o Δt HIV −), by re-arranging Eqs. 6 and 7, as in Eq. 15. In order to obtain the number of HIV-positive out-migrants (o Δt HIV +), we took the total that exited the HIV-positive population from time t 0 to t 1 (out Δt HIV +) and subtracted the HIV-positive deaths (d Δt HIV +).

$$ {o_{\varDelta t}}^{HIV+} = o u{t_{\varDelta t}}^{HIV+}-{d_{\varDelta t}}^{HIV+} $$
(15)

Finally, to calculate the number of HIV-negative out-migrants (o Δt HIV −), we took the total number of MSM who exited the HIV-negative population (out Δt HIV −) and subtracted the HIV-negative deaths (d Δt HIV −) and the seroconverters (s Δt ), as described in Eq. 16.

$$ {o_{\varDelta t}}^{HIV-} = o u{t_{\varDelta t}}^{HIV-} - {d_{\varDelta t}}^{HIV-}-{s}_{\varDelta t} $$
(16)

Output from the model determined our estimates of the numbers of in-migrants, out-migrants, and MSM population size from 2006 to 2013 and a final population size in 2014. These outputs were further stratified by HIV status and by black and white race.

Model Fit and Calibration

We used external estimates of the HIV prevalence for all San Francisco MSM, WMSM, and BMSM to calibrate the models. We specified that if the confidence intervals for the model generated HIV prevalence and the confidence intervals for the NHBS HIV prevalence overlapped for each of the three data points (years 2007, 2011, and 2014), the criterion for proper model fit was met. The model fit for the BMSM model was poor, so we adjusted the p MSM parameter to optimize the fit because there could be differential p MSM by model component (i.e., in-migrants, out-migrants, and deaths). We changed p MSM incrementally, one at a time, from 23% until we met the above outlined criterion for the BMSM model. For out-migration, the proportion of all adult men who were MSM (p MSM ) was changed from 23 to 11.5%, for in-migration p MSM was 25%, and for deaths p MSM remained at 23%.

Uncertainty Analysis

We performed an uncertainty analysis to assess how sensitive the model results were to changes in estimated model parameters and to obtain plausible bounds on the model output. The parameters varied in sensitivity analysis are highlighted in Table 1. One assumption we varied was the proportion of the adult male population in San Francisco who are MSM, where we assumed that for all races/ethnicities the proportion was 19% for in-migrants, out-migrants, and deaths. For whites, the proportion of the adult male population who were MSM was 21% for in-migrants, out-migrants, and deaths. For blacks, it was 11.5% for out-migrants, 25% for in-migrants, and 23% for deaths. We sampled from a normal distribution centered on these assumed values, with a standard deviation of 10%, and allowed the proportion to vary by year and by which parameter we used (total number of MSM in-migrants, total number of MSM out-migrants, and MSM HIV-negative deaths). The number of MSM with unrecognized HIV was varied in uncertainty analysis, where we sampled from a normal curve centered on the NHBS estimate with a 2.5% standard deviation (5% standard deviation for the BMSM model). Likewise, we varied the proportion of in-migrants who were HIV-positive by sampling randomly from a normal distribution centered at the empirical estimate with a standard deviation of 2.5% (5% for BMSM). Last, we sampled from a normal distribution centered at the starting population estimate (for all race/ethnicities, white and black) with a standard deviation of 5% of the population (10% for BMSM). All of the above parameters were varied in parallel and then the model was run to obtain a new model output; models were run 100,000 times in order to obtain a good spread of high and low parameter variations. The 100,000 model runs yielded 100,000 model output copies, and the 2.5 and 97.5 percentiles of the distribution of each output variable were used to create a plausible 95% confidence interval.

Results

Migration Estimates

We first ran a model and uncertainty analysis for MSM of all races/ethnicities in San Francisco. Migration patterns differed for HIV-positive and HIV-negative MSM in San Francisco (Table 2). For HIV-negative MSM, there was a higher proportion of both in- and out-migration than for HIV-positive MSM. For HIV-positive MSM, there was net out-migration in all years, with the highest net out-migration occurring during 2008–2010 (approximately −4.0% per year). There was net out-migration of HIV-negative MSM in 2006–2007 and net in-migration in 2008–2013, with the highest in-migration (4.5%) in 2011.

Table 2 In-, out-, and net-migration estimates for all MSM in San Francisco by HIV serostatus, 2006–2013

Next, we ran a migration model for WMSM only. There were different migration patterns for HIV-positive and HIV-negative WMSM (Table 3). For HIV-negative WMSM, there was a higher proportion of both in- and out-migration than for HIV-positive WMSM. For HIV-positive WMSM, there was a slight net out-migration in all years, ranging from −0.7 to −1.6% net-migration per year. For HIV-negative WMSM, net-migration differed by year. There was net out-migration for HIV-negative WMSM in 2006, 2007, and 2010, and net in-migration in each year in 2008–2013, with the highest net in-migration (4.8%) during 2011.

Table 3 In-, out-, and net-migration estimates for white MSM in San Francisco by HIV serostatus, 2006–2013

Finally, we ran the model on BMSM only. The proportion of the HIV-positive and HIV-negative BMSM who were in-migrants was roughly similar each year, but there was higher out-migration among HIV-positive BMSM compared to HIV-negative BMSM (Table 4). Among HIV-positive BMSM, there was net out-migration in all years, with the highest out-migration in 2006 and in 2007 (−9.9 and −9.4%, respectively). Among HIV-negative BMSM, there was net in-migration in all years except 2013, when the net-migration was −2.0%.

Table 4 In-, out-, and net-migration estimates for black MSM in San Francisco by HIV serostatus, 2006–2013

Population Size Estimates

The model output showed that the population size of all MSM subgroups decreased from 2006 to 2014 (Table 5). The all race/ethnicity MSM model showed that the overall population of MSM decreased 7.8%, from 63,577 in 2006 to 58,605 in 2014. Figure 1 shows that the HIV-positive MSM population decreased 5.4%, from 15,269 in 2006 to 14,452 in 2014, and the HIV-negative MSM population decreased 8.6%, from 48,308 in 2006 to 44,154 in 2014. The population of WMSM decreased from 34,904 to 32,705 between 2006 and 2014 (6.3%). There was a modest decrease (2.1%) in the HIV-positive WMSM population, from 9264 in 2006 to 9066 in 2014, and there was a 7.8% decrease in HIV-negative WMSM, from 25,640 in 2006 to 23,639 in 2014 (Fig. 2). The model showed the largest relative population size decreases for BMSM. There was an 11.9% decrease in all BMSM. The HIV-positive BMSM population decreased 27.8%, from 1968 in 2006 to 1421 in 2014, while the HIV-negative BMSM population remained steady, at 2705 in 2006 and 2697 in 2014 (Fig. 3). Although the models showed decreases in every subpopulation between 2006 and 2014, after running the uncertainty analysis, the plausible ranges calculated show that there could have been population decreases or increases in each subpopulation (see ranges in Table 5 and Figs. 1, 2, and 3). The only exception was that the uncertainty analysis yielded a decrease with 95% certainty in the number of HIV-positive BMSM, from 1968 (range 1674–2382) in 2006 to 1421 (1275–1605) in 2014.

Table 5 Total population size estimates for all MSM, white MSM, and black MSM stratified by HIV serostatus in San Francisco, 2006–2014
Fig. 1
figure 1

HIV-positive and HIV-negative MSM population size, San Francisco, 2006–2014

Fig. 2
figure 2

HIV-positive and HIV-negative white MSM population size, San Francisco, 2006–2014

Fig. 3
figure 3

HIV-positive and HIV-negative black MSM population size, San Francisco, 2006–2014

HIV Prevalence

We compared HIV prevalence from the model to HIV prevalence from the NHBS study to validate the model (Table 6). The HIV prevalence estimates for all races/ethnicities of MSM in San Francisco were very similar between the model (steady prevalence) and NHBS (slightly increasing), suggesting an HIV prevalence around 21–25% during 2007 to 2014. Similarly, the HIV prevalence was steady in our model for WMSM in San Francisco, 27% in 2007, 29% in 2011, and 28% in 2014, while NHBS estimated a slightly increasing prevalence, from 21% in 2007 to 26% in 2014. We observed a decreasing HIV prevalence over time for BMSM in San Francisco. Our model showed a decrease in the prevalence of HIV from 39% in 2007 to 35% in 2014. Similarly, NHBS data showed that for BMSM, the HIV prevalence decreased slightly from 30% in 2007 to 28% in 2014.

Table 6 HIV prevalence comparisons between external NHBS source and model output

Discussion

All nine MSM populations studied (all MSM, BMSM, WMSM, and each of these populations stratified by HIV status) decreased in size from 2006 to 2014. There are several reasons why there may be decreasing MSM populations in San Francisco. Given recent cultural shifts, the Castro neighborhood may no longer be perceived as a “gay Mecca.” It may be less important for MSM to live in areas defined as “gay friendly” as US culture has evolved, the LGBT communities have found more acceptance, and stigma has decreased. Research has shown that acceptance of gays and lesbians in the US greatly increased from 1990 to 2010 [12, 13]. The potential for these cultural shifts to change migration patterns of MSM moving into and away from San Francisco is likely coupled with the economic changes and cost of living increases that San Francisco experienced during the time period studied. San Francisco MSM have similar levels of educational attainment as the entire San Francisco population, although the median income of MSM was lower than the median income of all San Franciscans in 2014, which suggests that it may be difficult for MSM to continue to stay in or migrate to San Francisco due to high cost of living [14].

We also found differences in migration by race and HIV status. For all racial groups, the HIV-positives had net out-migration every year, although BMSM had the highest proportion of net out-migration for all years. Living with HIV could affect one’s ability to work full time and could increase health care expenses, which could also make it difficult to continue to live in San Francisco, where the cost of living has continued to rise. Racial differences in socio-economic status may explain the higher proportion of out-migration for BMSM estimated in the model. One concern is that the most vulnerable people living with HIV are being displaced from San Francisco, due to rising cost of living, and they may be re-locating to areas where funding and infrastructure to provide the services they need to manage HIV do not exist. Disruption in HIV care can lead to increased HIV viral load, negatively affecting a person’s health and increasing the risk of HIV transmission. Homelessness among persons living with HIV in San Francisco has been associated with failure to have a suppressed HIV viral load, putting homeless HIV-positive individuals at increased risk of poor health outcomes and of transmitting HIV to others [15]. Stable housing can improve health outcomes, such as ART adherence, and increase utilization of health and social services [16]. The “displacement” theory of a shrinking MSM population in San Francisco aligns well with our model results and with the recent economic changes in San Francisco, but further research is needed to determine if displacement or homelessness has contributed to a decline in the number of MSM in San Francisco. Additionally, while San Francisco is generally seen as a city widely accepting and supportive of persons living with HIV especially relative to other parts of the country, HIV-positive MSM in San Francisco still face stigma based on their HIV serostatus [17, 18]. As a result, this stigma may lead some HIV-positive MSM to leave San Francisco and may explain the pattern of out-migration we observed for HIV-positive individuals.

For the HIV-negative populations, there tended to be net in-migration, but after accounting for HIV seroconversions, deaths, and migration, the HIV-negative populations declined from 2006 to 2014. Of note, a substantially higher proportion of HIV-negative MSM in-migrated versus the proportion of HIV-positive MSM that in-migrated for all races combined and for WMSM. One reason we may have observed a general pattern of more out-migration for HIV-positive individuals and net in-migration of HIV-negatives is an effect of age structure. HIV prevalence increases with age, and in San Francisco the majority (58%) of persons living with HIV are ≥50 years of age [5]. HIV-positive out-migrants may be of older or retirement age, no longer working in San Francisco, and therefore out-migrating to lower cost areas. Similarly, HIV-negative MSM likely are on average younger and may be more likely to move to San Francisco due to employment opportunities, or because of the “gay Mecca” theory. Black et al. argued that due to extra resource availability (due to lower frequency of having children and lower demand for larger housing units suitable for families), gay men live in San Francisco for access to “urban amenities” such as art, entertainment, and fine dining; HIV-negative MSM may have more economic resources than HIV-positive MSM, which could explain why there is more in-migration by HIV-negative MSM [19].

The models are subject to several limitations. We made a number of assumptions in creating the models and were limited by the variables we were able to include in the model. For example, we did not model migration patterns by age or income or for races/ethnicities other than white and black. We also did not include in our models the geographical location of the migration, or differentiate between migration from or to counties adjacent to San Francisco as opposed to migration that occurred out of state. We assumed that the number of individuals who “enter” the MSM population through change in behavior was roughly equal to those that exited the MSM population by stopping sex with men; therefore, our models did not include sexual behavior changes. We also did not account for the number of young MSM that turned 18 years of age each year in our model. The largest uncertainty in the model was for the estimation of the proportion of the total adult male population (p MSM ) who are MSM. However, other researchers used different methods to estimate MSM population size and reported p MSM as 18.5% in San Francisco which was very close to our estimate (19%) [20]. We accounted for uncertainty in p MSM and other parameters by performing an uncertainty analysis and including ranges of plausible values for the model outputs.

Other researchers can apply our methods for estimating migration patterns for MSM, or other hidden populations, in their respective jurisdiction. Model output may be useful in understanding how migration affects the size of MSM populations, stratified by HIV status. Researchers in King County, Washington demonstrated that failure to account for migration resulted in an overestimation of the number of persons living with HIV and the number of persons who were out of HIV care in that jurisdiction [21]. Grey et al. recently reported an estimated San Francisco MSM population of 66,586 during 2009–2013, which is 13% higher than our MSM population size estimate in 2013, but their method did not incorporate migration [20]. Similarly, another recent publication demonstrated that the number of people living with HIV in the US may be overestimated by as much as 25% when using HIV case reporting data [22]. The authors noted that this overestimation is, in part, due to migration of people living with HIV across public health jurisdictions and that failure to de-duplicate these cases results in an HIV case being counted more than once in the national HIV registry [22]. As more health departments use HIV surveillance data to identify persons out of HIV care and re-engage them in care, migration can make efforts to track people presumed to be living in that jurisdiction more difficult [23, 24].

Migration estimates from these models can also be used as inputs in HIV transmission models to determine how migration influences HIV transmission. Modeling HIV transmission in South Africa under different scenarios has shown that if migration is coupled with higher sexual risk behaviors, it can increase transmission tenfold [25]. Migration could affect HIV transmission not only if it is related to high risk behaviors (i.e., condomless sex) but also if HIV-positive migrants experience disruption in their HIV care and their HIV viral load increases enough to transmit HIV. Prior research in Africa has shown that migration is a risk factor for acquiring HIV and is related to riskier sexual behaviors, having more sexual partners, and expanded sexual networks [26,27,28]. Another analysis found that the odds of having HIV did not differ significantly between foreign-born and US-born MSM in San Francisco, after controlling for other factors [29]. More research is needed to characterize age, employment status, and income of MSM who are migrating, their reasons for migrating, and how these factors relate to their risk of acquiring or transmitting HIV. We aim to use our migration output in a transmission model to better understand how migration can impact HIV transmission among MSM in San Francisco.