Hi everyone,
I plan to compare prevalence between two surveys and face problem of how to use two weights.
1. The first survey (study polulation): is a large national survey, has its own unchangeable complicated sampling weight. I need to use this weight when analyzing data.
2. The second survey (standard population): age and sex distribution of this survey is used for direct standardization of the first survey. I created a weight for this direct standardization.
Can you advise me how to deal with situation?
I am afraid that I can not combine these two weights into one, and also don't want to do direct standardization manually.
Thank you very much.
Tran
Would it not be the case where you multiply the two weights together? Or is some other function of the two weights desired?
What do you mean by "I am afraid that I can not combine these two weights into one".
Thank you for your response. The weight from the first survey is very complicated and created by that national survey. I don't know in details how it was created, but only have its code. I try to multiply these two weights but it did not work.
Is there anyway that I can use these two weights?
Thank you
Please give more detailed explanations, and explain what you did.
I try to multiply these two weights but it did not work.
Do you mean that when you tried to multiply these weights in SAS you couldn't get SAS to do it? Or were you able to get SAS to do it and the results were wrong? If the results were wrong, what was wrong about them? Do the wrong results imply that multiplying the weights together should be replaced by some other math?
Can you show us what you tried? Can you explain what went wrong?
SAS failed to multiply the two weights. WTS_M is the first survey weight, weightas is the weight I created.
proc freq data=cch2;
226 tables MED_050*agecat/norow;
227 weight WTS_M*weightas;
-
22
200
ERROR 22-322: Syntax error, expecting one of the following: ;, /.
ERROR 200-322: The symbol is not recognized and will be ignored.
228 run;
Thank you
I tried to multiply the two weight before runing proc freq and it worked.
I will double check it the result is correct.
Thank you.
You might check this as a guideline:
https://www.cdc.gov/brfss/annual_data/2016/pdf/2016_DirAgeAdjDUsrsGde.pdf
You don't say which survey but this is a large national survey with complex sample and weighting. You will have to spend some time tracing variables back and forth to align with yours but this does use SAS code for the purpose of age adjusting.
Extension to age and sex combined would be routine and tedious matching up "age and sex" everywhere the document and code uses "age".
Thank you very much
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.