next up previous
Next: About this document ... Up: Programs for data from Previous: Example 5: 2000 pid,

Example 6: multiple years, 2000, 1996 pid, libcon, watchtv; make tables

year multiple 2000 1996

VARS
  CF0301
  CF0724
  CF0803
;

# one-way frequency tables (always important to examine these)
xtable CF0301
xtable CF0724
xtable CF0803

# get rid of unwanted value in party ID
pid <- CF0301;
pid <- ifelse(pid == 9, NA, pid);

# get rid of unwanted value in libcon self-placement
libcon <- CF0803;
libcon <- ifelse(libcon == 9, NA, libcon);

# watchtv is how much watched campaign on TV: no (1), yes (2)
watchtv <- CF0724;

# 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 2004-11-18