Published on in Vol 25 (2023)

Preprints (earlier versions) of this paper are available at https://preprints.jmir.org/preprint/45757, first published .
Staying Home, Tweeting Hope: Mixed Methods Study of Twitter Sentiment Geographical Index During US Stay-At-Home Orders

Staying Home, Tweeting Hope: Mixed Methods Study of Twitter Sentiment Geographical Index During US Stay-At-Home Orders

Staying Home, Tweeting Hope: Mixed Methods Study of Twitter Sentiment Geographical Index During US Stay-At-Home Orders

Original Paper

1School of Public Policy and Management, Tsinghua University, Beijing, China

2Institute for Contemporary China Studies, Tsinghua University, Beijing, China

3Chinese Society for Urban Studies, Beijing, China

4Interdisciplinary Programs Office, The Hong Kong University of Science and Technology, Hong Kong, Hong Kong

5Urban Governance and Design Thrust, The Hong Kong University of Science and Technology (Guangzhou), Guangzhou, China

6Department of Management Science and Information Systems, Oklahoma State University, Stillwater, OK, United States

Corresponding Author:

Connor Yuhao Wu, PhD

Department of Management Science and Information Systems

Oklahoma State University

449 Business Building

Stillwater, OK, 74078

United States

Phone: 1 4057443551

Email: yuhaowu@okstate.edu


Background: Stay-at-home orders were one of the controversial interventions to curb the spread of COVID-19 in the United States. The stay-at-home orders, implemented in 51 states and territories between March 7 and June 30, 2020, impacted the lives of individuals and communities and accelerated the heavy usage of web-based social networking sites. Twitter sentiment analysis can provide valuable insight into public health emergency response measures and allow for better formulation and timing of future public health measures to be released in response to future public health emergencies.

Objective: This study evaluated how stay-at-home orders affect Twitter sentiment in the United States. Furthermore, this study aimed to understand the feedback on stay-at-home orders from groups with different circumstances and backgrounds. In addition, we particularly focused on vulnerable groups, including older people groups with underlying medical conditions, small and medium enterprises, and low-income groups.

Methods: We constructed a multiperiod difference-in-differences regression model based on the Twitter sentiment geographical index quantified from 7.4 billion geo-tagged tweets data to analyze the dynamics of sentiment feedback on stay-at-home orders across the United States. In addition, we used moderated effects analysis to assess differential feedback from vulnerable groups.

Results: We combed through the implementation of stay-at-home orders, Twitter sentiment geographical index, and the number of confirmed cases and deaths in 51 US states and territories. We identified trend changes in public sentiment before and after the stay-at-home orders. Regression results showed that stay-at-home orders generated a positive response, contributing to a recovery in Twitter sentiment. However, vulnerable groups faced greater shocks and hardships during the COVID-19 pandemic. In addition, economic and demographic characteristics had a significant moderating effect.

Conclusions: This study showed a clear positive shift in public opinion about COVID-19, with this positive impact occurring primarily after stay-at-home orders. However, this positive sentiment is time-limited, with 14 days later allowing people to be more influenced by the status quo and trends, so feedback on the stay-at-home orders is no longer positively significant. In particular, negative sentiment is more likely to be generated in states with a large proportion of vulnerable groups, and the policy plays a limited role. The pandemic hit older people, those with underlying diseases, and small and medium enterprises directly but hurt states with cross-cutting economic situations and more complex demographics over time. Based on large-scale Twitter data, this sociological perspective allows us to monitor the evolution of public opinion more directly, assess the impact of social events on public opinion, and understand the heterogeneity in the face of pandemic shocks.

J Med Internet Res 2023;25:e45757

doi:10.2196/45757

Keywords



Stay-at-home orders, also referred to as shelter-in-place orders, safer-at-home orders, or lockdowns, have been a highly debated intervention strategy used to mitigate the spread of COVID-19 in the United States. Between March 7 to June 30, 2020, a total of 51 states and territories implemented stay-at-home or similar orders, affecting 2824 (around 87.3%) of 3233 US counties. The mandatory-for-all orders aimed to restrict residents' movements, work, education, gatherings, and general activities. Regarding public health, the stay-at-home orders met their original goal of saving the population from COVID-19 cases and deaths [1,2]. Meanwhile, the stay-at-home orders brought other benefits, such as reducing air pollution concentrations [3] by holding down population mobility [4,5]. These orders, however, have adverse effects. For instance, they increased screen time before bed and reduced total sleeping time, leading to worsened moods [6], reduced physical activity time, and greater weight gain [7,8]. The strong linkage between stay-at-home orders and mental health has been documented. Stay-at-home orders severely affected mental health, such as greater health anxiety, financial worry, sadness, loneliness, and a decrease in general mental health score [9-11]. The efficacy of stay-at-home orders varied spatially due to the differences in the timing of orders [12] and sociodemographic factors in different states [13]. How to customize the stay-at-home orders from the disaster management perspective is unknown. Overall, the stay-at-home orders profoundly affected the lives of individuals and communities.

Because of stay-at-home orders, many people were confined to their homes and unable to engage in their usual activities. They may have turned to social media as a way to stay connected and informed. Therefore, stay-at-home orders accelerated the massive use of web-based platforms, including social media [14]. Among social media, Twitter is preferably used by users to express their reactions to ongoing epidemics and related policies [15,16]. Twitter is a microblogging platform that allows users to send and receive short messages called “tweets.” Tweets are limited to 280 characters and can include text, images, and links. Twitter is known for its real-time, public nature and is often used by individuals and organizations to share news, opinions, and updates. Users can follow other users, hashtags, or topics to receive updates on their feeds and engage with others by liking, commenting on, or retweeting tweets. Twitter is available as a website and as a mobile app and is free to use. Twitter can be a valuable tool for studying public opinion because it allows researchers to collect large amounts of data in real time and at a low cost. Researchers can use Twitter to track how political debates evolve and are perceived [17,18], investigate how rumors and opinions spread [19,20], and test the validity of models of complex social behavior [21]. There are a number of efforts that have been used in addition to traditional medical testing to understand and track the spread of contagious diseases [22], such as influenza [23-25] and Ebola virus disease [26,27]. Specifically, numerous researchers have used Twitter to document the unprecedented COVID-19 pandemic [28-32]. Large-scale Twitter databases on COVID-19 have been constructed to facilitate further analyses on specific topics [29]. One of the key areas of investigation has been the fluctuation of sentiment during the COVID-19 pandemic [28,30,31]. Some studies further studied the polarization and politicization of public discourse about COVID-19 in the public sphere [33-35]. Furthermore, Twitter users have expressed their emotions regarding public reactions to the pandemic, such as vaccine hesitancy [36]. Analyzing the content of tweets and the interactions between users can provide valuable data and insights for public health decision-making, improve emergency response efforts, and enable better preparation for future COVID-19 variants and other public health emergencies [31].

A significant area of research involves the use of Twitter data to characterize public emotions during the COVID-19 pandemic effectively. Prior research has used a longitudinal sample of Twitter users to determine that lockdown measures were associated with increased aggression [37]. Another study used a similar approach to analyze the impact of Wuhan's lockdown, revealing that Weibo’s (Chinese Twitter) posts had higher valence and arousal levels [38]. Some research adopts similar indicators of public emotion as ours, the sentiment score. Insights from Singapore suggest that containment measures have differing effects on sentiment scores. Specifically, restrictions on public activities and travel were associated with decreased sentiment scores, while facial coverings had the opposite effect [39]. Furthermore, a global study found that countries with lockdown policies experienced a more positive change in sentiment [40]. Different from existing studies, our research used the sentiment score, the Twitter sentiment geographical index (TSGI) quantified from 7.4 billion geo-tagged tweets data, to analyze the dynamics of sentiment feedback on stay-at-home orders across the United States. Moreover, we examined differential feedback from vulnerable groups, including older people groups with underlying medical conditions, small and medium enterprises (SMEs), and low-income groups, using a multiperiod difference-in-differences (DID) regression model and moderated effects analysis.

The impact of COVID-19 and corresponding policy interventions varies between demographics and socioeconomic contexts. Our research highlights 3 areas of focus: age structure, medical care system, and vulnerable businesses. Older people, with a higher mortality rate, confront a more severe epidemic crisis [41,42]. Moreover, the threat to older people's mental health is also nonnegligible. Older people above 60 years are the most vulnerable age group regarding mental health when confronted with COVID-19 [42,43]. Even though the stay-at-home orders can slow the transmission, older people, as the most protected group, face more from social isolation, which causes more severe mental disorders [43,44]. The ecological effect of lockdown on older people's emotions, which mixes various social consequences, is still underexplored.

COVID-19 has imposed a significantly greater burden on national medical care, and hidden problems have begun to emerge. The availability and equality of medical care significantly impact the pandemic's consequences. For example, Black people have disproportionate COVID-19 cases and deaths due to long-standing inequities in the health care system. Medical care is thus called for reform as a lesson learned from the epidemic [45,46]. Mental health care also similarly exacerbates mental health disorders and emotional trauma [47]. The impact of stay-at-home orders is expected to differ depending on the regional health care system. Stay-at-home orders alleviate part of the system's pressure and, as a result, affect regional emotions. COVID-19 has multifaceted impacts, including economic impacts. Economic uncertainty caused by the pandemic severely impacts well-being, mental health, and emotional hazards [48]. SMEs are the most vulnerable economic actors that are struck by the pandemic. Under COVID-19, SMEs face a significant failure rate increase, leading to increased unemployment and financial risks [49,50]. We anticipate that COVID-19 policy intervention will independently influence economic resilience and vary depending on its economic structure. Regions with more vulnerable SMEs are expected to respond more strongly to policy intervention.

The COVID-19 pandemic has highlighted the critical role of public health interventions in mitigating the spread of airborne viruses. Stay-at-home orders have been shown to be effective in suppressing transmission [51,52], but they have also had side effects on mental health [9]. This study underscores the importance of a comprehensive understanding of the implications of such interventions. By exploring the interplay between public health measures and mental health outcomes, this research sheds light on the potential trade-offs between disease control and individual well-being. Such insights can inform future pandemic responses and help safeguard public health during crises. Consistent with previous research, we hypothesized that Twitter activity was a barometer of public perceptions of the pandemic and the stay-at-home orders. As the extent of these restrictions varies regionally, it is still being determined what impact the stay-at-home orders have had on tweet sentiment on a state-by-state basis. We, therefore, focused on quantifying daily Twitter sentiment scores in the United States during the implementation of the stay-at-home orders in each state by analyzing over 7.4 billion geo-tagged tweets. The main objective was to understand the dynamics of public opinion generated by the US stay-at-home orders and the differential feedback of sentiment on the stay-at-home orders from groups in different situations and backgrounds.

Our research makes 3 contributions to the literature. First, previous research has focused on the overall impact of lockdown policies but has overlooked potential regional variations in their effects. Our study identifies vulnerable regions and enhances current policy strategies. Second, in contrast to Twitter data characterized by keywords, our use of geo-tagged data enables us to accurately determine whether Twitter users were affected by lockdown orders in their respective locations, thereby improving precision in our analyses. Third, most studies to date have compared changes in sentiment scores in specific regions before and after lockdowns. In contrast, our research uses the multiperiod DID method, which effectively eliminates general trends due to time variation and isolates the causal effect of the stay-at-home orders on the treatment group (ie, states under orders).


Twitter Sentiment Geographical Index

The raw tweet data used to generate the global sentiment and geography index dataset comes from the Geotweet Archive (version 2.0), which is developed and maintained by the Harvard Center for Geographic Analysis [53]. The Archive is a global collection of geo-tagged tweets spanning time, geography, and language. It extends from 2010 to the present and is updated daily. Natural language processing techniques that include the Bidirectional Encoder Representations from the Transformers model developed by Google and the multilingual model (for handling 104 languages) are applied to a comprehensive archive of 7.4 billion geo-tagged tweets. Tweets are transformed into 768-dimensional text vectors and analyzed by a neural classifier to obtain single sentiment scores that indicate the positive or negative of the tweets. After that, the tweets are aggregated at different administrative levels (ie, country, state, and county levels) to calculate the TSGI. It primarily provides a detailed index of emotions across time (ie, a decade from 2012 to 2022) and geography (ie, 164 countries) with the sentiment classification accuracy of 83% [54]. To the best of our knowledge, it is the first subjective well-being data set at this scale and granularity.

Model Design

To validate the relationship between stay-at-home orders and Twitter sentiment, this study constructs a multiperiod DID regression model (equation 1) at the state level, as different states adopt restrictive policies at different points in time. The following equation is estimated with robust standard errors.

TSGIit = β0 + β1Policy + β2Casesit + γt + δi + εit(1)

The dependent variable is the Twitter sentiment score in state i and day t. The score is a float value between 0 and 1, where 1 represents a positive sentiment, and 0 represents a negative sentiment. Policy represents the policy variable, which is 1 when the stay-at-home orders are in effect and 0 vice versa. Casesit includes control variables directly related to the pandemic [55,56], including the number of new cases and deaths. To avoid omitted variables, the model controls for time-fixed effects γt, and state-fixed effects δi. εit is the error term. A robust is adopted. We pooled all observations from March 7 to June 30, 2020, as this is the period in which different states implemented stay-at-home orders that mandate residents to stay at home unless necessary.

The moderating effects of different attributes were further measured by constructing regression models with crossover terms (equation 2).

TSGIit = β0 + β1Policy × Xi + β2Casesit + γt + δi + εit(2)

To further explore heterogeneity, we built cross-variables based on the attributes of the different states, having explored the moderating effect of the different attributes. Xi represents the different attribute characteristics of state i, including economic development, demographics, and vulnerable groups.

Data Description

Data in this study are shown in Table 1. Our data cover 50 states and Washington, DC, in the United States from March 7 to June 30, 2020. Therefore, it includes 5916 observations (51 states and territories × 116 days) at the state-day level. Our key outcome variable is TSGI, with a mean score of 0.574, an SD of 0.016, and a range from 0 to 1. Higher TSGI indicates more positive sentiment in the state's geo-located Twitter. Our key independent variable is Policy (with 1 for in-effect stay-at-home orders and 0 for no stay-at-home orders). Our control variable includes the number of confirmed cases at the state level. In addition, the robustness test is conducted on the number of deaths. Other variables, most of which are used to explore the heterogeneity in the policy effect, can be divided into 3 categories: demographic features, including population size, sex ratio, and percent of the population aged 65 years and above; socioeconomic features, including income per capita, percentage of the homeless population, Gini index, and percent of SMEs; and health-related factors, including the cost of medical care, and hospital beds per 1000 people.

Table 1. Variables used in the model and analysis.
VariableDescriptionSourceObservations, nMean (SD)Range
TSGIaTwitter sentiment geographical indexMITb Sustainable Urbanization Lab and Harvard\'s Center of Geographical Analysis59160.574 (0.016)0.633
PolicyStay-at-home orders (1) or not (0)Centers for Disease Control and Prevention, New York Times, manually collected by authors59160.346 (0.475)0-1
CasesNumber of new COVID-19 cases reported per day as a proportion of the total population in each stateNew York Times58420.003 (0.003)0-0.019
DeathsThe total number of new deaths from COVID-19 reported, in logarithmsNew York Times58420.0001 (0.0002)0-0.0016
lnElderlyEstimated percent of the population age is 65 years and older, 2016-2020, in logarithmsUS Census59162.79 (0.123)2.405-3.026
HomelessHomelessness in 2020 as a percentage of the total population of the statesThe US Department of Housing and Urban Development59160.001 (0.001)0.0003-0.009
MedicalcareAggregate cost of medical care in 2019, per capitaPolicyMap and Quantitative Innovations59167208.149 (508.305)5737.715-8462.92
SMEscPercent of firms less than 3 years old in 2019Census Business Dynamics Statistics591618.020 (2.843)13.23-24.64
GiniEstimated inequality of household income according to the Gini index, 2016-2020US Census59160.465 (0.020)0.42-0.52
lnHospitalbedsThe rate of hospital beds per 1000 people in 2016, in logarithmsHealth Resources and Services Administration59161.105 (0.261)0.641-1.835
lnIncomeEstimated per capita income, 2016-2020, in logarithmsUS Census591610.449 (0.154)10.144-10.979
lnPopulationPopulation in 2020, in logarithmsUS Census59164.652 (1.520)0.246-9.330
SexratioEstimated ratio of male population to female population, 2016-2020US Census591697.686 (3.281) 90-109

aTSGI: Twitter sentiment geographical index.

bMIT: Massachusetts Institute of Technology.

cSME: small and medium enterprises.

Ethical Considerations

This study did not require research ethics approval, as the utilized data was accessible to the public. The TSGI dataset, acting as a subjective well-being index, does not incorporate any specific Twitter user's handle or the content of their tweets. In terms of geography, the TSGI data is compiled at the county level, ensuring that the geo-tweets contributing to it remain untraceable to individual users. Other datasets in Table 1 are aggregated. Additionally, there was no engagement between the study's authors and any Twitter users.


COVID-19 and Stay-at-Home Orders

Figure 1 depicts a detailed overview of daily cases, deaths, sentiment, and stay-at-home orders. Until the first week of April 2020, the number of daily new cases increased dramatically. In response to the worsening pandemic situation, most states had adopted stay-at-home orders by the end of March. The policy implementation also increased the sentiment index. While the number of new cases remained high in late April, some states have relaxed their restrictions. The orders were lifted in late May in most states.

Figure 1. Confirmed cases, deaths, local stay-at-home orders, and Twitter sentiment geographical index in the United States.

Sensitivity Fluctuations Before and After the Policy

The anticipation and implementation of policy interventions have a positive influence on emotions and help in the recovery of public sentiments. Figure 2 shows that sentiment scores dropped dramatically initially (from 0.603 to 0.575). It may come from the fear and worry about the newly emerged COVID-19, which spread quickly and widely. Before the lockdown, we can observe some recovery in the sentiment. At the commencement of stay-at-home orders, the sentiment score increased from 0.559 to 0.566. Furthermore, the score continued to rise after stay-at-home orders, reaching 0.572, 0.579, and 0.585 at 10, 30, and 60 days, respectively.

Figure 2. Sensitivity fluctuations before and after the policy. Only states with stay-at-home orders are included.

Overview: Mobility Restriction Measures Generate a Positive Response on Twitter

The model in Table 2 shows the change in the degree of impact of the policy on the TSGI over time. The policy has a significant positive effect on Twitter sensitivity, both a 3-day lag (approximately 5.7% increase) and a 7-day lag (approximately 9.1% increase), indicating that the mobility restriction measures generated a positive response on Twitter. This is broadly consistent with the trend shown in Figure 2. At a lag of 14 days, the policy effect is insignificant, which shows the policy has been limited over time. Meanwhile, the number of COVID-19 confirmed cases was negatively associated with Twitter sentiment.

Table 2. Regression results of policy effects.

Dependent variable: TSGIa

(1)(2)(3)

Timelag_3P valueTimelag_7P valueTimelag_14P value
Policy0.057.090.091.008−0.042.27
Cases–12.695.01−12.986.01−8.097.16
State FEbYes
Yes
Yes
Day FEYes
Yes
Yes
Constant56.141<.00157.777<.00157.803<.001
Observations5048
4933
4242
R20.827
0.819
0.802

aTSGI: Twitter sentiment geographical index.

bFE: fixed effect.

Vulnerable Groups Face Shocks and Hardships

The regression results for the moderating effects of different attributes in various states are presented in Tables 3 and 4, respectively. The cross-sectional variables of older people 65 years or older, medical care costs, SMEs, and policy were significantly negative. States with many vulnerable groups, such as older people, those with high underlying diseases, and SMEs, faced shocks and hardships during the COVID-19 pandemic. This finding is consistent with previous findings. For instance, previous research found that self-isolation caused by stay-at-home orders would disproportionately affect older individuals whose only social contact is out of the home, such as at daycare venues, community centers, and places of worship [44]. Other findings show that the high-risk population included 70 years or older or those with at least 1 underlying condition [57]. The most hazardous comorbidities in fatal cases were hypertension, diabetes, and cardiovascular diseases [58].

Table 3. Regression results for disadvantaged groups.

Dependent variable: TSGIa

(4)(5)(6)

Timelag_3P valueTimelag_3P valueTimelag_3P value
Policy2.390<.0011.069.0020.407.004
Cases−9.745.06−11.953.02–11.755.02
Policy*lnElderly−0.830<.001b
Policy*Medicalcare−0.000.004
Policy*SMEsc−0.020.009
Control FEdYes
Yes
Yes
State FEYes
Yes
Yes
Day FEYes
Yes
Yes
Constant56.133<.00156.132<.00156.156<.001
Observations5048
5048
5048
R20.828
0.827
0.827

aTSGI: Twitter sentiment geographical index.

bNot available.

cSME: small and medium enterprises.

dFE: fixed effect.

Table 4. Regression results for moderating effects.

Dependent variable: TSGIa

(7)(8)(9)(10)(11)(12)(13)(14)

Timelag_3P valueTimelag_7P valueTimelag_3P valueTimelag_7P valueTimelag_3P valueTimelag_7P valueTimelag_3P valueTimelag_7P value
Policy1.48.263.591.0040.111.020.403.0010.737.331.574<.001−0.783.45−2.387.006
Cases−13.713.01−15.357.004−13.505.01−16.682.006−13.088.009−14.507.002−13.624.009−15.191.004
Policy*lnIncome−0.136.27−0.335.004











Policy*Gini



−1.455.26−3.188.001







Policy*lnPopulation







−0.011.58−0.064<.001



Policy*Sexratio











0.009.420.025.005
Control FEbYes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
State FEYes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Day FEYes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Constant56.145<.00157.803<.00156.144<.00157.791<.00156.144<.00157.784<.00156.143<.00157.770<.001
Observations5048
4933
5048
4933
5048
4933
5048
4933
R20.827
0.819
0.827
0.82
0.827
0.819
0.827
0.819

aTSGI: Twitter sentiment geographical index.

bFE: fixed effect.

The Moderating Effect of Economic and Demographic Characteristics

Table 4 reports the regression results for introducing cross terms with a lag of 3 and 7 days, respectively. Both present the emergence of a moderating effect of different attribute characteristics on the policy-sentiment relationship over time. Regarding economic characteristics, the issue of per capita income comes to the fore, with the cross-variable significantly negative at a lag of 7 days, creating an effect on the positive policy-sentiment impact. Similarly, the Gini coefficient, which reflects the level of imbalance, also exhibits a dampening effect. From a demographic perspective, provinces with high population density have a negative impact. A high male-to-female sex ratio means more males and relatively negative policy feedback, which may be due to the fact that they might have higher expression of angiotensin-converting enzyme 2 regulated by male sex hormones for higher COVID-19 infection and poor clinical outcomes [59-61].

Robustness Tests

The robustness of the model was tested through different time lag effects and substituting variables. First, given that the emotional impact of fatal cases is more direct than that of confirmed cases, with a high mortality rate of 14% in April 2020 [62], the US population is generally more concerned about deaths. Therefore, this paper uses the number of death cases to replace confirmed cases, taking the logarithm of the number of death cases to bring into the model. The results remain almost identical to those of the base model. Second, we examined similarly different time-lagged effects, and these time-varying patterns are retained and do not alter the main findings. The regression results of the robustness tests are reported in Tables 5 and 6.

A state in the United States can be very heterogeneous, with a significant disparity in policy implementation and social demographics. Although stay-at-home orders policy variation exists primarily at the state level, it is necessary to conduct county-level analysis to further validate our results. However, many indicators of concern in this study are not available at the county level. Still, we collated the available county-level data on stay-at-home orders, the number of confirmed cases and deaths, older people, population, and hospital beds and rematched them with the county-scale Twitter sentiment indicators as a robustness test (see Table 7). The results at the county level remain consistent with those from the baseline regressions at the state level in Tables 2, 3, and 6 so that the main findings are further validated.

Table 5. Robustness tests of the impact of policy on TSGIa (disadvantaged groups).

Dependent variable: TSGI

(15)(16)(17)(18)(19)(20)(21)(22)

Timelag_3P valueTimelag_7P valueTimelag_3P valueTimelag_3P valueTimelag_3P valueTimelag_7P valueTimelag_7P valueTimelag_7P value
Policy0.018.600.080.022.655<.0011.309<.0010.283.061.311.010.779.010.199.27
lnDeaths−0.091<.001−0.075.002−0.083.001−0.090<.001−0.087.001−0.076.002−0.079.001−0.072.002
Policy*lnElderly



−0.938<.001



−0.443.02



Policy*Medicalcare





−0.001<.001



−0.001.02

Policy*SMEsb







−0.015.05



−0.007.43
Control FEcYes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
State FEYes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Day FEYes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Constant56.693<.00158.277<.00156.651<.00156.684<.00156.686<.00158.270<.00158.294<.00158.266<.001
Observations4537
4447
4537
4537
4537
4447
4447
4447
R20.826
0.817
0.827
0.827
0.826
0.817
0.817
0.817

aTSGI: Twitter sentiment geographical index.

bSME: small and medium enterprises.

cFE: fixed effect.

Table 6. Robustness tests of TSGIa on key features.

Dependent variable: TSGI

(23)(24)(25)(26)(27)(28)

Timelag_7P valueTimelag_7P valueTimelag_7P valueTimelag_7P valueTimelag_7P valueTimelag_7P value
Policy−0.152.172.579.050.342.001−1.719.060.049.231.292.009
lnDeaths−0.071.003−0.075.002−0.072.003−0.073.002−0.077.001−0.070.004
Policy*lnHospitalbeds0.206.04









Policy*lnIncome

−0.239.05







Policy*lnPopulation



−0.054.002





Policy*Sexratio





0.019.05



Policy*Homeless







20.274.09

Policy*Gini









−2.602.01
Control FEbYes
Yes
Yes
Yes
Yes
Yes
State FEYes
Yes
Yes
Yes
Yes
Yes
Day FEYes
Yes
Yes
Yes
Yes
Yes
Constant58.260<.00158.289<.00158.244<.00158.249<.00158.290<.00158.235<.001
Observations4447
4447
4447
4447
4447
4447
R20.817
0.817
0.818
0.817
0.817
0.817

aTSGI: Twitter sentiment geographical index.

bFE: fixed effect.

Table 7. County-level robustness tests.

Dependent variable: TSGI_countya

(29)(30)(31)(32)

Timelag_3P valueTimelag_3P valueTimelag_7P valueTimelag_7P value
Policy3.422<.00121.31<.0012.354.45−3.194.34
Cases−0.013.01−0.0154.02−1.889<.001

Policy*lnElderly

−6.256<.001



Policy*lnPopulation



−0.390.07

lnDeaths





−0.953.004
Policy*lnHospitalbeds





3.626.10
Control FEbYes
Yes
Yes
Yes
Constant56.24<.00156.258<.00159.496<.00159.145<.001
Observations26,923
26,923
26,923
26,923
R20.308
0.143
0.380
0.356

aTSGI: Twitter sentiment geographical index.

bFE: fixed effect.


Principal Results

This study investigated the effects of stay-at-home orders on geo-tweet sentiments in the United States. Results showed several essential points. First, the anticipation and implementation of stay-at-home orders positively influenced discussions on Twitter and helped in the recovery of tweet sentiments. Second, the stay-at-home orders' positive effect on tweet sentiments was significant at both a 3-day lag and a 7-day lag and became insignificant at 14 days. Third, vulnerable groups, such as older people, those with high underlying diseases, and SMEs, faced shocks and hardships during the COVID-19 pandemic. Fourth, in states with low incomes, large gaps between rich and poor, high population densities, and large gender ratios, the positive effects of stay-at-home orders on public sentiment are weakened.

Comparison With Previous Research

This study provides a sociological perspective on the emotional feedback from ordinary people to understand the impact of COVID-19 and stay-at-home orders on different groups. Previous studies on social media Twitter examining public opinion on COVID-19 in different countries, mostly through keyword clustering, lacked further quantification of text mining, a gap that TSGI bridges. More meaningfully, in line with biological and pharmaceutical findings of more significant impact on older age groups and underlying diseases groups, this study finds through a sociological lens that COVID-19 has a large impact on states with a large proportion of vulnerable groups, including older people, underlying diseases, and even on startup businesses.

Our results show fluctuations before and after the implementation of stay-at-home orders. It is consistent with previous findings, which show that the spread of the infection caused fear-related sentiments in the early stage of the pandemic, and then people expressed support for stay-at-home orders [14]. With the continued evolution of the pandemic, the portion of positive Tweets remained level, and that of negative Tweets rose, indicating that pandemic fatigue, stress, and loneliness started taking a toll on how people felt about stay-at-home orders.

In the results on the effects of stay-at-home orders in the different lag of days, we found that the policy effects were insignificant at a lag of 14 days, indicating the policy efficacy faded over time. There is a debate on defining when to “exit strategy,” lift orders, or reopen. Some researchers suggested that a “localization” strategy is efficient after 14 days of lockdown [63], while others found that the efficacy of lockdown measures worldwide continued to grow up to 20 days after implementation [12]. Our results confirmed the latter one and specified that the efficiency of stay-at-home orders was up to 14 days in the United States.

Limitations

There are limitations to our study. First, Twitter users are not representative of the population as a whole, and the sentiment of tweets only indicates the opinions and concerns of web-based users, making it impossible to avoid sampling bias in web-based data. However, the Twitter data set remains a valuable resource with a broad audience as a US-based social media, allowing us to study the real-time reactions of Twitter users and web-based activity related to COVID-19 [31]. Surprisingly, this relatively young, web-based-available, and expressive group still responds significantly to the feedback on COVID-19 in states with a high proportion of older people. Second, our study draws primarily on the TSGI, a quantitative sentiment value, but this is for users of Twitter in the United States. Still, its quantification may need to be more readily generalizable to non–English-speaking countries, such as China and Japan, where language differences can make the quantification of text mining difficult. In this way, future research should compare with findings in Weibo (ie, Twitter in China) and Twitter in other languages. Third, this paper uses states as the unit of study based on the general administrative scope of policy development and implementation. However, a state in the United States can be very heterogeneous, with significant variation in policy implementation and sociodemographics. Although stay-at-home orders are implemented at the state level, the ultimate performance is at the city or county level, so we further conducted robustness tests using county-level data (Table 7). In fact, COVID-19 has a differentiated impact on cities with high population density and rural areas with inadequate medical care, and further distinctions need to be made in future research.

Conclusions

We examined the evolution of public opinion regarding stay-at-home orders in the United States during the COVID-19 pandemic through TSGI, measured based on 7.4 billion geo-tagged tweets. We found a clear positive shift in public opinion about COVID-19, with this positive impact occurring mainly after stay-at-home orders. However, this positive sentiment is time-limited, with 14 days later having allowed people to be more influenced by the status quo and trends. At the same time, feedback on the stay-at-home orders is no longer positively significant. In particular, negative sentiment is more likely to be generated in states with a large proportion of vulnerable groups, and the policy plays a limited role. The pandemic hits older people, those with underlying diseases, and SMEs very directly and hurts the states with cross-cutting economic situations and more complex demographics as the stay-at-home orders implemented over time. Based on large-scale Twitter data, this sociological perspective allows us to monitor the evolution of public opinion more directly, assess the impact of social events on public opinion, and understand the heterogeneity in the face of pandemic shocks. The results of this study can provide guidance for policy makers and public health officials to effectively respond to future pandemics while considering the diverse needs and situations of different groups.

Acknowledgments

We would like to thank Professor Shuming Bao for his valuable comments on an earlier version of this paper. XX would like to express gratitude for the research support from the National Natural Science Foundation of China (grant 42201179), the Ministry of Education of Humanities and Social Science Project (grant 22YJCZH194), Sylff Research Grant (grant SRG-S076), and Shuimu Tsinghua Scholar Program (grant 2021SM088). CYW and WJ would like to extend their appreciation for the research support provided by the Department of Management Science and Information Systems at Oklahoma State University.

Data Availability

Our data sets mainly have three parts: (1) data set about the Twitter sentiment geographical index can be accessed from the Center of Geographical Analysis at Harvard University [54] (2) data sets about variables used in the model and analysis (which are listed in Table 1) can be accessed from PolicyMap [64]; and (3) the data sets about the numbers of confirmed cases and deaths due to COVID-19 can be accessed from New York Times [65].

Authors' Contributions

CYW conceived the presented idea and collected the data. XX designed this model and evaluated the results. YZ reviewed part of the literature and visualized the data. WJ reviewed the literature. All authors discussed and contributed to the final paper.

Conflicts of Interest

None declared.

  1. Fowler JH, Hill SJ, Levin R, Obradovich N. Stay-at-home orders associate with subsequent decreases in COVID-19 cases and fatalities in the United States. PLoS One. 2021;16(6):e0248849. [FREE Full text] [CrossRef] [Medline]
  2. Padalabalanarayanan S, Hanumanthu VS, Sen B. Association of state stay-at-home orders and state-level African American population with COVID-19 case rates. JAMA Netw Open. 2020;3(10):e2026010. [FREE Full text] [CrossRef] [Medline]
  3. Bray CD, Nahas A, Battye WH, Aneja VP. Impact of lockdown during the COVID-19 outbreak on multi-scale air quality. Atmos Environ (1994). 2021;254:118386. [FREE Full text] [CrossRef] [Medline]
  4. Jacobsen GD, Jacobsen KH. Statewide COVID-19 stay-at-home orders and population mobility in the United States. World Med Health Policy. 2020;12(4):347-356. [FREE Full text] [CrossRef] [Medline]
  5. Murray T. Stay-at-home orders, mobility patterns, and spread of COVID-19. Am J Public Health. 2021;111(6):1149-1156. [CrossRef] [Medline]
  6. Conroy DA, Hadler NL, Cho E, Moreira A, MacKenzie C, Swanson LM, et al. The effects of COVID-19 stay-at-home order on sleep, health, and working patterns: a survey study of US health care workers. J Clin Sleep Med. 2021;17(2):185-191. [FREE Full text] [CrossRef] [Medline]
  7. Flanagan EW, Beyl RA, Fearnbach SN, Altazan AD, Martin CK, Redman LM. The impact of COVID-19 stay-at-home orders on health behaviors in adults. Obesity (Silver Spring). 2021;29(2):438-445. [FREE Full text] [CrossRef] [Medline]
  8. Seal A, Schaffner A, Phelan S, Brunner-Gaydos H, Tseng M, Keadle S, et al. COVID-19 pandemic and stay-at-home mandates promote weight gain in US adults. Obesity (Silver Spring). 2022;30(1):240-248. [FREE Full text] [CrossRef] [Medline]
  9. Butterworth P, Schurer S, Trinh TA, Vera-Toscano E, Wooden M. Effect of lockdown on mental health in Australia: evidence from a natural experiment analysing a longitudinal probability sample survey. Lancet Public Health. 2022;7(5):e427-e436. [FREE Full text] [CrossRef] [Medline]
  10. Haucke M, Heinz A, Liu S, Heinzel S. The impact of COVID-19 lockdown on daily activities, cognitions, and stress in a lonely and distressed population: temporal dynamic network analysis. J Med Internet Res. 2022;24(3):e32598. [FREE Full text] [CrossRef] [Medline]
  11. Tull MT, Edmonds KA, Scamaldo KM, Richmond JR, Rose JP, Gratz KL. Psychological outcomes associated with stay-at-home orders and the perceived impact of COVID-19 on daily life. Psychiatry Res. 2020;289:113098. [FREE Full text] [CrossRef] [Medline]
  12. Alfano V, Ercolano S. The efficacy of lockdown against COVID-19: a cross-country panel analysis. Appl Health Econ Health Policy. 2020;18(4):509-517. [FREE Full text] [CrossRef] [Medline]
  13. Fletcher KM, Espey J, Grossman MK, Sharpe JD, Curriero FC, Wilt GE, et al. Social vulnerability and county stay-at-home behavior during COVID-19 stay-at-home orders, United States, April 7-April 20, 2020. Ann Epidemiol. 2021;64:76-82. [FREE Full text] [CrossRef] [Medline]
  14. Surano FV, Porfiri M, Rizzo A. Analysis of lockdown perception in the United States during the COVID-19 pandemic. Eur Phys J Spec Top. 2022;231(9):1625-1633. [FREE Full text] [CrossRef] [Medline]
  15. Allington D, Duffy B, Wessely S, Dhavan N, Rubin J. Health-protective behaviour, social media usage and conspiracy belief during the COVID-19 public health emergency—CORRIGENDUM. Psychol Med. 2021;51(10):1770. [FREE Full text] [CrossRef] [Medline]
  16. Cinelli M, Quattrociocchi W, Galeazzi A, Valensise CM, Brugnoli E, Schmidt AL, et al. The COVID-19 social media infodemic. Sci Rep. 2020;10(1):16598. [FREE Full text] [CrossRef] [Medline]
  17. Barberá P, Rivero G. Understanding the political representativeness of Twitter users. Soc Sci Comput Rev. 2014;33(6):712-729. [CrossRef]
  18. Jungherr A. Twitter use in election campaigns: a systematic literature review. J Inf Technol Polit. 2015;13(1):72-91. [CrossRef]
  19. Doerr B, Fouz M, Friedrich T. Why rumors spread so quickly in social networks. Commun ACM. 2012;55(6):70-75. [CrossRef]
  20. Kwon KH, Bang CC, Egnoto M, Rao HR. Social media rumors as improvised public opinion: semantic network analyses of Twitter discourses during Korean saber rattling 2013. Asian J Commun. 2016;26(3):201-222. [CrossRef]
  21. Luo J, Du J, Tao C, Xu H, Zhang Y. Exploring temporal suicidal behavior patterns on social media: insight from Twitter analytics. Health Informatics J. 2020;26(2):738-752. [FREE Full text] [CrossRef] [Medline]
  22. Sinnenberg L, Buttenheim AM, Padrez K, Mancheno C, Ungar L, Merchant RM. Twitter as a tool for health research: a systematic review. Am J Public Health. 2017;107(1):e1-e8. [CrossRef] [Medline]
  23. Alkouz B, Aghbari ZA, Abawajy JH. Tweetluenza: predicting flu trends from Twitter data. Big Data Min Anal. 2019;2(4):273-287. [FREE Full text] [CrossRef]
  24. Paul MJ, Dredze M, Broniatowski D. Twitter improves influenza forecasting. PLoS Curr. 2014;6:ecurrents.outbreaks.90b9ed0f59bae4ccaa683a39865d9117. [FREE Full text] [CrossRef] [Medline]
  25. Santillana M, Nguyen AT, Dredze M, Paul MJ, Nsoesie EO, Brownstein JS. Combining search, social media, and traditional data sources to improve influenza surveillance. PLoS Comput Biol. 2015;11(10):e1004513. [FREE Full text] [CrossRef] [Medline]
  26. Carter M. How Twitter may have helped Nigeria contain Ebola. BMJ. 2014;349:g6946. [FREE Full text] [CrossRef] [Medline]
  27. van Lent LG, Sungur H, Kunneman FA, van de Velde B, Das E. Too far to care? Measuring public attention and fear for Ebola using Twitter. J Med Internet Res. 2017;19(6):e193. [FREE Full text] [CrossRef] [Medline]
  28. Boon-Itt S, Skunkan Y. Public perception of the COVID-19 pandemic on Twitter: sentiment analysis and topic modeling study. JMIR Public Health Surveill. 2020;6(4):e21978. [FREE Full text] [CrossRef] [Medline]
  29. Chen E, Lerman K, Ferrara E. Tracking social media discourse about the COVID-19 pandemic: development of a public coronavirus Twitter data set. JMIR Public Health Surveill. 2020;6(2):e19273. [FREE Full text] [CrossRef] [Medline]
  30. Manguri KH, Ramadhan RN, Amin PNM. Twitter sentiment analysis on worldwide COVID-19 outbreaks. Kurd J Appl Res. 2020;5:54-65. [FREE Full text] [CrossRef]
  31. Xue J, Chen J, Hu R, Chen C, Zheng C, Su Y, et al. Twitter discussions and emotions about the COVID-19 pandemic: machine learning approach. J Med Internet Res. 2020;22(11):e20550. [FREE Full text] [CrossRef] [Medline]
  32. Yuan X, Xu J, Hussain S, Wang H, Gao N, Zhang L. Trends and prediction in daily new cases and deaths of COVID-19 in the United States: an internet search-interest based model. Explor Res Hypothesis Med. 2020;5(2):1-6. [FREE Full text] [CrossRef] [Medline]
  33. Chen E, Jiang J, Chang HCH, Muric G, Ferrara E. Charting the information and misinformation landscape to characterize misinfodemics on social media: COVID-19 infodemiology study at a planetary scale. JMIR Infodemiology. 2022;2(1):e32378. [FREE Full text] [CrossRef] [Medline]
  34. Jiang J, Ren X, Ferrara E. Social media polarization and echo chambers in the context of COVID-19: case study. JMIRx Med. 2021;2(3):e29570. [FREE Full text] [CrossRef] [Medline]
  35. Rao A, Morstatter F, Hu M, Chen E, Burghardt K, Ferrara E, et al. Political partisanship and antiscience attitudes in online discussions about COVID-19: Twitter content analysis. J Med Internet Res. 2021;23(6):e26692. [FREE Full text] [CrossRef] [Medline]
  36. Muric G, Wu Y, Ferrara E. COVID-19 vaccine hesitancy on social media: building a public Twitter data set of antivaccine content, vaccine misinformation, and conspiracies. JMIR Public Health Surveill. 2021;7(11):e30642. [FREE Full text] [CrossRef] [Medline]
  37. Hsu JTH, Tsai RTH. Increased online aggression during COVID-19 lockdowns: two-stage study of deep text mining and difference-in-differences analysis. J Med Internet Res. 2022;24(8):e38776. [FREE Full text] [CrossRef] [Medline]
  38. Chen X, Yik M. The emotional anatomy of the Wuhan lockdown: sentiment analysis using Weibo data. JMIR Form Res. 2022;6(11):e37698. [FREE Full text] [CrossRef] [Medline]
  39. Dewi TBT, Indrawan NA, Budi I, Santoso AB, Putra PK. Community understanding of the importance of social distancing using sentiment analysis in Twitter. IEEE; Presented at: 2020 3rd International Conference on Computer and Informatics Engineering (IC2IE); September 15-16, 2020, 2020; Yogyakarta, Indonesia. URL: https://ieeexplore.ieee.org/abstract/document/9274589
  40. Wang J, Fan Y, Palacios J, Chai Y, Guetta-Jeanrenaud N, Obradovich N, et al. Global evidence of expressed sentiment alterations during the COVID-19 pandemic. Nat Hum Behav. 2022;6(3):349-358. [FREE Full text] [CrossRef] [Medline]
  41. Fauci AS, Lane HC, Redfield RR. Covid-19—navigating the uncharted. N Engl J Med. 2020;382(13):1268-1269. [FREE Full text] [CrossRef] [Medline]
  42. Banerjee D. The impact of Covid-19 pandemic on elderly mental health. Int J Geriatr Psychiatry. 2020;35(12):1466-1467. [FREE Full text] [CrossRef] [Medline]
  43. Lee K, Jeong GC, Yim J. Consideration of the psychological and mental health of the elderly during COVID-19: a theoretical review. Int J Environ Res Public Health. 2020;17(21):8098. [FREE Full text] [CrossRef] [Medline]
  44. Armitage R, Nellums LB. COVID-19 and the consequences of isolating the elderly. Lancet Public Health. 2020;5(5):e256. [FREE Full text] [CrossRef] [Medline]
  45. Blumenthal D, Fowler EJ, Abrams M, Collins SR. Covid-19—implications for the health care system. N Engl J Med. 2020;383(15):1483-1488. [FREE Full text] [CrossRef] [Medline]
  46. King JS. Covid-19 and the need for health care reform. N Engl J Med. 2020;382(26):e104. [FREE Full text] [CrossRef] [Medline]
  47. Moreno C, Wykes T, Galderisi S, Nordentoft M, Crossley N, Jones N, et al. How mental health care should change as a consequence of the COVID-19 pandemic. Lancet Psychiatry. 2020;7(9):813-824. [FREE Full text] [CrossRef] [Medline]
  48. Godinic D, Obrenovic B. Effects of economic uncertainty on mental health in the COVID-19 pandemic context: social identity disturbance, job uncertainty and psychological well-being model. Int J Innov Econ Dev. 2020;6(1):61-74. [CrossRef]
  49. Juergensen J, Guimón J, Narula R. European SMEs amidst the COVID-19 crisis: assessing impact and policy responses. J Ind Bus Econ. 2020;47(3):499-510. [FREE Full text] [CrossRef]
  50. Kalemli-Ozcan S, Gourinchas P, Penciakova V, Sander N. COVID-19 and SME Failures. Washington, DC. International Monetary Fund; 2020;A001.
  51. Flaxman S, Mishra S, Gandy A, Unwin HJT, Mellan TA, Coupland H, Imperial College COVID-19 Response Team; et al. Estimating the effects of non-pharmaceutical interventions on COVID-19 in Europe. Nature. 2020;584(7820):257-261. [FREE Full text] [CrossRef] [Medline]
  52. Zhang R, Li Y, Zhang AL, Wang Y, Molina MJ. Identifying airborne transmission as the dominant route for the spread of COVID-19. Proc Natl Acad Sci U S A. 2020;117(26):14857-14863. [FREE Full text] [CrossRef] [Medline]
  53. Lewis B, Kakkar D. Harvard CGA Geotweet Archive v2.0. Harvard Dataverse. 2016. URL: https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi:10.7910/DVN/3NCMB6 [accessed 2023-06-27]
  54. Chai Y. Twitter Sentiment Geographical Index. Harvard Dataverse. URL: https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi:10.7910/DVN/3IL00Q [accessed 2023-06-27]
  55. Chandra R, Krishna A. COVID-19 sentiment analysis via deep learning during the rise of novel cases. PLoS One. 2021;16(8):e0255615. [CrossRef]
  56. Chandrasekaran R, Mehta V, Valkunde T, Moustakas E. Topics, trends, and sentiments of tweets about the COVID-19 pandemic: temporal infoveillance study. J Med Internet Res. 2021;22(10):e22624. [CrossRef]
  57. Banerjee A, Pasea L, Harris S, Gonzalez-Izquierdo A, Torralbo A, Shallcross L, et al. Estimating excess 1-year mortality associated with the COVID-19 pandemic according to underlying conditions and age: a population-based cohort study. Lancet. 2020;395(10238):1715-1725. [FREE Full text] [CrossRef] [Medline]
  58. Javanmardi F, Keshavarzi A, Akbari A, Emami A, Pirbonyeh N. Prevalence of underlying diseases in died cases of COVID-19: a systematic review and meta-analysis. PLoS One. 2020;15(10):e0241265. [FREE Full text] [CrossRef] [Medline]
  59. Biswas M, Rahaman S, Biswas TK, Haque Z, Ibrahim B. Association of sex, age, and comorbidities with mortality in COVID-19 patients: a systematic review and meta-analysis. Intervirology. 2020;64(1):36-47. [CrossRef]
  60. La Vignera S, Cannarella R, Condorelli RA, Torre F, Aversa A, Calogero AE. Sex-specific SARS-CoV-2 mortality: among hormone-modulated ACE2 expression, risk of venous thromboembolism and hypovitaminosis D. IJMS. Apr 22, 2020;21(8):2948. [CrossRef]
  61. Pradhan A, Olsson P. Sex differences in severity and mortality from COVID-19: are males more vulnerable? Biol Sex Differ. 2020;11(1):53. [CrossRef]
  62. Sharma D, Shalimar. COVID-19: finally on wane, with reduced lethality. Comb Chem High Throughput Screen. 2022;25(5):768-770. [CrossRef] [Medline]
  63. Sarwal R, Sarwal T. Mitigating COVID-19 with lockdowns: a possible exit strategy. SSRN Journal. 2020. URL: https://ssrn.com/abstract=3563538 [accessed 2023-06-27]
  64. Socioeconomic data. PolicyMap. 2022. URL: https://www.policymap.com/ [accessed 2023-07-03]
  65. Coronavirus (Covid-19) data in the United States. The New York Times. 2021. URL: https://github.com/nytimes/covid-19-data [accessed 2023-07-03]


DID: difference-in-differences
SME: small and medium enterprises
TSGI: Twitter sentiment geographical index


Edited by A Mavragani; submitted 17.01.23; peer-reviewed by E Ferrara, X Huang; comments to author 07.03.23; revised version received 28.03.23; accepted 20.06.23; published 24.07.23.

Copyright

©Xinming Xia, Yi Zhang, Wenting Jiang, Connor Yuhao Wu. Originally published in the Journal of Medical Internet Research (https://www.jmir.org), 24.07.2023.

This is an open-access article distributed under the terms of the Creative Commons Attribution License (https://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work, first published in the Journal of Medical Internet Research, is properly cited. The complete bibliographic information, a link to the original publication on https://www.jmir.org/, as well as this copyright and license information must be included.