year 2000 VARS V000523 V001202 V001368 ; # one-way frequency tables (always important to examine these) xtable V000523 xtable V001202 xtable V001368 # copy party ID to a more intuitively named variable pid <- V000523; # change "other; minor party" to Independent-Independent pid <- ifelse(pid == 7, 3, pid); # copy libcon self-placement to a more intuitively named variable libcon <- V001368; # watchtv is how much watched campaign on TV: no (1), yes (2) watchtv <- V001202; # one-way frequency tables xtable pid xtable libcon xtable watchtv # crosstab of libcon given pid xtable libcon pid # crosstab of libcon given pid and watchtv xtable libcon pid watchtv