A Tutorial on Collecting and Processing Longitudinal Social Media Data

Grace M. Leffler, Xin TongInternational Journal of Arts Humanities & Social Science 2022 · DOI

Abstract

Longitudinal research using social media data has been under-explored in social and behavioral sciences. Despite its great potential, longitudinal analysis using social media data faces unique challenges. Researchers must consider many influential factors and incorporate them when designing their studies and conducting analyses. Over the past decade, best practices have originated from both studies focusing on social media data in general and those applying longitudinal designs. This tutorial aims to educate those unfamiliar with such a growing field, outlining the different steps that may exist within data collection, data processing, and data analysis of longitudinal social media data. To illustrate these techniques, we apply our basic steps to a Twitter dataset about the 2020 U.S. wildfires, examining sentiment throughout the wildfire period.

Introduction

Traditional longitudinal studies, which track subjects over extended periods, are often prohibitively expensive and logistically challenging. Social media platforms offer a massive, real-time repository of human behavior, yet social scientists frequently lack the technical framework to leverage this for longitudinal research. This tutorial addresses three primary hurdles: technical barriers in API navigation, the inherent irregularity of "unbalanced" datasets, and the need for methodological rigor regarding selection bias and ethics.

Methodology: From Collection to Analysis

The research workflow is divided into three critical stages: collection, processing, and analysis.

Data Collection and Processing

Data collection involves navigating APIs, such as the Twitter Academic Research API, to access historical data. Researchers must identify Meaningful Time Points (MTPs) relevant to their study. Once collected, text mining and sentiment analysis are employed. This study utilized "Emoxicon" analysis to generate sadness (SAD) scores, merging this with external environmental data like the EPA's Air Quality Index (AQI).

Sample of the processed dataset merging Twitter sentiment with environmental and geographic data.

Data Analysis

Because social media users post at varying frequencies, the resulting datasets are "unbalanced." To account for this, we recommend Multilevel Modeling (MLM) or Growth Curve Modeling. Unlike traditional methods, MLM naturally accommodates time-unstructured data and varying numbers of measurements per participant.

Case Study: The 2020 U.S. Wildfires

To demonstrate these methods, we analyzed 1,403 tweets from 588 participants in Los Angeles and Portland during the 2020 wildfires.

A linear unconditional growth curve model was identified as the most parsimonious fit. Analysis revealed a statistically significant decrease in SAD scores over the wildfire period (average slope = -0.009, p < .01), indicating a gradual return to baseline sentiment as the crisis evolved.

Individual trajectories of SAD scores over the 30-day wildfire period, illustrating the unbalanced nature of social media data.

Key Insights

  • Visual Context: Tweets containing wildfire imagery were significantly more likely to convey sadness, highlighting the importance of visual covariates.
  • Threshold Effects: Interestingly, AQI scores were not significant predictors of sadness once a certain pollution threshold (AQI > 100) was reached, suggesting that extreme conditions may plateau emotional response.
  • Geographic Resilience: Portland residents showed a faster reduction in sadness compared to those in Los Angeles, likely due to the longer duration and greater extent of the fires in California.

Limitations and Future Directions

Social media data remains "messy." Challenges include low sample density (most participants only tweeted 2-3 times), the difficulty of text mining in capturing sarcasm, and ethical considerations regarding public data usage. Future research should strive for higher-frequency sampling and improved methods for inferring demographics to ensure representative findings.

Summary updated

Abstract

Longitudinal research using social media data has been under-explored in social and behavioral sciences. Despite its great potential, longitudinal analysis using social media data faces unique challenges. Researchers must consider many influential factors and incorporate them when designing their studies and conducting analyses. Over the past decade, best practices have originated from both studies focusing on social media data in general and those applying longitudinal designs. This tutorial aims to educate those unfamiliar with such a growing field, outlining the different steps that may exist within data collection, data processing, and data analysis of longitudinal social media data. To illustrate these techniques, we apply our basic steps to a Twitter dataset about the 2020 U.S. wildfires, examining sentiment throughout the wildfire period.
BibTeX
@article{leffler2022tutorial,
  author = {Grace M. Leffler and Xin Tong},
  title = {{A Tutorial on Collecting and Processing Longitudinal Social Media Data}},
  journal = {International Journal of Arts Humanities \& Social Science},
  year = {2022},
  doi = {10.56734/ijahss.v3n10a2},
}
Figure