next up previous
Next: About this document ... Up: Programs for data from Previous: Programs for data from

Example 0: 1984 Continuous Monitoring pid, libcon, week; make tables

year 1984CM

VARS
  V114
  V613
  V734
;

# one-way frequency tables (always important to examine these)
xtable V114
xtable V613
xtable V734

# copy party ID to a more intuitively named variable
pid <- V734;
# change "other; minor party" to Independent-Independent
pid <- ifelse(pid == 7, 3, pid);
# change "apolitical" to Independent-Independent
pid <- ifelse(pid == 8, 3, pid);

# copy libcon self-placement to a more intuitively named variable
libcon <- V613;
# delete DK and NA libcon values
libcon <- ifelse(libcon == 8 | libcon == 9, NA, libcon);

# Week Interview Completed
week <- V114;

# one-way frequency tables
xtable pid
xtable libcon
xtable week

# crosstab of libcon given pid
xtable libcon pid

# crosstab of pid given week
xtable pid week

# crosstab of libcon given pid and week
xtable libcon pid week



Walter Mebane 2005-11-03