NOW AVAILABLE: Essentials of Poltical Analysis 7e | R Companion 4e | SPSS 7e | Stata 5e | Excel 1e 🎵
NOW AVAILABLE: Essentials 7e | R Companion 4e | SPSS 7e | Stata 5e | Excel 1e 🎵
NOW AVAILABLE: Essentials 7e | More Textbooks 🎵

Run R Code Example Online

# Chapter 4: Making Comparisons
library(poliscidata)  # Loads R companion package in session

# LINE CHARTS

# You first need to transform the DV.
nes$envir = as.numeric(nes$envjob_3=="Envir")
nes$envir = 100*nes$envir

plotmeansC(nes, ~envir, ~pid_3, envir~pid_3, w=~wt,
           xlab="Party Identification", 
           ylab="Percent Pro-Environment",
           main="Percentage Favoring Environment over Jobs,\n by Party Identification")