Previous PageNext Page

Merging data sets
The simplest form of combining two data sets with the different variables but the same observations is called merging.
Recall the two data sets GenYear and HtWt:

GenYear
OBS    SUBJ    GENDER    YEAR

 1       1       M        91
 2       7       F        90
 3       9       M        93
 4       5       F        92
 5       8       M        91

HtWt
OBS    SUBJ    HEIGHT    WEIGHT

 1       1        68       155
 2       7        72       205
 3       9        66       120
 4       5       102        63
 5       8       250        70

For example, say you want to combine the information in these two separate files. Since there are the same number of observations in each and the variables are different (except SUBJ), you probably want to combine the information by attaching the two data sets side-to-side (rather than top-to-bottom as in the SET statement).

Previous PageTable Of ContentsNext Page