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!
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
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.