next up previous
Next: Example 1: 2004 pid, Up: Programs for data from Previous: Example 0: 2004 pid,

Example 0mult: 2004, 2000, 1996 pid, libcon, watchtv; make tables

year multiple 2004 2000 1996

VARS
  VCF0301
  VCF0724
  VCF0803
;

# one-way frequency tables (always important to examine these)
xtable VCF0301
xtable VCF0724
xtable VCF0803

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

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

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

# 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 2005-11-03