next up previous
Next: Example 1: 1996 pid Up: Programs for data from Previous: Programs for data from

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

year 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
Mon Dec 3 06:15:33 EST 2001