Modeling spatiotemporal factors associated with sentiment on twitter: synthesis and suggestions for improving the identification of localized deviations

Zubair Shah, Paige Martin, Enrico Coiera, Kenneth D. Mandl, Adam G. Dunn

Research output: Contribution to journalArticleResearchpeer-review

Abstract

Background: Studies examining how sentiment on social media varies depending on timing and location appear to produce inconsistent results, making it hard to design systems that use sentiment to detect localized events for public health applications. Objective: The aim of this study was to measure how common timing and location confounders explain variation in sentiment on Twitter. Methods: Using a dataset of 16.54 million English-language tweets from 100 cities posted between July 13 and November 30, 2017, we estimated the positive and negative sentiment for each of the cities using a dictionary-based sentiment analysis and constructed models to explain the differences in sentiment using time of day, day of week, weather, city, and interaction type (conversations or broadcasting) as factors and found that all factors were independently associated with sentiment. Results: In the full multivariable model of positive (Pearson r in test data 0.236; 95% CI 0.231-0.241) and negative (Pearson r in test data 0.306; 95% CI 0.301-0.310) sentiment, the city and time of day explained more of the variance than weather and day of week. Models that account for these confounders produce a different distribution and ranking of important events compared with models that do not account for these confounders. Conclusions: In public health applications that aim to detect localized events by aggregating sentiment across populations of Twitter users, it is worthwhile accounting for baseline differences before looking for unexpected changes.

LanguageEnglish
Article numbere12881
Pages1-16
Number of pages16
JournalJournal of Medical Internet Research
Volume21
Issue number5
DOIs
Publication statusPublished - 8 May 2019

Fingerprint

Weather
Public Health
Social Media
Language
Population
Datasets

Bibliographical note

Copyright the Author(s) 2019. Version archived for private and non-commercial use with the permission of the author/s and according to publisher conditions. For further rights please contact the publisher.

Keywords

  • Public health
  • Social media
  • Text mining

Cite this

@article{a7de725a9d354384a0cf61aac2020c77,
title = "Modeling spatiotemporal factors associated with sentiment on twitter: synthesis and suggestions for improving the identification of localized deviations",
abstract = "Background: Studies examining how sentiment on social media varies depending on timing and location appear to produce inconsistent results, making it hard to design systems that use sentiment to detect localized events for public health applications. Objective: The aim of this study was to measure how common timing and location confounders explain variation in sentiment on Twitter. Methods: Using a dataset of 16.54 million English-language tweets from 100 cities posted between July 13 and November 30, 2017, we estimated the positive and negative sentiment for each of the cities using a dictionary-based sentiment analysis and constructed models to explain the differences in sentiment using time of day, day of week, weather, city, and interaction type (conversations or broadcasting) as factors and found that all factors were independently associated with sentiment. Results: In the full multivariable model of positive (Pearson r in test data 0.236; 95{\%} CI 0.231-0.241) and negative (Pearson r in test data 0.306; 95{\%} CI 0.301-0.310) sentiment, the city and time of day explained more of the variance than weather and day of week. Models that account for these confounders produce a different distribution and ranking of important events compared with models that do not account for these confounders. Conclusions: In public health applications that aim to detect localized events by aggregating sentiment across populations of Twitter users, it is worthwhile accounting for baseline differences before looking for unexpected changes.",
keywords = "Public health, Social media, Text mining",
author = "Zubair Shah and Paige Martin and Enrico Coiera and Mandl, {Kenneth D.} and Dunn, {Adam G.}",
note = "Copyright the Author(s) 2019. Version archived for private and non-commercial use with the permission of the author/s and according to publisher conditions. For further rights please contact the publisher.",
year = "2019",
month = "5",
day = "8",
doi = "10.2196/12881",
language = "English",
volume = "21",
pages = "1--16",
journal = "Journal of Medical Internet Research",
issn = "1438-8871",
publisher = "JMIR PUBLICATIONS, INC",
number = "5",

}

Modeling spatiotemporal factors associated with sentiment on twitter : synthesis and suggestions for improving the identification of localized deviations. / Shah, Zubair; Martin, Paige; Coiera, Enrico; Mandl, Kenneth D.; Dunn, Adam G.

In: Journal of Medical Internet Research, Vol. 21, No. 5, e12881, 08.05.2019, p. 1-16.

Research output: Contribution to journalArticleResearchpeer-review

TY - JOUR

T1 - Modeling spatiotemporal factors associated with sentiment on twitter

T2 - Journal of Medical Internet Research

AU - Shah, Zubair

AU - Martin, Paige

AU - Coiera, Enrico

AU - Mandl, Kenneth D.

AU - Dunn, Adam G.

N1 - Copyright the Author(s) 2019. Version archived for private and non-commercial use with the permission of the author/s and according to publisher conditions. For further rights please contact the publisher.

PY - 2019/5/8

Y1 - 2019/5/8

N2 - Background: Studies examining how sentiment on social media varies depending on timing and location appear to produce inconsistent results, making it hard to design systems that use sentiment to detect localized events for public health applications. Objective: The aim of this study was to measure how common timing and location confounders explain variation in sentiment on Twitter. Methods: Using a dataset of 16.54 million English-language tweets from 100 cities posted between July 13 and November 30, 2017, we estimated the positive and negative sentiment for each of the cities using a dictionary-based sentiment analysis and constructed models to explain the differences in sentiment using time of day, day of week, weather, city, and interaction type (conversations or broadcasting) as factors and found that all factors were independently associated with sentiment. Results: In the full multivariable model of positive (Pearson r in test data 0.236; 95% CI 0.231-0.241) and negative (Pearson r in test data 0.306; 95% CI 0.301-0.310) sentiment, the city and time of day explained more of the variance than weather and day of week. Models that account for these confounders produce a different distribution and ranking of important events compared with models that do not account for these confounders. Conclusions: In public health applications that aim to detect localized events by aggregating sentiment across populations of Twitter users, it is worthwhile accounting for baseline differences before looking for unexpected changes.

AB - Background: Studies examining how sentiment on social media varies depending on timing and location appear to produce inconsistent results, making it hard to design systems that use sentiment to detect localized events for public health applications. Objective: The aim of this study was to measure how common timing and location confounders explain variation in sentiment on Twitter. Methods: Using a dataset of 16.54 million English-language tweets from 100 cities posted between July 13 and November 30, 2017, we estimated the positive and negative sentiment for each of the cities using a dictionary-based sentiment analysis and constructed models to explain the differences in sentiment using time of day, day of week, weather, city, and interaction type (conversations or broadcasting) as factors and found that all factors were independently associated with sentiment. Results: In the full multivariable model of positive (Pearson r in test data 0.236; 95% CI 0.231-0.241) and negative (Pearson r in test data 0.306; 95% CI 0.301-0.310) sentiment, the city and time of day explained more of the variance than weather and day of week. Models that account for these confounders produce a different distribution and ranking of important events compared with models that do not account for these confounders. Conclusions: In public health applications that aim to detect localized events by aggregating sentiment across populations of Twitter users, it is worthwhile accounting for baseline differences before looking for unexpected changes.

KW - Public health

KW - Social media

KW - Text mining

UR - http://www.scopus.com/inward/record.url?scp=85067226078&partnerID=8YFLogxK

UR - http://purl.org/au-research/grants/nhmrc/1128968

U2 - 10.2196/12881

DO - 10.2196/12881

M3 - Article

VL - 21

SP - 1

EP - 16

JO - Journal of Medical Internet Research

JF - Journal of Medical Internet Research

SN - 1438-8871

IS - 5

M1 - e12881

ER -