/********************************************************************\
PROGRAM: C:\MEPS\PROG\EXAMPLE01.SAS
DESCRIPTION: THIS EXAMPLE SHOWS THE NEED FOR USING WEIGHT
VARIABLES WHEN ANALYZING MEPS DATA FOR
NATIONAL ESTIMATES.
NOTE THAT THE POPULATION CHARACTERISTICS FILE RELEASED IN
MAY OF EACH YEAR HAS A PRELIMINARY VERSION OF THE
PERSON-LEVL WEIGHT VARIABLE (PERWT03P ON THE 2003 FILE,
HC-073).
INPUT FILE: C:\MEPS\DATA\H79.SAS7BDAT (2003 FULL-YEAR DATA FILE)
\********************************************************************/
FOOTNOTE 'PROGRAM: C:\MEPS\PROG\EXAMPLE01.SAS';
LIBNAME CDATA V8 'C:\MEPS\DATA';
TITLE1 'AHRQ MEPS DATA USERS WORKSHOP -- JULY 2006';
TITLE2 'EFFECT OF WEIGHT VARIABLE ON RACE/ETHNICITY PERCENTAGE';
PROC FORMAT;
VALUE RACETHNB
0='TOTAL'
1 = 'HISPANIC'
2 = 'BLACK-NO OTH RACE/NOT HISPANIC'
3 = 'ASIAN-NO OTH RACE/NOT HISPANIC'
4 = 'OTHER/NOT HISPANIC';
RUN;
/***** MODIFY RACE/ETHNICITY CATEGORIES *****/
DATA PUF79 ;
SET CDATA.H79 (KEEP= RACETHNX PERWT03F);
RUN;
PROC FREQ DATA=PUF79 NOPRINT;
TABLE RACETHNX/ OUT=UNWT(KEEP=RACETHNX PERCENT);
FORMAT RACETHNX RACETHNB.;
RUN;
PROC FREQ DATA=PUF79 NOPRINT;
TABLE RACETHNX/ OUT=WT(KEEP=RACETHNX PERCENT);
FORMAT RACETHNX RACETHNB.;
WEIGHT PERWT03F;
RUN;
DATA PCT;
MERGE UNWT WT(RENAME=(PERCENT=WTPCT));
BY RACETHNX;
FORMAT PERCENT WTPCT 5.2;
LABEL PERCENT='UNWEIGHTED PERCENTAGE'
WTPCT='WEIGHTED PERCENTAGE';
RUN;
PROC PRINT DATA=PCT NOOBS LABEL;
VAR RACETHNX PERCENT WTPCT;
RUN;