next up previous
Next: Programs for data from Up: Programs for data from Previous: Programs for data from

Example 0: 2000 pid, libcon, watchtv; make tables

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



Walter Mebane
Mon Dec 3 06:15:33 EST 2001