mediascores: News-sharing Ideology from Social Media Link Data
This package provides an R implementation of a statistical model for news media link data (URLs) on social media (e.g. Twitter, Facebook). The goal of the method is to estimate:
- the news-sharing ideology of politicians and ordinary users on social media
- the ideology of the content that they share online
# install.packages("devtools") devtools::install_github("SMAPPNYU/mediascores")
Quick start guide
To get started, your data need to be formatted as a user-domain count matrix, whereby rows represent individual social media users and columns represent the news media (sub)domains that users share (e.g. nytimes.com). Each cell in the matrix therefore represents the number of times that a given user (row) shared a given domain (columns).
An example of such data (news domains tweeted by Members of Congress) are included in the library and can be loaded as follows:
The default model can be fit to the data as follows:
# Note: This model will take a few hours to fit fitted_model <- mediascores(Y = MOC115[, 7:151], group = MOC115$group, anchors = c(1, 2), chains = 4, cores = 4, warmup = 750, iter = 1500)
A vignette describing the library in greater detail—the model, model-fitting, convergence, and extracting quantities of interest—is available here.