User Tools

Site Tools


A Note to Readers


We created this web site to accompany our paper, "Using Graphs Instead of Tables in Political Science". This page provides details on what can be found on the web site, and how best to use it.

In the paper, we took a sample of tables from leading political science journals and converted them to graphs. This web site contains both the table and graph versions of each of these tables, as well as the R code that we used to create the graphs. The site also contains a few graphs (most converted from tables in the same journals) that we did not include in the paper due to space limitations.

Using This Site

There are two main pages on the site: one that includes graphs of descriptive statistics, and one that includes graphs of regression coefficients. On each page, the tables and graphs appear in the same order as they do in the paper; additional graphs that we did not present appear toward the bottom of the page. For each table/graph combination, we display the original table and then our graph. Below each graph appears a link where you can download a text file containing the R code we used to construct the graph. Some of the graphs required the input of datasets; where needed, we have created links to Stata datasets that we used to create a graph. (Note that you do not have to be a Stata user to access these datasets in R. Our R code automatically reads these datasets into R.) We have also supplied Stata code for a few of the graphs; we are hoping to create Stata code for as many graphs as possible, and will continue to update the website.

For readers who prefer to download all code and data at once, we have also created a zip file that contains the complete R code, Stata code (where applicable) and Stata datasets (also where applicable) that were used to create all the graphs that appear on this site. UCLA's ATS has Stata code that can be used to recreate some of the graphs.

R Code

In all the R code files, we have inserted comments that should help readers better understand the process and graphical choices we used to create each figure.

The graphs that appear in the paper were created as PDF files, while the graphs that appear on this site were created as png files. We have commented out both commands in the R code (as well as the “” command that creates the respective file) so that users can simply create each graph in R's graphical window by cutting and pasting the code into R (or, more conveniently, by using a text editor such as WinEdt or Emacs). Thus, each file contains some variant of the following:

#pdf("file_name.pdf", height = 2.5, width =4.5) #create pdf (heights and widths measured in inches)
#png("file_name.png", height = 300, width = 440)#create png (heights and widths measured in pixels)
. . . #turn off graphing device. graph is created in working directory.

To create a pdf file, you would need to remove the comment from both the pdf() command and the command. Likewise, to create a png file, you would need to remove the comment from the png() command and the command.

02_a_note_to_readers.txt · Last modified: 2013/12/15 15:20 (external edit)