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!
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.