这是SAS的方法
data a;
do i=1 to 200;
x=ranuni(0);
output;
end;
run;
proc univariate data=a noprint;
var x;
output out=b pctlpts=1 pctlpts=99 pctlpre=p_;
run;
data c;
set a;
if (_n_=1) then set b;
if x gt p_99 then y=p_99;
else if x lt p_1 then x=p_1;
else y=x;
run;