Socioeconomic biases in urban mixing patterns of US metropolitan areas

Urban areas serve as melting pots of people with diverse socioeconomic backgrounds, who may not only be segregated but have characteristic mobility patterns in the city. While mobility is driven by individual needs and preferences, the specific choice of venues to visit is usually constrained by the socioeconomic status of people. The complex interplay between people and places they visit, given their personal attributes and homophily leaning, is a key mechanism behind the emergence of socioeconomic stratification patterns ultimately leading to urban segregation at large. Here we investigate mixing patterns of mobility in the twenty largest cities of the United States by coupling individual check-in data from the social location platform Foursquare with census information from the American Community Survey. We find strong signs of stratification indicating that people mostly visit places in their own socioeconomic class, occasionally visiting locations from higher classes. The intensity of this ‘upwards bias’ increases with socioeconomic status and correlates with standard measures of racial residential segregation. Our results suggest an even stronger socioeconomic segregation in individual mobility than one would expect from system-level distributions, shedding further light on uneven mobility mixing patterns in cities.


Introduction
Patterns of socioeconomic inequality can be found everywhere in a modern city. Large variations in earned income leading to uneven access to services, healthcare and education [2,39], as well as spatial and housing segregation [20,42], are just two of the most drastic examples of socioeconomic disparity. Less studied is the segregation related to mobility mixing, where people from different socioeconomic classes encounter each other less often than what is potentially allowed by the city fabric [13,34,35].
Big data presents a unique opportunity to analyse the role of human mobility in segregation, from the level of individuals to the scale of societies. Digital data tracing human movements in cities ranges from mobile call detail records (CDRs) [17,41] and GPS trajectories [4,16,43], to location-sharing services (LSS) and check-in sequences on social media platforms [19,21,47]. The analysis of these data sources, providing anonymised individual trajectories with unprecedented spatiotemporal resolution, has proven essential for our growing understanding of the underlying mechanisms of human mobility [3,5,10,45], and the associated ability to predict future trajectories [6,12]. It also offers the possibility to engage in a more comprehensive and nuanced exploration of urban socioeconomic segregation, by combining high-dimensional mobility data with information on the socioeconomic traits of individuals [13,24,26].
Earlier studies on human mobility present evidence of characteristic spatial scales [3,10,17,41], as well as a correlation between human spatial behaviour and socioeconomic dynamics [9,27,37]. Rather than being homogeneously mixed, human mobility (as represented by daily individual trajectories throughout urban spaces) is strongly influenced by socioeconomic preferences. People sharing socioeconomic backgrounds are more likely to visit similar places within their class range and interact amongst themselves [8,31,44,49], thus generating stratified mobility and social network patterns. In the presence of homophily mixing [30], spatial exploration is dictated by one's socioeconomic class, reducing the number of visits to locations with different economic status, and thus inducing highly predictable trajectories. However, when people aspire to diversify their experiences by, e.g., visiting lavish areas of the city, where they have never been able go before, the potential for an upwards bias in visiting patterns appears. Meanwhile, other has studied the effects of segregation of mixing in urban places using location data to explore exploration/exploitation behavioural patterns and their correlations with socioeconomic status [33].
Homophily mixing is not the only mechanism influencing mobility patterns. The variability of socioeconomic traits such as ethnic group, education level, occupation sector, etc. also constrains the possibility of movement in urban spaces via residential segregation [20,42], where people with similar backgrounds live next to each other and form fragmented areas in the city. Given the potentially complex interplay between human mobility and socioeconomic stratification, it is worth asking whether the presence of biased mobility across tracts of some socioeconomic trait is associated with lower residential segregation. This is particularly relevant given the number of studies reporting mobility as a key pillar in diminishing segregated spaces among people from diverse groups in society [14,15,40,46]. People show heterogeneity in many aspects, including their mobility characteristics and socioeconomic capacities, which shape their patterns of movement across urban space. In an attempt to better understand such mobility patterns, we focus here on socioeconomic and mobility heterogeneities at the individual and class levels. Given the heavy-tail nature of human mobility (in which a few outliers have remarkably longer trajectories and higher socioeconomic diversity of visited places), heterogeneities may vary across levels. Therefore, it is in our interest to quantify the variability of individual mobility and to compare it with the typical behaviour of others in a given socioeconomic class.
In this study, we emphasise the need to query the extent to which behavioural segregation (bias in mobility) is related to residential segregation. We take a step forward in the current analysis of segregation in mobility by asking the following question: How do socioeconomic attributes and geographic constraints affect the spatiotemporal process of individuals moving in urban spaces? To answer this question, we analyse individual check-in trajectories in the twenty largest cities of the United States, coupled with detailed socioeconomic maps indicating the economic status of people and places they visit. After a short data description, in the following we will introduce stratification matrix measures and individual-and class-level mobility bias scores to quantify patterns of mobility segregation, visiting biases, and their variation across cities with wide-ranging socioeconomic and ethnics segregation profiles.

Data description
In order to simultaneously capture the mobility patterns and socioeconomic status of people, we concentrate on two independent sources (mobility and socioeconomic data, described below) and combine them using spatial information.
Mobility data: To construct individual mobility trajectories, we analyse a large, open Foursquare dataset [48], which records how people move from one place to another. Data comes as a sequence of user check-ins to places, or points of interest (POIs), thus providing information on mobility trajectories of individuals and visiting frequencies of places. This dataset is not collected directly through the Foursquare open API, but from Foursquare check-ins via Twitter. The crawling method corresponds to 18 months of observations between April 2012 and September 2013 for users with Foursquare-tagged tweets. Using this mobility data, constituted by roughly 37,860 people with nearly 1,857,100 check-ins, we concentrate only on active users (who checked-in from at least two different places during the observation period). Focusing on the 20 largest metropolitan areas in the US, we also infer the home locations of 26,502 users following a conventional pipeline of conditions [29] [for a detailed description of the method and a statistical summary see Supplementary Material (SM) Section A].
Socioeconomic data: To estimate the socioeconomic status of people and places, we rely on the 2012 American Community Survey (ACS) [11] (recorded in the year matching the closest to the Foursquare observation period). After identifying the corresponding ACS census tract where a user's home location lies, we associate the socioeconomic indicators of this location to the individual. In order to estimate the economic status of a place, we follow a similar strategy and assign local socioeconomic status indicators to POIs based on their locations. Although the socioeconomic status of venues could arguably be better estimated from their pricing, this information is at present not available to us. Thus, we assume that the socioeconomic status (SES) of people living at a location is well correlated with the pricing of venues in the same neighbourhood and offered services around (for a summary of our data construction pipeline see Figure 1).
In order to obtain a proper representation of socioeconomic status in the context of segregation, we consider 78 features from the ACS data. Although such a large number of dimensions in principle provides a rich way of quantifying the socioeconomic status of locations (and people living there), it turns out these variables have high redundancy. We perform a principal component analysis to identify the most relevant ones and find that income features (11 variables) have the largest loading, accounting for most of the socioeconomic variance between places. After implementing three different techniques (mutual information rank [22], decision tree [18], and Gini coefficient [38]), per capita income consistently stands out as the best indicator of individual SES: It accounts Overview of data sources, data processing pipelines and data combination steps to obtain data for the analysis of socioeconomic segregation in spatiotemporal urban mobility. (right) As a result we obtain a bipartite network, with nodes classified into two sets comprising individuals u and POIs p. Each node in both types is labelled by a socioeconomic indicator (c U and c P ) assigned via our location-based method on the census tract level. Weighted edges between individuals and POIs indicate the frequency of visits of a given user to a given place.
for the largest variance and it correlates strongly with other income variables such as earning/wage, wealth, and supplementary source of income (for more details on this analysis see SM Section A). By using the average per capita income as the socioeconomic indicator of active users living in a given tract, we sort them in an ascending order. To group them into distinct socioeconomic classes, we then segment this sorted list into 10 equally populated groups with people of the lowest income in class 1 and highest income in class 10. By means of this procedure we assign a socioeconomic class cU to each user. In identical fashion, each venue is assigned a value cP .

Results
Our main scientific goal is to study socioeconomic segregation and biases in population mixing in cities by observing correlation patterns between the SES of people and places they visit. Using the collected data, this objective can be addressed by building a network of individuals visiting places. We define a stratified bipartite network G = (U, P, E), where individual u is a node in set U , and place p belongs to set P (with U ∩ P = ∅). People and places are connected by edges eu,p ∈ E with weights wu,p coding the number of times person u visited place p (see Figure 1). Further, we stratify U into a set of socioeconomic classes indexed by values from CU thus assigning a class membership cu = i ∈ CU to each individual.
In the same way we define cp = j ∈ CP classes for places. This network representation captures all information about the socioeconomically stratified visiting patterns of people to venues, coding their possible encounters and giving an aggregated description of the potential mixing patterns of people of different socioeconomic classes.

Matrix measures
Based on the bipartite network representation we can measure the frequency at which people of a given class visit places in different classes. To summarise these visiting patterns we use stratification matrices [24]. An empirical stratification matrix gives the probability that a person u ∈ U from a given socioeconomic class cu = i ∈ CU visits a place p ∈ P belonging to a class cp = j ∈ CP . More formally: where the numerator counts the number of times people from class i visit places of class j, and the denominator normalises this frequency matrix column-wise to obtain a visiting probability distribution for each individual class i ∈ CU . Such matrices are shown in Figure 2 for selected cities (Houston, New York and San Diego). The dominant diagonal elements for Houston and San Diego indicate strongly stratified visiting patterns in these cities. People prefer to visit places of their own or similar socioeconomic class, rather than places from remote classes. Interestingly, for New York this pattern is less evident suggesting weaker socioeconomic preferences in visiting venues.
To decide if these patterns appear as the consequence of population statistics or other confounding effects, we compare the matrix Mi,j to a reference matrix, which measures similar stratification patterns in a system where visiting patterns appear uniformly at random with certain constraints. This randomised stratification matrix is defined through a random rewiring process of the bipartite network, while constraining the total number and frequency of visits of each individual (i.e. their activity and link weights), the class of individuals and places, but fully randomising links between individuals and visited places otherwise. The randomisation is performed by selecting randomly for each link of an individual u a place to visit from the set of places ever visited by their respected socioeconomic classes cu, while keeping the link weight intact. This in-class randomisation allows us to compare an individual's behaviour to similar others, meanwhile distinguishing between socioeconomic classes, which potentially are characterised by very different visiting patterns.
After generating randomised bipartite networks via 100 independent realisations, we compute a similar column-wise normalised stratification matrix Ri,j, representing the probability of people from class ci randomly visiting to places of class cp. To finally obtain whether the empirical mobility patterns appear more frequently than by chance, we compare the empirical and the preference-based null model matrices. We obtain a normalised stratification matrix Ni,j by taking the element-by-element fraction of the empirical and random contact matrices as: Ni,j = Mi,j Ri,j . ( Each element in the matrix Ni,j, which are Ni,j > 1 (red bins in Fig. 2d-f) indicates that the visits made by individuals from class i ∈ CU to place of class j ∈ CP appeared with higher probability in the empirical observations than it was expected from the random null model.
Otherwise, the blue blocks for Ni,j < 1 show that the corresponding visits appeared with a smaller probability than expected by chance. In cases red bins dominate the diagonal of the normalised matrix Ni,j, it indicates patterns of socioeconomic stratification, where people prefer to visit places of similar socioeconomic status as their own, rather than places, which are richer or poorer than them. This is the case of Houston and San Diego (see Fig. 2d and f respectively) and many other cities listed in SM Section B. However, this character is less evident for New York (see Fig. 2e), where despite known strong residential segregation, the city fabric mitigates a more homogeneous mixing of people.
These normalised stratification matrices reveal further characters of possible biases of people in choosing places to visit, out of their own class. If in a city people exhibit upward visiting biases, thus they tend to choose more expensive places to visit when they step out of their own class, the upper diagonal matrix elements of Ni,j would appear dominantly red. While, if the opposite is true, the lower diagonal elements would reflect similar but downward visiting biases. To simply quantify these patterns, we compute the average values Ni,j elements of normalised stratification matrix of cities above, at, and under their diagonals. From Fig. 2g it is clear that, in all cities, diagonal elements dominantly concentrate visiting probabilities. However, in terms of off-diagonal averages, in most of the cities (like in Houston in Fig. 2d) the upper diagonal average takes a larger value as compared to the lower diagonal average, indicating present upward visiting biases in these metropolitan areas. Meanwhile, in some cases the contrary is true (like in San Diego in Fig. 2f) or in some cities these averages are very similar thus indicating no dominant upward or downward visiting biases, as in case of New York (see Fig. 2e and Fig. 2g).

Individual bias
The matrix measures presented in Fig. 2 reflect the coexistent socioeconomic configurations derived from visit trajectories. Firstly, the empirical stratification matrices Mi,j bring an initial indication of homophily mixing as seen in the dominant frequency visit within own class. Secondly, these results reveal the underlying inclination in visiting places situated in higher SES as depicted by the larger proportion of upper diagonal elements in the normalised stratification matrices Ni,j in most of the cities. Taking these two configurations into account, it can be inferred that while individual mobility is dictated by the membership of socioeconomic class most of the time, the embedded motivation to visit upper class places is still present.
We take a technical step ahead in order to adequately quantify this visiting bias that indicates deviations in mixing from the respected cu socioeconomic class of an individual. We compute a single empirical individual bias where cp u = p∈P wu,p×cp n u p is the average socioeconomic status of places an individual u visited, defined as the fraction of the p∈P wu,p × cp sum of socioeconomic status of places in the trajectory of individual u and the n u p = p∈P wu,p number of times individual u visited any places. An individual has upward visiting bias if her individual score Bu is positive, meaning that she tends to visit places located in more affluent areas than where she lives. Secondly, an individual with negative score value has downward visiting bias since places she usually visits are situated in lower socioeconomic class than her own. Otherwise, an individual does not have any indication of bias (Bu = 0) if she visits places within her own socioeconomic rank. A reference model for this measure can follow a similar logic as the in-class randomisation for the realisations of network reference models explained before. Given the individual trajectory resulted from the random visit generating process, we calculated a randomised individual bias score using the same formula as in Eq. 3. Note that in this measure boundary effects may appear, as people from the poorest class cannot exhibit downward bias, and similarly, the highest class cannot be upward biased. Individual bias scores can be fairly compared to null models, which retain these boundary effects. In-class randomisation fulfils this requirement, providing an average randomised bias score B rand u for each individual separately. Note, that the randomised individual bias scores take non-trivial values, different from zero, due to the individual variance of visiting frequencies of individuals to different places. These are represented by the weights wu,p in the bipartite network, which are preserved during the randomisation process.
The comparison of the empirical and in-class normalised individual bias scores can be best quantified by an individual bias z-score as where B rand u is the mean and σ B rand u is the standard deviation of the randomised individual bias scores across 100 independent realisations of the null model. The value of Z Bu u reflects how much the individual bias deviates from the expected bias for an individual who chooses places to visit with the same frequency as before but selects them from a given set of places dictated by others within the same socioeconomic class.  (Fig. 3c). The overall increasing trend of medians (blue dots) indicates that people from lower classes are less biased than expected, while the contrary is true for others from higher classes. Solid red line indicates the fully unbiased case. For results on other cities see Section C and Fig.6 in the SM.
The class distributions of individual z-scores together with their median values are shown in Fig. 3, where the unbiased level is assigned as a flat red line. These distributions appear broad for each class, indicating that actually people from any class exhibit upward or downward biases in terms of their visiting patterns to other socioeconomic classes. Interestingly, the median z-scores indicate an increasing trend in all the three depicted cities. The people from lower classes appear with slightly negative bias z-score, meaning they have a slightly weaker bias to visit places of different socioeconomic classes than expected from their random visiting patterns. In contrary, the middle and upper classes are evidently biased stronger than expected. This increasing trend of the median of the individual bias z-score with socioeconomic classes surprisingly characterises all the investigated cities as shown in Section C and in Fig.6 in the SM. Although this is a robust pattern, certain variations appear between cities, which can be explained by the spatial distribution of venues with respect to the socioeconomic fabric of the city population.

Class-level bias
The individual bias score Bu compares the average class of visited places of an individual to its own socioeconomic rank inferred from its home location. Meanwhile, its z-score z Bu u indicates if this individual bias is weaker or stronger than expected from random behaviour. However, this measure is using the class label of the individual as a reference of comparison, and it says less about whether an individual visits higher or lower class places as compared to the random expected behaviour characterising other individuals in its own class. To directly measure this effect we introduce a class level z-score measure where cp u is the average socioeconomic status of places individual u visited, and cp rand cu and σ rand cu are the average and standard deviation (respectively) of class of places that others from class cu would visit if behave randomly. This reference measure, just like before, is generated by in-class shuffling to obtain null models over 100 realizations. The value of z cu u reflects directly how much the individual behaviour deviates from the expected level, when the individual could choose randomly places to visit from a given set dictated by others from the same socioeconomic class.  Fig. 4 show a different behaviour as compared to the individual bias scores. In case of New York (see Fig. 4b), the distributions of the class level bias z-scores indicate that, although the variation is large in each socioeconomic classes, the medians of these distributions are all slightly positive and independent of the socioeconomic class. This signals a weak upward bias in people's visiting patterns in New York as compared to the class behaviour that appears for each class. In other cities, we find several other bias patterns during our analysis (see SM Section C and Fig.7). In case of San Diego (in Fig. 4c) class-level biases are all positive and evidently increasing with the socioeconomic classes. This suggests that richer people in San Diego may visit even more affluent places, than one would expect from their random class behaviour. Somewhat the opposite trend can be observed for Houston (Fig. 4a), where although the class-level bias z-score is always positive and indicates upward bias for each class, it seems to follow an overall decreasing trend.

Results in
Visiting patterns measured by the class-level bias scores suggest that an upward socioeconomic bias characterise each cities we study. However, although these measures incorporate the visiting frequency distribution of individuals, they do not show evidently that upward biases typically appear due to repeated visits to places with higher class scores, or due to several occasional visits to places out of ones socioeconomic classes. To answer this question, we recompute the median bias scores, excluding places which were visited less number of times by an individual than a given threshold. Results are depicted in Fig. 5 for each city. As expected, the median class-level bias score appears as a decreasing function of the frequency threshold in each city. This suggests that people visit more frequently places, which are closer in terms of socioeconomic status to their own class, while visit more affluent places occasionally only, that in turn causes upward bias patterns characterising their class. Beyond this general decreasing character, this function indicates large variance between different cities. For example, in case of San Diego (red line in Fig. 5), this curve starts from a high z-score value when all visits are consider but decreases rapidly as repeated visits are taken into account. In case of New York this function starts from a relatively small z-score values and decrease linearly for larger threshold values. This suggests a different visiting behaviour where people typically visit places more than one time, but closer to their own socioeconomic class.

Mobility mixing and segregated residences
While there is an expected relation between the mobility mixing patterns and residential segregation in a city, the combined investigation of these phenomena has not received much attention so far. Their relation is important however for several reasons. For example, due to the multitude correlated socioeconomic factors it is likely that e.g. ethnicity, which strongly correlates with income status in US metropolitan areas, correlates also with residential segregation, as it has been shown in several studies [1,20]. On the other hand, the daily mobility of people and their visiting patterns to different places are constrained also by these socioeconomic factors, thus they are likely to resemble similar segregation patterns. To investigate these correlations, we focus on different ethnic groups and the likelihood of their mixing in cities, which exhibits different level of mobility segregation patterns.
To quantify the level of segregation in mobility mixing, we analyse the earlier introduced normalised strat- Figure 5: Sensitivity of class-level bias z-score z cu u . Lower bound cutoff is set as b ≥ 1 to which we only take into account venues visited at least once. For each set of venues in individual trajectory cumulatively visited b times or higher, we measure class-level bias z-score z cu u and take the median values. Upper bound cutoff b ≥ 20 is added to accommodate venues visited even more frequently. As b incrementally becomes larger, the medians are largely dropped closer to 0. It indicates that venues visited more frequently tends to be more homogeneous in term of mixing and closer to own socioeconomic status.
ification matrix Ni,j for each city. As we have discussed, signatures of segregation can be associated to strong diagonal elements in these matrices, indicating that people of a given SES are the most likely to visit places associated with the same or similar SES, as compared to random visiting patterns. To quantify the strength of diagonal concentration of visiting probabilities, we measure the diagonality index of the normalised stratification matrices [7], which is similar to the assortativity coefficient used by others [13,36]. It is defined as the Pearson correlation coefficient of matrix entries as Here i ∈ cu indicates the socioeconomic class of individuals and j ∈ cp is the same for places. The diagonality index takes values between −1 and 1. In case it is 1, it indicates perfect assortative mixing corresponding to a fully stratified matrix with non-zero elements in its diagonals and zero anywhere else. Cities with large rn values are characterised by visiting patterns of people who are strictly bounded to places associated to their own socioeconomic class. On the contrary, if rn takes smaller than zero values (in extremity rn = −1), it indicates dis-assortative connections between people and places of different socioeconomic status. This corresponds to mobility mixing patterns where people prefer to visit places of different SES rather than places from their own class. In case rn = 0, the normalised stratification matrix is flat indicating no choice preferences of people to visit places with particular SES.
The mixing patterns in a city may not be only determined by the socioeconomic status of people but also by residential segregation. Residential segregation is strongly correlated with the ethnicity of people [1,25,28], which in turn, according to Wang and others [44], is an even stronger predictor of mobility mixing than socioeconomic status when it turns to black, Hispanic, and white poor and non-poor populations. This study found that the minority groups -despite their socioeconomic status -have lower exposure to richer or white neighborhoods, comparing to poor white groups. The fact that they travel across similar distance and frequency to many places, does not change the persistent pattern of their isolation and segregation. Therefore, racial segregation emerges from a higher-order level, not limited to their residential neighborhood but expanded to their mobility and potential contact.
To address the effects of residential segregation on mobility mixing, we took a similar path than others [23,44] and considered the ethnic group distribution in a city as a proxy. Residential segregation is indicated by housing clustering tendency of individuals from the same ethnic group. This can be formally quantified by the so-called distance decay isolation [32], which measures the probability that a racial group minority interacts with members of their own group by considering the distance from the racial group minority's housing area. This is measured as: where xi and xj are the population sizes of a minority group in census tracts i and j (respectively), X = i xi is the total population of the minority group, and tj is the total population of census tract j. The distance decay , where dij is the distance between the centroids of census tracts i and j.
Hence, higher index suggests higher probability of interaction with people from the same group, inferring isolation from the rest of population. In our case, we use a probabilistic individual profiling to identify the most likely socioeconomic profile of an individual based on the ethnic group with the highest proportion at the respected census tract where one lives. For instance, if an individual u lives at census tract i where the racial composition there is 60% white, 15% Hispanic, 10% black, and 5% Asian, this individual is considered as white. We consider different thresholds at first and we find out that considering a neighbourhood the ethnicity if such people consist of at least the 30% of the given tract is the optimum cut-off because it is the highest threshold with the lowest unidentified census tract ethnicity profiles.
Recalling the above mentioned diagonality index and individual bias, we take the average of z-score of each of these bias measures at the level of ethnic groups in every urban area and correlate them with their distance decay isolation value computed for the same ethnic group in the same city. By considering four ethnic groups (White, Hispanic, Black and Asian) we receive four data points for each cities as shown in Fig. 6. To see how much the analysed Foursquare population is representative for each ethnic group in a city see SM Section A. Although the total number of analysed individuals are not proportional to the total population of each city, the in-city fraction of different ethnic groups are similar to the census distributions.
There is a striking correlation emerging between the diagonality index (quantifying assortativity mobility mixing of each ethnic groups) and the distance decay isolation (measuring the isolation of different ethnic groups) with R = 0.35 (p = 0.0). Notably, almost all diagonality index measures appear with positive values suggesting assortative mixing for most ethnic groups, with a few exceptions. Further, the overall correlation suggests the intuitive picture that the stronger mobility mixing stratification patterns characterises a city (i.e. larger its corresponding diagonality index), the stronger isolation patterns emerge between its ethnic groups. In turn, it indicates that residential segregation (and thus physical proximity) play an important role in determining visiting and mixing patterns of people in a city. More interestingly, the de-coupled ethnic groups for each city show an emerging clustering, which assigns the importance of racial differences in mobility segregation. From Fig. 6a it appears that people belonging to the white ethnic group (shown as orange points in Fig. 6a) appear to be the most isolated from the rest of the population (with the largest values of Dpxx * ), while they appear with the strongest assortative mobility segregation patterns too (with the highest diagonality indices) consistently in several cities (to lead the eye we coloured this group as an orange blob in Fig. 6a). The contrary is true for the members of the Asian ethnic groups (indicated by red points and blob in Fig. 6a). In most cities they appear as the least isolated and the most dis-assortative (least stratified) ethnic group, thus mixing well with the rest of the population. In between these two groups, people from the Hispanic ethnic group (green points and blob) seem to be more isolated than people from the black ethnic group (purple points and blob) although they show comparable strength of segregation in mobility mixing, all weaker than white people.
Needless to say that the grouping patterns shown in Fig. 6a indicate overall trends only, while several exception exists for each ethnic group. For example, the Hispanic ethnic group of Charlotte appears with the strongest assortative pattern, although this group is not strongly isolated from the rest of the population. Or the black community of Austin appears with the lowest diagonality index, suggesting a strong dis-assortative mixing of these people with the rest of the population, while they also appear as one of the least isolated among any other communities.
A similar positive correlation appears in Fig. 6b with R=0.25 (p = 0.04) between the average individual bias z-score and distance decay isolation values over all the investigated ethnic groups and cities. Moreover, ethnic groups show certain clustering trends, which suggest ethnic trends in terms of visiting bias patterns. Interestingly, white ethnic groups (shown by orange points and blob), who we have already found the most isolated, show the strongest upward bias to visit more affluent places then their own socioeconomic class. As high SES classes are populated mostly by white people, this pattern derives from our earlier observations in Fig. 3, where we find upward bias to increase with the SES of people. Their high isolation score can be explained by their upward bias towards higher socioeconomic places, which are most likely to be visited by other white people. Meanwhile, it may also indicate that our data have an over-represented white population, as we find upward biases in all of the cities. Strikingly, other racial groups indicate negative visiting biases and lover level of isolation. This effect is the strongest for people from black racial groups all over the country, but also characterises Hispanic and Asian communities although they show more unbiased patterns, with average individual z-score values closer to 0.
Exceptions are again interesting. The Hispanic community of Washington appears as the most upward biased ethnic group, while the black ethnic group of Seattle sits on the other end of the spectrum and being the most downward biased minority among the analysed cities. Both of these communities appear with low level of isolation. Consequently, similar to the conclusion of Wang et al. [44], we observe that beyond socioeconomic status, ethnicity (strongly correlated with residential segregation) is another very important factor determining mixing patterns of people.

Discussion and conclusions
Mobility patterns are strongly determined not only by the fabric of a city but also by the socioeconomic structure of the population living there. This leads to biased mixing and segregation in mobility, which can be observed as stratification patterns in choices to visit places. We addressed this complex phenomenon via a mobility analysis of people living in the 20 largest cities in the US, and aimed to quantify segregation patterns in mobility capturing their visit patterns to places of interest. We systematically found upward-biased mobility in all cities, with some variance across metropolitan areas. In one extreme, people living in New York do not exhibit dramatic stratification in their visit patterns but visit places in all kinds of locations, rich or poor, independently of their own socioeconomic status. Meanwhile, in Houston and San Diego people are more stratified and visit places of their own socioeconomic class, and show an upward bias towards richer places to visit. We found that this upward bias, which characterises most cities analysed, is usually induced by single visits of individuals to affluent places, while most visits correspond to their own socioeconomic class. We also revealed distinct patterns of individual mobility in terms of stratified correlations between the bias magnitude and residential segregation based on spatial distribution of racial groups in urban areas. Visual representations of ethnic clusters indicate overall trends of behaviour characterising most cities, where segregated mobility is bounded together with residential segregation and broadly contributes to the portrayal of inequality.
It should be taken into account that data for a given socioeconomic class in the population might not be comparable from one city to another due to sampling in the data collection process (see SM Section A). Multiple sources of data containing digital traces of human movements with higher resolution, such as mobile phone call records and GPS trajectories, may improve the robustness of findings presented in this paper. Methodological improvements to infer individual attributes (like racial group membership) provide a direction of future research. Moreover, algorithms for probabilistic individual profiling could be developed by using machine learning techniques such as Random Forests and Support Vector Machines in the presence of ground truth information from alternative data sources.
One potential confounding factor of the emergent stratification patterns reported here is distance, as people visit places closer to their home more frequently, thus inducing similar correlation motifs. To check the robustness of our methods in investigating segregation in mobility and biased visiting patterns and the magnitude of such distance effect, we recomputed our results on out-of-class data after excluding own census tract visits for each individual's trajectory. Even with this constraint, SES plays a considerable role in shaping mobility (comparative observations for all cities can be found in SM Section B and D, along with SM Section F Fig.12 in the case of Houston, New York, and San Diego, in contrast to Fig.2 above). On the ground of visiting biases, there are some variations among cities regarding individual bias. The earlier notion of upward visiting bias is also very much present in the case of out-of-class measurements since z-score values are all positive above the red median unbiased line (complete plots are available in SM Section C and E, while a deeper exploration for Houston, New York, and San Diego is available in SM Section F Fig.13 and Fig.14). Therefore, there are no conflicting results from our methodology even after controlling for this confounding factor. Enforcing out-of-class treatment is reasonable in this context because our study aims to analyse and quantify mixing patterns and not yet look for causal links or underlying reasons of their emergence.
Segregation is not an exclusive phenomenon to the quasi-static configuration of housing settlement, but also exists in more dynamic settings such as mobility. Questions about the conceptual relations between segregated mobility and segregated residence stand still in the literature, yet relatively untapped, while scientific investigations should follow this line of inquiry. We take a step forward through empirical data-driven analysis and yield an interaction effect between both types of segregation. Individual attributes (such as racial groups) partly explain the emergence of distinct clusters, beyond income levels. Our findings also highlight the notion that inequality is multidimensional in nature. A comprehensive policy design to address this issue should entail the wider possibility of individual movement across the urban landscape to accommodate larger socioeconomic heterophily and further interaction between socioeconomic classes.

A Summary statistics and method description A.1 Summary statistics
This study focuses on the presence of mixing pattern in the largest 20 urban areas in the US. We consider urban area as the level of analysis because this densely developed territory fits very well with our objective in capturing the interaction between peoples and places. While people are represented by Foursquare users, whom also Twitter users in this case due to the crawling technique used in data collection, places takes various built in functional point of interests (POI) in accordance with Foursquare Venue Category Hierarchy. After combining the selected geographic and cartographic information from the U.S. Census Bureau (American Community Survey/ACS 2012) and Foursquare check-ins data (April 2012 -September 2013), we infer a set of active users and urban land uses (e.g.: residential, commercial, and other nonresidential) along with their socioeconomic status (SES).

A.2 Home location inference
For each individual mobility trajectory, we identify which locations categorised as home and venues, including visits to places located in their own SES tract. Home inference algorithm is constructed based on daily temporal windows. It consists of 8 time slots starting from midnight with 4-hour intervals. The main criterion of home location is consistent check-ins from 9PM to 6AM (time window 1, 2, and 8) at locations labelled by Foursquare as 'Assisted Living', 'Home (private)', 'Housing Development', 'Residential Building (Apartment / Condo)', and 'Trailer Park'. The rank of home location candidacy is sorted based on frequency of check-ins. We iterate the process for other venues to accommodate users that might live in the downtown, next to multi-purposes buildings attached to various urban functionalities (e.g.: a flat on the top of deli or store). This algorithm is designed with ability to properly identify the logical consequence of urban built environment where the human activities frequently take place at a location serving numerous settings as previously mentioned.

A.3 Method description
In Section 2, we briefly mention the application of Principal Component Analysis (PCA) to identify the most relevant socioeconomic features. This feature extraction technique is used to narrow down the range of variables that might portray inequality and segregation at best. It reveals that the largest loading belongs to income features that in total count for 11 variables, comprising mean household income, mean earnings, median household income, median earnings for male full-time, per capita income, median earnings for female full-time, median earnings for workers, mean retirement income, mean social security income, mean supplemental security income, and mean cash public assistance income.   The result from feature selection in Fig. 3 confirms the previous finding given by feature extraction. Mutual Information (MI) Rank suggests that income features have the highest contribution to mutual information of SES. In Decision Tree, per capita income remains the most important to SES. Gini Coefficient indicates that mean cash public assistance (0.46) has the highest sensitivity in capturing inequality, followed by per capita income (0.40).
We choose per capita income over mean cash public assistance due to several reasons. Firstly, the coverage of mean cash public assistance is limited to particular segment in society. Secondly, it will be an issue when we are going further for a comparative study across countries since not every country has similar cash public assistance program. Last, per capita income reflects various sources of income, including salary, social assistance, and wealth. Therefore, it is considered as a comprehensive measurement for average income and widely available.

B Matrix measures B.1 Empirical stratification matrices
Mixing pattern in mobility network conceptualised in Section 3.1. measures the proportion of visits by people to places stratified by their respective SES. According to Empirical Stratification Matrices Mi,j shown in Fig. 4, we find that individual mobility in some cities are less stratified than others in which colour of bins fades away from diagonal elements such as in New York and Austin. In contrast, strong empirical homophily mixing appears in most cities, for instance in Phoenix, Philadelphia, and Tampa.

B.2 Normalised stratification matrices
We replicate methodological approach of Empirical Stratification Matrices Mi,j used in Section 3.1 to construct Normalised Stratification Matrices Ni,j. In Fig. 5, red colour amplifies the higher frequency visit than expected, while blue denotes fairly less visit. Furthermore, the presence of red blocks in the upper diagonal elements signifies the upwards bias where people are aspired to drop by at places with higher SES. Bold red gradient along the diagonal exhibits homophily mixing. Figure 5: Normalised stratification matrices N i,j . Each bin contains the fraction of the empirical and randomised stratification matrices. Colour gradients ranges from darker blue to darker red, taking the condition of lower to higher frequency visit than expected.
C Bias measures C.1 Individual bias z-score Individual Bias z-score z Bu u measures how far empirical individual bias score deviates from the random mobility model. Technical formulation is explained in Section 3.2. Similar to typical individual mobility in other studies, individual mobility in our data is also characterised by large jumps between two types of people: small proportion of people with large trajectory and largely dominant type with small trajectory. Fig. 6 reveals the coexistence of upward and downward biases in terms of visiting patterns to other socioeconomic classes in any class. Figure 6: Individual Bias z-Score z Bu u . Class distributions of individual z-scores reflects how much the individual bias differs from the expected bias for an individual who chooses places to visit with the same frequency as before but selects them from a given set of places dictated by others within the same socioeconomic class.

C.2 Class-level bias z-score
Class-level Bias z-score z cu u (Fig. 7) is formalised to quantify the difference between typical visited places in individual trajectory from the trajectory in random class average. Composition of visit pattern differs with respect to SES. Many places, usually within own range, are visited many times along the trajectory, meanwhile, some others are only visited away less frequent. We dedicate Section 3.2 to formulate and discuss the measurement. Figure 7: Class-level Bias z-score z cu u . Distribution of class-level biased z-scores reflects directly how much the individual behaviour deviates from the expected level, when the individual could choose randomly places to visit from a given set dictated by others from the same socioeconomic class.

D Out-of-class matrix measures D.1 Out-of-class empirical stratification matrices
Out-of-class Empirical Stratification Matrices M ci,j shown in Fig. 8 takes the same methodological approach as Empirical Stratification Matrices Mi,j shown in Fig. 4. The two differs in term of census tract scope where out-of-class excludes own census tract in each individual trajectory. This step is taken into account to control distance effect that contributes to homophily mixing condition. Even though we observe less diagonality here, some stratification patterns remain in several cities.

D.2 Out-of-class normalised stratification matrices
We construct Out-of-class Normalised Stratification Matrices N ci,j (Fig. 9) in order to examine the robustness of Out-of-class Empirical Stratification Matrices M ci,j (Fig. 8). Normalised version of out-of-class stratification matrices is generated to measure the difference in magnitude the out-of-class empirical stratification matrices make in comparison to random visit occurrence. We observe that upward bias tendency (red gradient in upper diagonal matrices) is still considerably present in some cities and such distinct pattern doesn't emerge by chance. Figure 9: Out-of-class Normalised Stratification Matrices N c i,j . Defined as the fraction of the empirical and randomised stratification matrices without own census tract, out-of-class normalised stratification matrices reveals the visiting patterns of upward bias (red gradient), downward bias (blue gradient), and no bias (white) tendency across a SES pair of people and visited places in their trajectories.

E Out-of-class bias measures E.1 Out-of-class individual bias z-score
Out-of-class Individual Bias z-score zc Bu u depicted in Fig. 10 takes the same methodological approach as Individual Bias z-score z Bu u shown in Fig. 6. The two differs in term of census tract scope where out-of-class excludes own census tract in each individual trajectory. This step is taken into account to control distance effect that contributes to biases in visiting patterns, recalling that mobility mostly takes place in home census tract or nearby locations. Figure 10: Out-of-class Individual Bias z-score zc Bu u . We show class level distributions and their median values (blue dots) for each socioeconomic class after removing own census tract. Unbiased condition is depicted by horizontal red line. Upper red line areas contain upward biases in terms of visiting patterns, in contrast to downward biases on the lower part.

E.2 Out-of-class class-level bias z-score
Out-of-class class-level bias z-score zc Bu u indicates if this individual bias is weaker or stronger than expected from random behaviour, considering the absence of visit to places located in own census tract. It reflects directly how much the individual behaviour deviates from the expected level, when the individual could choose randomly places to visit from a given set dictated by others from the same socioeconomic class. Figure 11: Out-of-class Class-level Bias z-Score zc cu u . After removing own census tract, distributions are shown for each socioeconomic class with their median values as blue points. Above the red unbiased median line, an upward visiting bias holds, otherwise upward visiting bias is prevalent.

F Out-of-class measures in Houston, New York, and San Francisco
In Section D and Section E, we arise the issue of potential confounding factor driven by distance effect. It is important to realise that shortcoming may arise from this particular computation which disregards distance aspect. In dealing with that, we remove mobilities in own census tracts and recompute the stratification matrices as well as bias measures. In line with the discussion in the main text (Fig. 2), this section is dedicated to analyse the robustness and sensitivity of our homophily mixing and visiting bias measures in Houston, New York, and San Diego. We find that mobility is still stratified by SES as seen in Fig. 12a, 12b and 12c. Moreover, the presence of upward bias tendency is still visible in those cities by looking at Fig. 12d, 12e, and 12f. It is confirmed by the fact that mean of upper diagonal matrix elements surpass mean of lower diagonal matrix elements in 12g. The out-of-class normalised stratification matrices N c i,j , defined as the fraction of the empirical and randomised stratification matrices without own census tract. We observe less diagonality in Houston ( Fig. 12a and Fig. 12d), New York ( Fig. 12b and Fig. 12e) and San Diego ( Fig. 12c and Fig. 12f). Interestingly, upward bias tendency is still considerably present as seen in (Fig. 12g) where mean of upper diagonal matrix elements exceeds mean of lower diagonal matrix elements in 13 out of 20 urban areas, including Houston, New York, and San Diego.
Taking a deeper analysis, we exploit the persistence of biased behaviour in mobility by employing procedural bias measures at individual and class level that have been introduced earlier in Section D and E. In the case of Out-of-class Individual Bias z-score zc Bu u , visiting bias is less expected among lower class people in New York ( Fig. 13b), while anyone in Houston (Fig. 13a) and San Diego (Fig. 13c) can be as much biased in their visiting patterns regardless their socioeconomic classes. Upward visiting bias is even stronger at class level in all three as none of z-score values fall below the red unbiased median line (Fig. 13a, Fig. 13b and Fig. 13c). Figure 13: Out-of-class Individual Bias z-score zc Bu u . After removing own census tract, class level distributions and their median values are shown for each socioeconomic class. Horizontal red line at z-score=0 represents the condition of unbiasedness. Median values that appear on the top of red line suggests upward biases in terms of visiting patterns, otherwise downward biases persist. The blue dots show that while in general people from lower classes in New York (Fig. 13b) are less bias than expected, they could be as much biased regardless their socioeconomic classes in Houston (Fig. 13a) and San Diego (Fig. 13c). Figure 14: Out-of-class Class-level Bias z-score zc cu u . Distribution of class-level biased z-scores as the function of socioeconomic classes. After removing own census tract, distributions are shown for each socioeconomic class with their median values as blue points for Houston (Fig. 14a), New York (Fig. 14b), and San Diego (Fig. 14c). All z-score values remain above the red unbiased median line, therefore signalling an upward visiting bias.

G Homophily mixing measures
We formulate Dispersion Index as a supplementary measure to Diagonality Index which is discussed in Section 3.4. Dispersion Index aims to measure to measure the segregation tendency based on the Normalised Interaction Matrix as Recalling that Ni,j is a 10 by 10 matrix with non-negative entries aij ≥ 0, the summation over all entries can be written as S = i i=1 j j=1 aij. Let b = (1, 2, ... , 10) be a threshold and for each threshold b we sum up the diagonal and the off diagonals up to S b = i i b =1 j j b =1 ai b j b where i b , j b belong to the first b diagonals (in both directions). It returns S1 as the trace, and Sc = S as the sum of all elements. The absolute dispersion measure is proposed as and defined as the function of b. Consequently, the presence of large values concentrated around the diagonal contributes to sharp increase along b. In contrast, we expect marginal increment as we increase b in the case of highly homogeneous matrix Ni,j.
To capture the extent that such values differs from by chance, we compute a reference D rb . In this regard, a reference homogeneous matrix M ri,j is constructed where all entries are constant. The absolute dispersion measure of the reference matrix Dr b is computed likewise. The dispersion in the matrix Ni,j relative to a homogeneous reference point M ri,j is measured by retaining the area between the curves of D b and D rb as a function of b.
The index value ranges from 0 to 1. The lower boundary indicates complete heterogeneous mixing in which users visit places across socioeconomic status and the upper boundary pinpoints complete homogeneous mixing in which users' mobilities are concentrated within their own socioeconomic status. Dispersion index provides consistent result with diagonality index as revealed in Fig. 8. Figure 15: Homophily mixing tendency presented as 2 dimensional measure: Diagonality and Dispersion Index. Charlotte and Seattle seem to be outliers because the two are located away from the rest. Houston has the highest main-homophily mixing tendency among other cities, as well as the strongest neighbouring-homophily mixing. New York is less segregated, while Dallas is even far from being homophily mixing.