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 5: Making Controlled Comparisons
library(poliscidata)  # Loads R companion package in session

# CROSS-TABULATION ANALYSIS WITH A CONTROL VARIABLE

# Starting point, cross-tabulation without control variable
# This xtp command will generate a mosiac plot
cat("Basic Cross-Tabulation:\n")
xtp(gss, divlaw2, attend3, wtss)

# Now we introduce control variable: kids
cat("\n\nCross-Tabulation with Control Variable:\n")
xtabC (~divlaw2 + attend3 + kids, gssD)
Watch & Learn
Run R Demo
i
Online demo using xtabC function from poliscidata package..
 Controlled Cross Tabulation of Marijuana Opinions Demo.
thumbnail preview
â–º
i
From David Caughlin (33:48).
 Gentle Introduction to R
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