BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
InfoAlisaA
Calcite | Level 5

Hello Everyone,

I am working on a Poisson Random Number Generator, and I had a question about it.

I know this may sound like a bit of a silly question, but I am wondering what does it output exactly?

Here is my code:

data test2;

  array p p1c1-p1c50;

  do i = 1 to 1000;

  do j=1 to 50 ;

  p=ranpoi(0,3);

  end;

  output;

  end;

  run;

proc print data=test2;

run;

So for my sanity, what this is outputting is the possible values that x can take with a lambda of 3.

Am I right in my thinking?

I just want to make sure because I had a bit of an embarrassing moment with my professor when he questioned me and asked me if I was sure about what this is outputting exactly.

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

RanPoi(seed, m) returns pseudo random non-negative integers following a Poisson distribution with mean value = m. The Poisson distribution has the property that the variance is equal to the mean. The values that can be returned are thus 0, 1, 2, ...

PG

PG

View solution in original post

3 REPLIES 3
PGStats
Opal | Level 21

RanPoi(seed, m) returns pseudo random non-negative integers following a Poisson distribution with mean value = m. The Poisson distribution has the property that the variance is equal to the mean. The values that can be returned are thus 0, 1, 2, ...

PG

PG
InfoAlisaA
Calcite | Level 5

Thanks for your help! Smiley Happy I appreciate it!

Rick_SAS
SAS Super FREQ

And you can interpret it as the number of events that occur during a given time period if you know that the AVERAGE rate of the event is m events per time period (m does not need to be an integer). So, for example, if you receive an average of 6.3 emails per hour, and you start keeping count, you might observe 5 emails during the first hour, 8 during the next hour, 5 during the next hour, and so forth.   For a data-oriented tale of how the Poisson dstribution is used, see Fitting a Poisson distribution to data in SAS - The DO Loop

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1530 views
  • 1 like
  • 3 in conversation