Hi guys, I'd like to calculate percentile based on z-score. My data is massive where using z-score-percentile conversion table is futile. Please help? Below is first few observation of my data. Thanks!!!!
data p.temp;
input zcore;
cards;
0.16
3.1
-0.33
1.72
;
You can use the PROBNORM function
You can use the PROBNORM function
Thanks a lot @PaigeMiller.
data temp1; set temp;
pctl=probnorm(zcore);
run;
zcore pctl
0.16 0.56
3.1 0.99
-0.33 0.37
1.7 0.96
Please correct me if I'm wrong. But it looks like it. I will double check with the conversion table as well.
Function PROBNORM() is too old ,Check CDF().
data temp;
input zcore;
p=cdf('normal',zcore);
cards;
0.16
3.1
-0.33
1.72
;
proc print;run;
Too old? What risk does this pose to the user? The function is still supported by SAS, and the probabilities of a normal distribution haven't changed.
It is better to explain by @Rick_SAS
Yes, there is a caveat regarding the "older" PROBXXX functions in Rick's Blog ("The DO Loop"). Just found it again: https://blogs.sas.com/content/iml/2013/07/10/stop-using-ranuni.html (at the bottom of the blog entry).
Thank you for the link, @FreelanceReinh. That's very interesting.
If I am understanding properly, the new functions will perform better when you have very small or very large values, but in the range of –10 to +10, I just wrote a program and PROBNORM(x) and CDF('normal',x) give the same answers (at least to 14 decimal places).
In any event, SAS ought to update the PROBNORM (and similar functions) documentation to specifically say that users ought to use the newer CDF function, and state the reasons.
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.