Team, I tri to use the formula for calculating:
G = QUANTILE('NORMAL', pd). pd has different values, also of 1.
Unfortunately, the log gives me the next error
Does this mean that the function can not provide inverse cumulative distribution function of a real number?
Stepik
Solved taking pd=1 separately
Your argument of QUANTILE() is not right .
since it is a P value, it should be (0,1).
data have;
input pd;
cards;
.1
.2
.3
.4
;
data _null_;
set have;
G = QUANTILE('NORMAL', pd);
put G= pd=;
run;
38 ; 39 40 41 data _null_; 42 set have; 43 G = QUANTILE('NORMAL', pd); 44 put G= pd=; 45 run; G=-1.281551566 pd=0.1 G=-0.841621234 pd=0.2 G=-0.524400513 pd=0.3 G=-0.253347103 pd=0.4 NOTE: 从数据集 WORK.HAVE. 读取了 4 个观测 NOTE: “DATA 语句”所用时间(总处理时间): 实际时间 0.01 秒 CPU 时间 0.00 秒
Solved taking pd=1 separately
Sorry. I have to leave now. I will take a look tomorrow.
But maybe @Rick_SAS could give you a hand. He is good at this.
Hello @Stepik,
I think you just need to handle the cases pd=0 and pd=1 separately in the calculation of G and N:
if pd in (0 1) then N=pd; else do; G = QUANTILE('NORMAL', pd); N = CDF('NORMAL', G/SQRT(1-R)+SQRT(R/(1-R))*QUANTILE('NORMAL',0.999)); end;
Alternatively, since N=pd implies RWA1=0, you can also put the entire block of your assignment statements into the ELSE branch:
if pd in (0 1) then RWA1=0; else do; ... your code ... end;
(before the RETURN statement).
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.