This macro uses a zip code lookup file and the demographic variables ZIP and ZIP_DATE to add additional geographic regions and compute a zip_uncertain variable.
More...
This macro uses a zip code lookup file and the demographic variables ZIP and ZIP_DATE to add additional geographic regions and compute a zip_uncertain variable.
- Merge patient level dataset with zip lookup file and compute:
- zip3 as the 1st 3 digits of zip
- state as the matching statecode
- hhs_reg and the matching hhs_region
- cb_reg as the matching cb_region
- When zip is missing or StateCode is missing, assign all four variables as Unknown
- When zip and statecode are populated but do not map to a HHS_region or CB_region, assign as Unknown respectively
- Create new variable zip_uncertain:
- When zip_date is missing or if the INDEXDTVAR variable is < zip_date then zip_uncertain is assigned as Y, otherwise assigned as N
- If INDEXDTVAR set to missing, zip_uncertain is not computed.
- Program inputs
- &DATA file. This is a patient level file that should contain at a minimum variables patid, zip, zip_date, and the variables assigned to INDEXDTVAR
- &ZIPLOOKUP lookup file. This file contains variables zip, statecode, hhs_reg, cb_reg
- Program outputs
-
Usage
%ms_geographicvars(data=,
ziplookup=,
indexdtvar=);
- Parameters
- Parameters
-
| [in] | DATA | patient level dataset with variables zip and zip_date |
| [in] | ZIPLOOKUP | zip code lookup file. Default is infolder.&zipfile |
| [in] | INDEXDTVAR | index date variable used to assign zip_uncertain. Default is indexdt. If not specified, then zip_uncertain is not computed |
SAS Macros Dependencies
None.
- Author
- Sentinel Coordinating Center (info@.nosp@m.sent.nosp@m.inels.nosp@m.yste.nosp@m.m.org)