Thanks Rick for your hint. Here is my code. %let NumGuesses = 10; data method_3; set death; z=count/5; L=int(z); if mod(count, 5) ne 0 then do; do i = 1 to &NumGuesses; if mod(count, 5)=1 then x = L + RAND('BERNoulli',0.8); if mod(count, 5)=2 then x = L + RAND('BERNoulli',0.6); if mod(count, 5)=3 then x = L + RAND('BERNoulli',0.4); if mod(count, 5)=4 then x = L + RAND('BERNoulli',0.2); y=5*x; output; end; end; if mod(count, 5)= 0 then do; y=count; output; end; run; Any suggestions? Thank you very much!
... View more