Hi All,
The below table display ranking given by emp for different physical fitness test(like Exercise, Diet, Running etc.). with rank=1 as very low and 5 as very high.
I need to assign category and sub-category for the below table based on below condition.
e.g. "Fitness1" category will be assigned for variable Exercise, Diet, Running having two sub-categories Fit1, Fit2 for above variable.
Variable Category subcategory
Exercise Fitness1 Fit1
Diet Fitness1 Fit1
Running Fitness1 Fit2
jogging Fitness2 Fit1
playing Fitness2 Fit4
swimming Fitness3 Fit1
riding Fitness3 Fit1
dancing Fitness3 Fit1
sleeping Fitness3 Fit5
After that, I need to calculate the % of rank for each emp based on cat and subcat.
Kindly help me . The data are confusing
data employee;
input eid ename Exercise $ Diet $ Running $ jogging $ playing $ swimming $ riding $ dancing $ sleeping $;
cards;
102 Harish 3 1 1 1 1 3 1 5 1
104 Manu 1 2 1 5 1 3 3 1 2
102 Harish 3 1 2 1 1 3 1 1 1
103 Ram 1 2 2 5 1 3 3 1 1
103 Ram 2 1 1 1 1 3 1 4 1
101 Rakesh 1 2 1 1 1 1 1 1 5
101 Rakesh 1 1 1 4 1 1 1 1 1
106 Gopal 5 1 1 1 1 1 1 3 1
101 Rakesh 1 1 1 1 1 4 1 1 1
;
run;
Like the others, I also have no idea of the relationship between the table you present and the data you show.
My requirement is to calculate rank-wise percentage based on cat and subcat. How can I add those two variable into master table for below calculation.
-->Can we create three separate table and store respective category information and then merge it through Ename.
Category | subcategory | Percentage |
Fitness1 | Fit1 | x% |
Fit2 | x% | |
Fitness2 | Fit1 | x% |
Fit4 | x% | |
Fitness3 | Fit1 | x% |
Fit5 | x% |
To calculate percentages we need to know a numerator and a denominator.
Which is hard to tell from your want (NO NUMBERS which should be based on your example data) and better yet a description of exactly how anything is calculated.
Like the others, I also have no idea of the relationship between the table you present and the data you show.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.