Blog Archives

historical word embeddings & lexical semantic change

April 13, 2019
By
historical word embeddings & lexical semantic change

Google n-gram data Nearest-neighbors Procrustes, PCA & visualizing semantic change Detecting semantic change Summary References I have developed a Git Hub guide that demonstrates a simple workflow for sampling Google n-gram data and building historical word embeddings with the aim of investigating lexical semantic change. Here, we build on this workflow, and unpack some methods presented in Hamilton, Leskovec, and Jurafsky (2016) & Li et...

Read more »

Some perspectives on Xochitl Torres Small’s win in CD NM-02

January 16, 2019
By
Some perspectives on Xochitl Torres Small’s win in CD NM-02

A brief intro to nmelectiondatr CD NM-02: an overview A look at Pearce-Xochitl precincts Straight- & split-ticket voting in NM-02 Summary In this post, we consider some different precinct-level perspectives on Xochitl Torres Small’s surprising win over Yvette Herrell in New Mexico’s 2nd Congressional District (NM-02) in the 2018 general elections. Candidate Party Votes Percent Winner XOCHITL TORRES SMALL DEM 101489 0.509 Winner YVETTE HERRELL REP 97767 0.491 Specifically, we investigate the role of (1) suburban voting precincts and...

Read more »

genre, text classification & naive bayes

November 14, 2018
By
genre, text classification & naive bayes

Building a historical, genre-based corpus Building a Naive Bayes classifier Model assessment & confusion matrix Summary In this short post, we outline a Naive Bayes (NB) approach to genre-based text classification. First, we introduce & describe a corpus derived from Google News’ RSS feed, which includes source and genre information. We then train, test & evaluate the efficacy of an NB classifier applied...

Read more »

Twitter, political ideology & the 115th US Senate

November 2, 2018
By
Twitter, political ideology & the 115th US Senate

Congressional data sources Scraping tweets via rtweet Twitter followers & political ideology Shared tweets as ideology Summary Postscript: News media ideologies Resources In this post, we consider some fairly recent studies conducted by folks at the Washington Post and the Pew Research Center that investigate the relationship between political ideology — as estimated by voting behavior/DW-Nominate scores (Poole and Rosenthal 1985) — and social media usage...

Read more »

Political ideology & New Mexico’s 53rd State Legislature

October 9, 2018
By
Political ideology & New Mexico’s 53rd State Legislature

Ideal points estimation Legislators in political space Legislation in 2D political space Political space and marijuana A quick geographical perspective Political ideology in NMSL53 Summary References This is the second in a series of posts investigating voting patterns in New Mexico’s 53rd State Legislature (NMSL53). In this post, we detail the use of K. T. Poole and Rosenthal (2011) ’s ideal point estimation procedure (aka NOMINATE) to...

Read more »

New Mexico’s 53rd State Legislature

September 30, 2018
By
New Mexico’s 53rd State Legislature

Package descriptives NMSL53: an overview Attendance & party loyalty Health care-related roll calls Roll call details Incorporating census data Summary Postscript: Vizualizing congressional composition In this post, we introduce a new R data package, nmlegisdatr, that makes available roll call data for New Mexico’s 53rd (2017-18) State Legislature (NMSL53). While these data are publicly available via nmlegis.gov, they are wrapped up in thousands of PDFs and, hence,...

Read more »

psychological and geographical distance in text

April 18, 2018
By
psychological and geographical distance in text

Concreteness ratings and the lexvarsdatr package Context & concreteness scores Geographical distance FIN References This post considers a super-clever study presented in Snefjella and Kuperman (2015), in which the authors investigate the relationship between psychological distance and geographical distance using geolocated tweets. General idea/hypothesis: The more we perceive an event/entity as (geographically) proximal to self, the more concrete our language when referencing said event/entity; the...

Read more »

building historical socio-demographic profiles

March 28, 2018
By
building historical socio-demographic profiles

Some preliminaries Socio-economic profiles Age distribution profiles Summary This post demonstrates a simple workflow for building census-based, historical socio-demographic profiles using the R package tidycensus. The goal is to outline a reproducible method for quick visual exploration of trend data made available via the American Community Survey (ACS). We focus mostly on socio-economic summary data included in ACS data profile tables; however, we also...

Read more »

place from text: geography & distributional semantics

March 11, 2018
By
place from text: geography & distributional semantics

From text to map Corpus search and context LSA, MDS, and semantic space FIN In this post, we demonstrate some different methodologies for exploring the geographical information found in text. First, we address some of the practical issues of extracting places/place-names from an annotated corpus, and demonstrate how to (1) map their geospatial distribution via geocoding and (2) append additional geographic detail to...

Read more »

topic models for synchronic & diachronic corpus exploration

February 25, 2018
By
topic models for synchronic & diachronic corpus exploration

Synchronic application Diachronic application Topic clusters quick summary References This post outlines a fairly simple workflow from annotated corpus to topic model, with a focus on the exploratory utility of topic models. We first consider some text structures relevant to topic modeling in R, and then demonstrate some approaches to visualizing model results, including variation in topic prevalence over time for a diachronic corpus....

Read more »

Search R-bloggers


Sponsors

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)