I have a table of frequencies that I'm feeding into a Proc Tabulate step. The data come with a weight variable, and I want to include the weighted results in the generated table. Whether I use the weight variable in the VAR or the WEIGHT option, it has no effect on the output table. I've also tried using the weight variable in the TABLE statements for the analysis variables, but again, no effect.
PROC FORMAT; PICTURE PCTF (ROUND) OTHER='009.9%'; RUN;
ODS HTML PATH="%SYSFUNC(GETOPTION(WORK) )" STYLE=JOURNAL1A;
PROC TABULATE DATA = CHSS2017_s1 f=10.2 S=[just=c cellwidth=75];
CLASS AGE SEX Q21;
CLASSLEV AGE / style=[font_weight=medium];
CLASSLEV SEX / style=[font_weight=medium];
CLASSLEV Q21;
WEIGHT REGIONWT ;
*VAR REGIONWT ;
TABLE ALL = 'Greater Cincinnati Residents' * (ROWPCTN=' '*f=PCTF.)
AGE = 'Age' * (ROWPCTN=' '*f=PCTF.)
SEX * (ROWPCTN=' '*f=PCTF.)
, Q21;
RUN;
The expected result should be a proc tabulate output with values that reflect the weight variable, 'REGIONWT'
FREQ
per @Quentin answer? Otherwise, create a new question if you are looking for a way to have a weighted N statistic. Be sure to show some sample data, your code and the output that you get and example of what you want. – Richard