Yes!. Here is a brief explanation from online help.
The RANTBL function returns a variate that is generated from the probability mass function defined by p1 through pn . An inverse transform method applied to a RANUNI uniform variate is used.
A sample program attached below,
data t1;
seed=99612;
n=10000;
p1=0.7;p2=0.2;p3=0.1;
array a{3} _temporary_ (0,5,10) ;
do i = 1 to n;
x=a{rantbl(seed,of p1-p3)};
output;
end;
keep x;
run;
proc freq data=t1;
table x;
run;


雷达卡


京公网安备 11010802022788号







