How do you convert data scores that are normally out of 30 to out of 100 on SAS and how to round them to a 2 decimal space.
@olivia123456 wrote:
How do you convert data scores that are normally out of 30 to out of 100 on SAS
Do you mean you have scores 0 to 30 and you want them to be 0 to 100?
If so, you can multiply each score on the 0 to 30 scale by 100/30
and how to round them to a 2 decimal space.
Use the ROUND function
I am personally confused on the round function because I don't understand what to put in the parenthesis for round(x, #).
Yes two decimal space
I need to change the scale as in if I had a score of 19/30 and all my other numbers are out of 30, is there a SAS function for SAS to translate them all out of 100 such as 15/30 to 50/100?
/* algebra:
15/30 = X/100
(15/30)*100 = (X/100)*100
(15/30)*100 = X
*/
data want;
do score=0 to 30;
result30=score/30;
result100=(result30)*100;
result100rnd0=round(result100,1);
result100rnd1=round(result100,.1);
result100rnd2=round(result100,.01); * <<< this is probably what you want? ;
result100rnd3=round(result100,.001);
output;
end;
run;
is there a SAS function for SAS to translate them all out of 100 such as 15/30 to 50/100?
No. Nor is there one to translate them all from 23 to 105, 42 to 132, 13 to 48, etc. But the math is relatively simple.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.