FIND DATA: By Journal | Sites   ANALYZE DATA: Help with R | SPSS | Stata | Excel   WHAT'S NEW? US Politics | IR | Law & Courts🎵
   FIND DATA: By Journal | Sites   WHAT'S NEW? US Politics | IR | Law & Courts🎵
WHAT'S NEW? US Politics | IR | Law & Courts🎵

Run R Code Example Online

# 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, grass, attend3, wtss)

# Now we introduce control variable: kids
cat("\n\nCross-Tabulation with Control Variable:\n")
xtabC(~grass + attend3 + kids, gssD)