data RandClass(drop=i);
call streaminit(1234);
set sashelp.cars(keep= Cylinders Horsepower EngineSize);
array x {*} _numeric_;
do i = 1 to dim(x);
if rand("Bern", 0.1) then
x[i]=.; /* p=0.4 ==> about 40% missing */
end;
run;
Hello everyone, this is my code to delete values from columns randomly. It is working completely fine.
In the code 0.1 decides the percentage to delete. if i write there 0.2 it will delete 20% of the values and so on. I want to run a loop there that it will select values from 0.1 to 0.4 by 0.05. so total it should do 7 times. and I want to store all this 7 databases for future use. can anyone help me to do it ?