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

# MEAN COMPARISON ANALYSIS

cat("Mean Comparison Table:\n")
compmeans(nes$ft_hclinton, nes$pid_x, nes$wt, plot=F)

plotmeansC(nes, ~ft_hclinton, ~pid_x, ft_hclinton ~ pid_x, w = ~wt,
           xlab="Party identification", ylab="Ratings of Hillary Clinton",
           main="Ratings of Hillary Clinton,\n by Party Identification")