FIND DATA: By Author | Journal | Sites   ANALYZE DATA: Help with R | SPSS | Stata | Excel   WHAT'S NEW? US Politics | Int'l Relations | Law & Courts
   FIND DATA: By Author | Journal | Sites   WHAT'S NEW? US Politics | IR | Law & Courts
Run R Code
About This Page
This page features live demonstrations of the R Statistics Program used for political science research.
  • To run example, click the Run button.
  • To copy example code, click the Copy button.


See More R Demos
Run R Code in Your Web Browser
# 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")
Watch & Learn
thumbnail preview
â–º
i
From David Caughlin (11:51).
 Setting a Working Directory
thumbnail preview
â–º
i
Simple way to create frequency distribution tables and bar charts for nominal and ordinal-level variables, from Barry Edwards (14:23).
 How to Use RCPA3's freqC Function for Frequency Distribution Tables and Bar Charts
MORE VIDEOS: See Video Channels for more political science videos!
LEARN HOW: Watch Lecture Videos for Essentials of Political Analysis, Video Tutorials for R, Stata, SPSS, and Excel