Blog Archives

A Link Between topicmodels LDA and LDAvis

May 8, 2015
By

Carson Sievert and Kenny Shirley have put together the really nice LDAvis R package. It provides a Shiny-based interactive interface for exploring the output from Latent Dirichlet Allocation topic models. If you've never used it, I highly recommend checking out their XKCD example (this paper also has some nice background). LDAvis doesn't fit topic models, it...

Read more »

Set up R/Stan on Amazon EC2

December 10, 2014
By

A few months ago I posted the script that I use to set up my R/JAGS working environment on an Amazon EC2 instance.Since then I've largely transitioned to using R/Stan to estimate my models. So, I've updated my setup script (see below). There are a few...

Read more »

Do Political Scientists Care About Effect Sizes: Replication and Type M Errors

October 13, 2014
By

Reproducibility has come a long way in political science since I began my PhD all the way back in 2008. Many major journals now require replication materials be made available either on their websites or some service such as the Dataverse Network.This ...

Read more »

Note to self: brew cleanup r

July 22, 2014
By

Note to self: after updating R with Homebrew remember to cleanup old versions: brew cleanup r Otherwise I'm liable to get a segfault. (see also)

Read more »

Simple script from setting up R, Git, and Jags on Amazon EC2 Ubuntu Instance

June 28, 2014
By

Just wanted to put up the script I've been using to create an Amazon EC2 Ubuntu instance for running RStudio, Git, and Jags. There isn't anything really new in here, but it it has been serving me well. The script begins after the basic instance has bee...

Read more »

Updates to repmis: caching downloaded data and Excel data downloading

May 11, 2014
By

Over the past few months I’ve added a few improvements to the repmis–miscellaneous functions for reproducible research–R package. I just want to briefly highlight two of them: Caching downloaded data sets. source_XlsxData for downloading data in Excel formatted files. Both of these capabilities are in repmis version 0.2.9 and greater. Caching When working with data sourced directly from the internet, it can be...

Read more »

d3Network Plays Nice with Shiny Web Apps

May 9, 2014
By
d3Network Plays Nice with Shiny Web Apps

After some delay (and because of helpful prompting by Giles Heywood and code contributions by John Harrison) d3Network now plays nicely with Shiny web apps. This means you can fully integrate R/D3.js network graphs into your web apps. Here is what one ...

Read more »

Programmatically download political science data with the psData package

February 23, 2014
By

A lot of progress has been made on improving political scientists’ ability to access data ‘programmatically’, e.g. data can be downloaded with source code R. Packages such as WDI for World Bank Development Indicator and dvn for many data sets stored on the Dataverse Network make it much easier for political scientists to use this data...

Read more »

Three Quick and Simple Data Cleaning Helper Functions (December 2013)

December 6, 2013
By

As I go about cleaning and merging data sets with R I often end up creating and using simple functions over and over. When this happens, I stick them in the DataCombine package. This makes it easier for me to remember how to do an operation and others can possibly benefit from simplified and (hopefully) more intuitive code....

Read more »

Showing results from Cox Proportional Hazard Models in R with simPH

September 2, 2013
By
Showing results from Cox Proportional Hazard Models in R with simPH

Effectively showing estimates and uncertainty from Cox Proportional Hazard (PH) models, especially for interactive and non-linear effects, can be challenging with currently available software. So, researchers often just simply display a results table. These are pretty useless for Cox PH models. It is difficult to decipher a simple linear variable’s estimated effect and basically impossible to understand time...

Read more »