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

What I'm trying to do is derive the probability of values on the basis of a Poisson function, but by variables in long form, such as would be the group by function in proc sql.  The data step has the pdf() function, which can return the Poisson probabilities, but has no group by function.  

 

I'm aware it's possible to do a 'group by' on operators using first. and last. in data step, but surely this wouldn't work for a function like pdf(). 

 

There may be procedures that can do this, but I'm unaware of what they are. 

 

Does anyone have any recommendations? 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
PDF() works on a row basis, uses only data on that row, not on a column basis so it may not be doing what you want anyways.

Do you have it working for one group? How to generate your poisson probability that's been tested?

If the pdf() function does work, then you can use it in the data step without the group by.

Providing some example data may help.

View solution in original post

1 REPLY 1
Reeza
Super User
PDF() works on a row basis, uses only data on that row, not on a column basis so it may not be doing what you want anyways.

Do you have it working for one group? How to generate your poisson probability that's been tested?

If the pdf() function does work, then you can use it in the data step without the group by.

Providing some example data may help.

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

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 1 reply
  • 642 views
  • 0 likes
  • 2 in conversation