You are here

An R Companion to Political Analysis

An R Companion to Political Analysis

Second Edition

March 2017 | 248 pages | CQ Press
Teach your students to conduct political research using R, the open source programming language and software environment for statistical computing and graphics. An R Companion to Political Analysis offers the same easy-to-use and effective style as the best-selling SPSS and Stata Companions. The all-new Second Edition includes new and revised exercises and datasets showing students how to analyze research-quality data to learn descriptive statistics, data transformations, bivariate analysis (cross-tabulations and mean comparisons), controlled comparisons, statistical inference, linear correlation and regression, dummy variables and interaction effects, and logistic regression. The clear explanation and instruction is accompanied by annotated and labeled screen shots and end-of-chapter exercises to help students apply what they have learned.

“Students will love this book, as will their teachers.”
 – Courtney Brown, Emory University
List of Boxes and Figures
A Quick Reference Guide to R Companion Functions
Introduction: Getting Acquainted with R
About R

Installing R

A Quick Tour of the R Environment



Getting Help


Chapter 1: The R Companion Package
Running Scripts

Ten Tips for Writing Good R Scripts

Managing R Output: Graphics and Text

Additional Software for Working with R

Debugging R Code


Chapter 2: Descriptive Statistics
Interpreting Measures of Central Tendency and Variation

Describing Nominal Variables

Describing Ordinal Variables

Describing the Central Tendency of Interval Variables

Describing the Dispersion of Interval Variables

Obtaining Case-Level Information


Chapter 3: Transforming Variables
Applying Mathematical and Logical Operators to Variables

Creating Indicator Variables

Changing Variable Classes

Adding or Modifying Variable Labels

Collapsing Variables into Simplified Categories

Centering or Standardizing a Numeric Variable

Creating an Additive Index


Chapter 4: Making Comparisons
Cross-Tabulations and Mosaic Plots

Line Charts

Mean Comparison Analysis

Box Plots

Strip Charts


Chapter 5: Making Controlled Comparisons
Cross-Tabulation Analysis with a Control Variable

Multiple Line Charts

The legend Function

Mean Comparison Analysis with a Control Variable


Chapter 6: Making Inferences about Sample Means
Finding the 95 Percent Confidence Interval of the Population Mean

Testing Hypothetical Claims about the Population Mean

Making Inferences about Two Sample Means

Making Inferences about Two Sample Proportions


Chapter 7: Chi-Square and Measures of Association
Analyzing an Ordinal-Level Relationship

Analyzing an Ordinal-Level Relationship with a Control Variable

Analyzing a Nominal-Level Relationship with a Control Variable


Chapter 8: Correlation and Linear Regression
Correlation Analysis

Bivariate Regression with a Dummy Variable

Bivariate Regression with an Interval-Level Independent Variable

Multiple Regression Analysis

Multiple Regression with Ordinal or Categorical Variables

Weighted Regression with a Dummy Variable

Multiple Regression Analysis with Weighted Data

Weighted Regression with Ordinal or Categorical Independent Variables

Creating Tables of Regression Results


Chapter 9: Visualizing Correlation and Regression Analysis
Visualizing Correlation

General Comments about Visualizing Regression Results

Plotting Multiple Regression Results

Interaction Effects in Multiple Regression

Visualizing Regression Results with Weighted Data

Special Issues When Plotting Observations with Limited Unique Values


Chapter 10: Logistic Regression
Thinking about Odds, Logged Odds, and Probabilities

Estimating Logistic Regression Models

Interpreting Logistic Regression Results with Odds Ratios

Visualizing Results with Predicted Probabilities Curves

Probability Profiles for Discrete Cases

Model Fit Statistics for Logistic Regressions

An Additional Example of Multivariable Logistic Regression


Chapter 11: Doing Your Own Political Analysis
Seven Doable Ideas

Importing Data

Writing It Up

Table A.1 Alphabetical List of Variables in the GSS Dataset

Table A.2 Alphabetical List of Variables in the NES Dataset

Table A.3 Alphabetical List of Variables in the States Dataset

Table A.4 Alphabetical List of Variables in the World Dataset

About the Authors


Instructor Resources
  • Downloadable R datasets used in the text. 
  • A set of all the graphics from the text, including all of the maps, tables, and figures, in PowerPoint, .pdf, and .jpg formats for class presentations.

"R and its application continues to expand worldwide, replacing both its less flexible and less available alternatives and offering new opportunities. R Companion helps quickly climb the frequently steep learning curve of the 'program library of program libraries'. The book has a deserved good record as a path-breaker in teaching R with concerns towards political analysis. Highly recommended."

Pertti Ahonen
University of Helsinki

“Phillip H. Pollock has written a timely, useful, and well-written book to accompany his popular text The Essentials of Political Analysis. The use of R in the classroom is increasing each year, and the need for user-friendly books to help integrate methodological training with this powerful statistical language has reached a critical stage. Professor Pollock’s book fills this gap superbly. It takes the student from the elements of installing R on their own computer or laptop through the use of R to solve both simple and complex problems in social and political analysis. Students will love this book, as will their teachers.”

Courtney Brown
Emory University

Sample Materials & Chapters

Chapter 1

Chapter 2

For instructors

Select a Purchasing Option