BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
pfvk
Fluorite | Level 6

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

 

count182756...354
1252649 335
2121960 327
3152051 367
4162253 353
...     
100221948 347

 

How can I  finish this process?
Thanks in advance

 

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26
data counts;
input count;
cards;
18
27
56
;

data want;
    set counts;
    do i=1 to 100;
      x=rand('poisson', count);
      output;
    end;
run;
--
Paige Miller

View solution in original post

2 REPLIES 2
PaigeMiller
Diamond | Level 26
data counts;
input count;
cards;
18
27
56
;

data want;
    set counts;
    do i=1 to 100;
      x=rand('poisson', count);
      output;
    end;
run;
--
Paige Miller
pfvk
Fluorite | Level 6

Thanks a lot!

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1156 views
  • 1 like
  • 2 in conversation