Previous PageNext Page

Possible problems: Missing observations
What if the data sets are sorted but some of the observations are not there?
Note: A "missing observation" is a row that is not in the data file. If an observation is in the data file, any (or all) of the variables can have missing values. Every observation has values in all its variables (a "missing value" is a value).

Proc Sort data=GenYear;
     BY Subj;
     WHERE Subj NE 5;
Proc Sort data=HtWt;
     BY Subj;
     WHERE Subj NE 8;
Data Survey12;
     Merge GenYear HtWt;
     BY Subj;
Proc Print;
     ID Subj;

There are 4 observations in each data set. No errors or warning messages appear in the log. The Proc Print output:

Like Example 4.2 in C&P Chapter 3

SUBJ    GENDER    YEAR    HEIGHT    WEIGHT

  1       M        91        68       155
  5                 .       102        63
  7       F        90        72       205
  8       M        91         .         .
  9       M        93        66       120

Previous PageTable Of ContentsNext Page