I am a beginner in SAS
I have a dataset with expected value in poission distribution.
The dataset like below
count
18
27
56
90
177
354
I try to generate random sample by the following code.
DATA a_1;
do i=1 to 100;
x=RAND('POISSON', 18);
output;
END;
drop i;
RUN;
The '18' is from the dataset, I want to continue to use value '27','56',....each value do 100 times
Finally, I hope my data like
count | 18 | 27 | 56 | ... | 354 |
1 | 25 | 26 | 49 | 335 | |
2 | 12 | 19 | 60 | 327 | |
3 | 15 | 20 | 51 | 367 | |
4 | 16 | 22 | 53 | 353 | |
... | |||||
100 | 22 | 19 | 48 | 347 |
How can I finish this process?
Thanks in advance
data counts;
input count;
cards;
18
27
56
;
data want;
set counts;
do i=1 to 100;
x=rand('poisson', count);
output;
end;
run;
data counts;
input count;
cards;
18
27
56
;
data want;
set counts;
do i=1 to 100;
x=rand('poisson', count);
output;
end;
run;
Thanks a lot!
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.