Hello, I have a question regarding way to weight population for each individual.
I have used syntax below to have fractional rank but found out that I need to weight total population of every insur_level before doing the PROC RANK syntax.
I have created the sample data set to let you understand what I mean easier.
Could anybody help me 'weighting' the population?
PROC RANK DATA=SSTEMP OUT=TEMP;
VAR INSUR_LEVEL;
RANKS INSUR_RANK;
RUN;
PROC MEANS DATA=TEMP NOPRINT;
VAR INSUR_RANK;
OUTPUT OUT=INSUR_RANK_MAX MAX=INSUR_RANK_MAX;
RUN;
DATA TEMP2;
SET TEMP;
IF _N_=1 THEN SET INSUR_RANK_MAX;
INSUR_RANK_FRAC=INSUR_RANK/INSUR_RANK_MAX;
RUN;
Why are you doing this? The more ties you have at the top INSUR_LEVEL, the smaller will the the max_rank, and the larger will be the resulting INSUR_RANK_FRAC for all the other INSUR_LEVEL values.
Assume you have 100 observations and the top two values were 98 and 99. If those two values have nine observations at 98, and one at 99, you would get different results from one obs at 98 and nine at 99. In the earlier case (one obs at 99) you'd have max rank of 100. In the latter the max_rank would be 96. Is that ok?
I'm trying to calculate Concentration Index in Health equity and the reference I found above said that the sample must be weighted.
@Julie4 wrote:
I have a question regarding way to weight population for each individual.
Please explain this further ... What analysis is planned such that weighting is required, and why is it required?
I have created the sample data set to let you understand what I mean easier.
I don't understand any of this. Where does weighting fit in? Why do you need weighting? Weighted by what? What variable needs to be weighted? What is the analysis you are doing?
I am trying to calculate Health Concentration Index and I'm trying to weight the sample because the reference that I found said that the sample must be weighted.
Okay, thank you, but now explain the connection between the problem you posted and this text. What variable in your data set is the w in the text?
INSUR_LEVEL should be weighted(analytic weight) by POPULATION.
After that, I should compute fractional rank with the syntax that I wrote.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.