Mike Gruszczynski Social scientist interested in the intersection of politics and data.

Tracking House Republicans' Support for the AHCA

With the House vote on the American Health Care Act (AHCA) nearly upon us, a great deal of attention has been rightly given to the razor-thin margins President Trump and Republican leadership has in pushing this bill through Congress. As the New York Times explained this week, the bill needs 216 Republican votes in the House to pass (no Democrats support the AHCA).

According to the NYT, As of Thursday, March 23, there are 149 likely Republican supporters of the bill, while 44 are undecided, 15 have concerns or lean no, and 29 are likely no-votes. This bill cannot pass with 29 “no” votes.

Being so close to the election of Donald Trump as President of the United States, combined with the fact that House incumbents’ next election is always looming, it can be useful to examine whip counts in relation to Trump’s 2016 electoral performance in each Congressional district.

Mapping in R

Mapping used to be one of those things that always seemed a bit out of reach to all but the GIS folks. Let’s be honest: really good mapping still very much is. But it like so many things in data manipulation and visualization, it has gotten quite a bit easier to create decent map-based visualizations in R.

R has had decent mapping capabilities for some time, but (like so many things) these have gotten more accessible with Hadley Wickham’s ggplot package, which includes the map_data set of shapes for political boundaries.

Mapping in R feature image

Agenda-Setting Between the U.S. Congress and Public

The combination of the Hadley Wickham tidyverse and Stefan Milton’s magrittr (also a part of the tidyverse) has made life so much easier for people who spend a great deal of time munging data - which is to say, pretty much anyone who does any amount of data munging.

Generating Random Walks in R

Note: The code in this post was partially derived from an answer by Jake Burkhead over at Stack Overflow

It can be useful for illustration purposes to be able to show basic concepts such as “random walks” using R. If you’re not familiar with random walks, the concept is usually applied to a Markov Chain process, wherein the current value of some variable is dependent upon only its previous value (not values, mind you), with deviations from the previous value being either -1 or 1.