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!

SAS INNOVATE 2024

Innovate_SAS_Blue.png

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. 

Register now!

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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