Weight the Results II

You can also use the WEIGHT= option to apply weights specifically to individual variables. You do this by applying weights to individual variables with multiple VAR statements.
This means that you can produce tables where different weights are used for different variables, or one variable is weighted and another is not. Or, by making a copy of your analysis variable, you can show that variable both weighted and unweighted in the same table. The following code shows how to do this:
PROC TABULATE DATA=TEMPWT;
   CLASS OCCUP GENDER;
   VAR INCOME;
   VAR INCOME2 / WEIGHT=THEWT;
   TABLE (INCOME='Unweighted' INCOME2='Weighted')*
      OCCUP=' '*MEAN=' '*F=DOLLAR10., GENDER=' ' ALL
      /BOX='Mean Income' ROW=FLOAT;
RUN;
Variable INCOME2 is just ...

Get PROC TABULATE by Example, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.