Identifiers can be used to copy information from one level of the file to another. The following SAS code (or equivalent) can be used to copy information from one level to another:
PROC SORT DATA=ISS14EP; *Person level file;
BY ABSHID;
RUN;
PROC SORT DATA=ISS14EH; *Household level file;
BY ABSHID;
RUN;
DATA MERGE_FILE;
MERGE ISS14EP (IN=A) ISS14EH (IN=B);
BY ABSHID;
IF A AND B THEN OUTPUT;
RUN;
The following SAS code (or equivalent) can be used to copy information from a higher level to a level below:
PROC SORT DATA=ISS14EP; *Person level file;
BY ABSHID;
RUN;
PROC SORT DATA=ISS14EB; *Barriers to services level file;
BY ABSHID;
RUN;
DATA MERGE_FILE;
MERGE ISS14EB (IN=A) ISS14EP (IN=B)
BY ABSHID;
IF A AND B THEN OUTPUT; *Only keeps records which are present on both files;
RUN;
This merge will match one ISS14EP record to many ISS14EB records. The statement 'If A and B then OUTPUT;' ensures that only records present on both files are kept. If this statement was not used then ISS14EP records without a corresponding ISS14EB record would appear with a missing value for all ISS14EB data items. Note that the data items copied from the ISS14EP level will now have the counting unit for the level they have been added to, being instances of Barriers to services in this case.
Combining data from different levels can sometimes be confusing, both in selecting an appropriate item and in understanding the counting unit. For example, if you are interested in Barriers to services, and you want to analyse this by characteristics such as sex or age, then you might cross-tabulate SEX by COUNTBAR (Types of selected services has most problems accessing). This would yield results indicating the estimate (or sample count) of instances of barriers experienced in each category, split by sex, rather than the estimate (or sample count) of males or females. When looking at the Barriers to services level, the counting unit is instances of barriers experienced, rather than persons.