Social distancing beliefs and human mobility: Evidence from Twitter

We construct a novel database containing hundreds of thousands geotagged messages related to the COVID-19 pandemic sent on Twitter. We create a daily index of social distancing—at the state level—to capture social distancing beliefs by analyzing the number of tweets containing keywords such as “stay home”, “stay safe”, “wear mask”, “wash hands” and “social distancing”. We find that an increase in the Twitter index of social distancing on day t-1 is associated with a decrease in mobility on day t. We also find that state orders, an increase in the number of COVID-19 cases, precipitation and temperature contribute to reducing human mobility. Republican states are also less likely to enforce social distancing. Beliefs shared on social networks could both reveal the behavior of individuals and influence the behavior of others. Our findings suggest that policy makers can use geotagged Twitter data—in conjunction with mobility data—to better understand individual voluntary social distancing actions.


Introduction
Social distancing policies reduce social interactions and ultimately COVID-19 infections. Epidemiologists such as [1] estimate that the implementation of social distancing-including case isolation, household quarantine and school and workplace closures-could halve the number of deaths in the United Kingdom and the United States. A growing body of literature has linked policy interventions with social distancing [2][3][4] and the latter with the spread of contamination [5]. While evidence shows that government interventions decrease the size of the pandemic and redistribute the number of cases over time, little empirical research has explored the impact of beliefs on social distancing [6].
In this paper, we contribute to the emerging literature studying differences in social distancing across the United States during the COVID-19 pandemic. We proxy for the beliefs of agents by creating a Twitter index of social distancing based on geotagged tweets posted between February and June 2020. Twitter-based measures [7]-like newspaper-based measures [8] or Google search trends [9]-are considered good proxies for the perceptions and feelings of households. Moreover, collecting tweets avoids the small-sample biases that can be found in most studies based on questionnaires. Previous work using social network data shows that they successfully predict some economic outcomes [10], disease outbreaks [11] or happiness [9].
We relate our Twitter index of social distancing to measures of mobility computed by Google at the state level for 49 US States We remove Alaska and Hawaii from our analysis, and we include Washington, D.C., controlling for the dates of implementation of the various state orders (stay-at-home orders, school closures and nonessential business closures). We find strong evidence that differences in the Twitter index of social distancing correlate with differences in mobility between states, even after controlling for the various dates of implementations of state orders, rainfall, temperature and the number of new COVID-19 cases. Our results show that a substantial voluntary response of agents cannot be explained by government responses to the COVID-19 outbreak.
The results of the paper are of interest for researchers working on spatial differentiation in the human response to social distancing. A range of papers have studied the relationship between social capital and social distancing in the United States. [12] show that measures of social capital, such as community engagement, moderate the effect of statewide mobility restrictions on social distancing. For example, community engagement implies greater costs of social distancing and decreases the impact of stay-at-home orders on social distancing. [13] use civic capital as a moderator of stay-at-home orders to explain compelled social distancing in the US, at both the individual and country level, and in Europe. They find that a higher sense of civic duty leads to greater compliance with social distancing rules, even after the end of a domestic lockdown.
More related to our paper, [6] model differences in beliefs and attitudes as resulting from messages on the crisis from both political leaders and the media. They use survey data and show that Republicans and Democrats engage in social distancing to different extents. Their theoretical model is also validated by [14,15], who study the impact of Fox News on stay-athome behaviors and show that greater exposure leads to less compliance with social distancing. The impact of political preferences on attitudes during the COVID-19 pandemic is also confirmed by [16] who find that Democrats are more likely to stay at home and to switch to remote spending after state orders are implemented. The present paper contributes to the literature on the impact of media on compliance with social distancing rules, as social media not only signals the behavior or sentiment of the population but also has an impact on readers.
The paper is also related to a growing body of literature on the impact of COVID-19 on household uncertainty. [8] document a huge increase in uncertainty before and after the COVID-19 pandemic, using various indicators of economic uncertainty, including newspaper scraping and measures from expectations surveys. In the same vein, [17] construct a Twitterbased economic uncertainty index scraping worldwide tweets containing the keywords 'economic' and 'uncertainty' in the first semester of 2020 to obtain alternative measures of economic policy uncertainty to measure volatility. Our Twitter-based measure of social distancing captures concerns by the population at the state level, and the methodology we use can be replicated by researchers seeking to study the effect of information on behaviors during COVID-19 in different countries. Our Twitter-based measure of social distancing is available online: https://github.com/simonporcher/Twitter_Index_Social_Distancing_US. Finally, the paper is of interest for researchers working on well-being in the era of COVID-19. [9] study the impact of lockdown policies on happiness, as measured by keyword searches in Google Trends, in Europe and America. They find that people's mental health may have been severely affected by the lockdown. The paper that is the closest to ours is that by [18]. They study mobility in 89 cities worldwide as an outcome of fear measured by Google search data, some measures of social preferences and government lockdowns. They find that both lockdown policies and fear have a negative effect on mobility. Our paper contributes to this stream of the literature by using Twitter-based scraped data, rather than Google Trends data, which give only relative numbers rather than absolute numbers. The advantage of scraping is that it allows us to obtain the absolute numbers and to select the most appropriate tweets related to social distancing. Google Trends does not allow us to create an alternative Google index sorting out search terms that are correlated with a given term but not having the same meaning (e.g., fear and the TV show "Fear Factor").
The remainder of the paper is organized as follows. Sections 2 and 3 present the data and the method, respectively. Section 4 introduces the results, and Section 5 concludes the paper.

Mobility
We use daily Community Mobility Reports data from Google as a proxy for social distancing. The reports chart movement trends over time by geography, across different categories of places such as retail and recreation, groceries and pharmacies, parks, transit stations, workplaces, and residential areas. The mobile location data-anonymized and aggregated at the state level in the United States-are available since Feb 15, 2020, and show how visitors to categorized places change compared to the baseline period of Jan 3 to Feb 6, 2020 (before the COVID-19 outbreak). The residential category shows a change in time spent at home and is the main variable to assess social distancing. The five other categories measure the change in total visitors to categorized places. The data exhibit large differences over time and space, both in levels and in variations. Note that visits to some places, like parks and transit stations, are highly influenced by holidays or physical proximity to these places.

Twitter data
We use geotagged messages from Twitter to capture beliefs at the state level. We focus on the state level instead of the county level, as the number of tweets we collect was too low to construct a reliable daily indicator of information at the county level. To construct our database, we use a web scraping tool, and we extract all tweets containing the following keywords: "stay home", "stay safe", "save lives", "wash hands", "wear mask" and "social distancing". We also consider variants of those terms and hashtags such as #StayHome. We find that the number of messages protesting against social distancing measures is very low: the percentage of tweets containing keywords or hashtags such as #ReOpenAmerica, #LockdownProtest (or related keywords) represents less than 1% of all tweets in our sample. As more than 99% of the tweets containing social distancing keywords are encouraging social distancing, we do not use a sentiment analysis algorithm to derive the polarity of each message.
We focus our attention on geotagged tweets-messages for which the location of the user is known-to construct a daily indicator of social distancing beliefs at the state level. We define TwitterSD s,t as the number of tweets about social distancing sent by users located in state s on day t for 100,000 inhabitants: As tweets with higher numbers of likes, retweets and replies could have a greater impact on the reduction of mobility, we also construct a weighted Twitter-based index by weighting each message encouraging social distancing by the logarithm of 1 plus its number of likes (or retweets or likes): Twitter is widely used across the United States: there is a total of nearly 50 million monthly active Twitter users in the US, and 20 million Twitter users are on the platform daily. Furthermore, users on Twitter mostly follow users from the same metropolitan area. According to [19], 39 percent of ties connect users within the same regional cluster. This suggests that users in a given state are more exposed to the tweets and beliefs of other users located in the same state. One of the main drawbacks of using data from Twitter is that geotagged tweets are not representative of the US population: the Twitter population is biased towards higher incomes and urban areas [20], and geotagged tweets are written more often by young people and by women [21]. While we acknowledge that this could limit the generalizability of our findings, we add state fixed effects, and we focus on variation across states and over time to limit the bias due to the specific sample of Twitter users.
Geotagged messages only represent 1 to 2% of all messages sent on Twitter every day. However, given the very large number of messages sent every day on the platform (approximately 500 million tweets), we still obtain a large database of 402,005 messages containing at least one social distancing keyword sent between February 15 and May 31, 2020. Tweets in our sample have an average of 9.21 likes, 1.84 retweets and 0.62 replies. Fig A1 in S1 File shows the evolution of the total number of tweets related to social distancing during our sample period. We observe that the number of tweets increases sharply during the second week of March-a week, coinciding with the declaration by the World Health Organization stating that the COVID-19 outbreak was effectively a pandemic and with a structural break in mobility series identified by [22].

Controls
We used epidemiological data from the Center for Systems Science and Engineering (CSSE) at Johns Hopkins University. We compute the number of new COVID-19 cases per 100,000 inhabitants for each state and day. We also consider the number of deaths per 100,000 inhabitants, and we find similar results. We also consider state-level social distancing policies from [23]. The dataset includes a wide set of policies, such as restrictions on gatherings, school closures, stay-at-home orders, and nonessential business closures. We create a dummy variable by state to indicate whether any of the previous policies were in place on a given date. We consider the date of policy enactment. We also create a variable to capture political polarization by considering the percentage of Trump votes by state during the 2016 election. Finally, we use environmental data from the National Centers for Environmental Information to control for daily rainfall and temperature in each state. We use the average level of rainfall and the average maximum temperature by considering observations from all weather stations located in each state.

Methods
We use a simple causal framework in which individuals make their behavioral decisions based on the marginal benefits and costs of interaction [24], which depends on their beliefs and the information they have. The COVID-19 outbreak increases the marginal costs of social interaction by increasing the probability of infection. This probability of infection is localized and differs across geographic areas. We estimate the following OLS model that summarizes our conceptual framework: where β 1 captures the effect of our Twitter social distancing (SD) index. The results are similar when we consider TwitterSD s,t instead of TwitterSD s,t−1 . We choose to use the lagged value of our Twitter index in an effort to limit the reverse causality between time spent at home and the number of tweets sent (as users might tweet more when they have more spare time). CovidCases s,t−1 is the number of new COVID-19 cases in state s on day t-1. We consider the variable in t-1 as on a given day t, only the number of COVID-19 cases in t-1 is known. X s,t is a vector of state-level time-varying controls including average temperature and rainfall, and state-level social distancing policies. External factors, such as weather conditions, affect the marginal benefits and costs of social interaction. By the same token, government policies implemented to increase the costs of social interaction are important drivers of social distancing. δ s controls for all time-invariant state characteristics, such as population density, preferences or income. For example, different communities have different preferences in terms of social interactions and risky behaviors. Thus, the marginal cost of social distancing depends on how much people value outside gatherings, traveling or working from home, and on their private risk of infection, e.g., whether they suffer from chronic diseases or the number of COVID-19 cases in the community. δ d,t is the interaction of division and day fixed-effects. The division are the nine geographic divisions from the United States Census Bureau. In alternative specifications, we use the 4 US regions (Northeast, Midwest, South, West) to run robustness checks. This interaction controls for time-varying division characteristics as well as all time-varying national and international factors. The use of robust standard errors clustered at the state-level allows to control for heteroscedasticity and autocorrelation. A usual drawback of ordinary least squares is that it does not control for omitted variables and that serial correlation might be present. We overcome these two drawbacks by using various fixed effects and clustered standard errors at the state level to control for potential correlation between observations within states. By the same token, we control for heteroscedasticity by using robust standard errors. In robustness checks, we run the baseline model with different computation of the standard errors controlling for heteroscedasticity and autocorrelation. We first use consistent standard errors developed by [25] which are useful to control for autocorrelation in pooled ordinary least squares with panel data. We then use standard errors developed by [26]. The error structure provided by [26] is assumed to be heteroscedastic and robust to all forms of cross-sectional and temporal dependence. Their model is particularly useful when the time dimension is larger than the number of groups, as in our sample. While these alternative computations might be informative of the presence of autocorrelation, they do not alter the quality of our baseline results as we already assume heteroscedasticity and autocorrelation by the use of state-level clustered robust standard errors.
As we are using panel data, we checked for potential correlations and multicollinearity between our key independent variables. A table of correlation is reported in Table B1 in S1 File. There is no strong correlation between the main independent variables TwitterSD and new COVID-19 cases. The strongest correlations are observed between policy interventions as they are usually implemented at the same time and within the same state. Table B2 in S1 File reports the variance inflation factor for different independent variables used in the baseline model. The mean variance inflation factor is 2.65 which is relatively low [27]. Most variable are moderately correlated with a variance inflation factor inferior to 5. The variable with the highest variance inflation factors is school closure (13.89). The collinear variables are control variables and are not collinear with the independent variables of interest, so that the coefficients of TwitterSD is not affected.

Results
Our baseline results are reported in Table 1. The first column reports the OLS model for residential mobility, and columns (2) to (6) show the results for mobility in various places. All models include stated fixed effects and division×time fixed effects. We find that the coefficient of our Twitter index of social distancing is positive in column (1) and negative in columns (2) to (6). One additional tweet encouraging social distancing per 100,000 inhabitants-which represents an increase of approximately 0.66 standard deviations-is associated with an increase in time spent at home of approximately 0.3%. The absolute size of the coefficient is on average lower for residential mobility, as the residential category shows a change in duration, while the other categories measure a change in total visitors. As people already spend a large portion of their time at home (even outside the COVID-19 period), the capacity for variation is limited. We also find that the magnitude of the effect is approximately three times larger for mobility to workplaces, transit stations and national parks than for mobility to retail areas and grocery stores. All of the other variables are of the expected sign: the number of COVID-19 cases that proxies for the marginal infection probability decreases all types of mobility (or increases the time spent at home), rainfall increases time spent home and decreases mobility to parks and grocery stores, and temperatures decrease time spent at home and increase mobility to other places. As expected, stay-at-home orders have a large and significant effect on mobility. Other social distancing measures, such as school closures, nonessential business closures, and gathering restrictions, do not significantly impact mobility when we include stay-at-home orders and division � time fixed effects. Although these controls attenuate the effect of the Twitter index of social distancing to some degree, the latter remains significant in all specifications. Table 2 presents our results when we weight tweets by the number of likes, the number retweets or the number of replies. Column (1) reports the results of the baseline model. Columns (2), (3) and (4) report the results of the model using the Twitter index of social distancing weighted by the number of likes, retweets and replies, respectively. The Twitter indices are  Table B3 in S1 Appendix. We find that the effects are relatively similar when we use weighted tweets instead of unweighted tweets. The relative signs of the coefficients of our baseline measure and the weighted measures suggest that the relation between the number of messages related to social distancing and the observed reduction in mobility is mostly driven by self-disclosed beliefs rather than by the influence of local tweets on other users' behavior. This result might also be driven by the fact that social media tends to favor online "bubbles": users on Twitter are exposed primarily to ideologically similar information [28], and thus, the influence of tweets encouraging social distancing sent by individual users might be limited. An important control for beliefs is partisanship. Table 3 presents the results when we add an interaction between the share of Republican votes in the 2016 US presidential election and stay-at-home orders. We find-as in [6]-that states with a larger share of Republican votes in 2016 tend to enforce less social distancing. The interaction is significant in all specifications and has an opposite sign to stay-at-home orders. A greater share of Republican votes decreases Table 3. Baseline model with an interaction between stay-home orders and Republicans votes.

VARIABLES [1] [2] [3] [4] [5] [6]
Residential the impact of stay-at-home orders on mobility. This validates the intuition that the perception of risk differs significantly based on the partisanship of the community. Intuitively, Republicans might be more attached to individual freedom than to state action, while Democrats might overreact to state orders. We also interact our Twitter-based indicator with the share of Republican votes in the 2016 US presidential election. The interaction is not significant, suggesting that the effect is similar for both Democrats and Republicans. The coefficient on the Twitter index of social distancing remains stable and is even slightly higher when partisanship is added. We finally run several robustness checks. Table 4 presents the same model as in Table 3 with various geographic and time fixed effects. The sign and magnitude of the coefficients of social distancing tweets on the time spent at home are similar to those in Tables 2 and 3, ranging between 0.351 and 1.134. The models including only geographic fixed effects yield upward-biased coefficients, while the models including both time and regional fixed effects yield coefficients that are more representative of the real impact of beliefs on mobility, as individuals tend to adapt their behavior in terms of mobility but also on Twitter over time. Further robustness checks are reported in Tables B4 and B5 in S1 File. Table B4 in S1 File reports the results of a fixed-effects model using the standard errors as computed by [25] and [26]. Given the number of time period in our sample, we consider the optimal lag length of 4 as defined by [26]. The coefficients of the Twitter index of social distancing remain significant to explain time spent at home, visits to workplaces and transit stations. The results from this table indicates that autocorrelation might be present but it does not alter the overall quality of the baseline results as we control for autocorrelation by using robust standard errors which are clustered at the State-level. Table B5 in S1 File reports the results of two specifications. In the upper part of the table, we use an autoregressive model with two lags for the Twitter index of social distancing and COVID-19 cases and we include one lag of the dependent variable as an independent variable. The magnitude of the coefficient of the Twitter index of social distancing logically decreases but the sign of the coefficient remains the same as in the baseline results. The coefficient has the expected sign in all specifications and is significant in most specifications. In the lower part of the table, we use the first difference of the continuous variables-Mobility, the Twitter index of social distancing, COVID-19 cases, and weather variables-to control the stability of the baseline results. The magnitude of the coefficient of the Twitter index is relatively lower than in the baseline results but remains significant for all specifications except transit stations and parks. The Twitter index has particularly a significant impact on time spent at home, the number of visitors of workplaces, retail and recreation and groceries and pharmacies. These categories of mobility are particularly interesting because their evolution reflects changes due to the pandemic rather than changes due to seasonal movements or proximity to the places. On the contrary, visits to parks for example, are more dependent on other factors, such as proximity to such places, or seasonal movements.

Conclusion
The results of the paper show evidence that beliefs shared on Twitter are correlated with mobility at the state level. Revealed beliefs related to social distancing on Twitter are positively correlated with the practice of social distancing at the state level. The effects remain significant and stable in magnitude when we control for additional factors. The results of this paper are helpful to disentangle the effects of voluntary responses based on beliefs from the effects of government decisions to implement social distancing policies. Social networks such as Twitter reveal the beliefs of individuals about social distancing and are a good indicator of their willingness to comply with containment policies. The results also show some differences in the magnitude of alternative Twitter indices considering the number of likes, tweets and replies. The evidence does not permit us to ultimately pin down the network effects of self-revealed beliefs on the beliefs and behaviors of other individuals and opens avenues for further research.
Our analysis has policy implications for flattening the curve. The results suggest that the impact of voluntary responses, based on beliefs and available information, on mobility is important and observed across states. Our results demonstrate the importance of accounting for human beliefs in designing containment policies, which is rarely considered in traditional SIR models. As beliefs and behaviors are related, excessive lockdown measures might not be useful when individuals' behavior is already precautionary and vice versa. Theoretically, this means that government orders to increase social distancing are not the only instrument to fight the negative externality of insufficient social distancing. Moreover, by taking the "pulse of the nation", social media offer opportunities for policy makers to better understand people's beliefs and to adapt their policies accordingly. Governments have a unique chance to get a better understanding of how citizens feel about social distancing and how they perceive policies implemented in the fight against COVID-19. Governments could communicate differently, or re-conceptualize their policies in order to match with citizens' behaviors.
There are, of course, limitations to our analysis. The timing and the location of the beliefs displayed on social networks follows the spread of the infection and the anticipation of the risk of contamination. By the same token, state orders are not randomly assigned and result from comparing the economic costs and health outcomes of the measures. If Republicans are more reluctant to enforce social distancing, Republican governors might also be slower to adopt a social distancing policy. We cannot rule out that the spread of contamination and state orders have both direct and indirect effects, via beliefs shared on Twitter, on mobility. Furthermore, we use data aggregated at the state level as it was not possible to derive the demographic characteristics of age, occupation and social class from Twitter user at the individual level. We use fixed effects and time effects to partially control for the bias of data on Twitter towards higher incomes and urban areas but we cannot completely control for differences in the dynamics at the individual level. This topic could be treated in a future study.
As fake news in social media represent a threat in the fight against the pandemic, and given the recent medical advances regarding a COVID-19 vaccine, we believe that policy makers could use social media to better understand and fight the growing anti-vaccine movement that could undermine efforts to end the coronavirus pandemic.