Programming the statistical procedures from SAS

Count Data

Reply
Highlighted
Occasional Contributor
Posts: 6

Count Data

Please I need suggestions on how to simulate count data from a Poisson distribution and fit (using PROC GLIMMIX) Normal, lognormal and negbin to the resulting data.Thank you

Super User
Posts: 23,776
Occasional Contributor
Posts: 6

Re: Count Data

Thank you for your swift response.

SAS Employee
Posts: 386

Re: Count Data

Use the RAND('POISSON', mean) function in the DATA step to generate Poisson distributed data. Just set the desired value of the Poisson mean to produce a set of values. For example, these statements produce 100 observations in which Y has Poisson distributed values with mean=2.

 

data s;
do i=1 to 100;
y=rand("poisson",2);
output;
end;
run;
PROC Star
Posts: 1,283

Re: Count Data

Are you sure PROC GLIMMIX is the right tool for fitting this data?

Occasional Contributor
Posts: 6

Re: Count Data

I am not completely sure. I was looking at the example in this link: https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_glimmix_sec...

Super User
Posts: 23,776

Re: Count Data

What are you trying to do overall? Why the need to simulate data?

 


@vdfdd wrote:

I am not completely sure. I was looking at the example in this link: https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_glimmix_sec...


 

Occasional Contributor
Posts: 6

Re: Count Data

To test which distribution best fit the (non-normal, discrete) data
Super User
Posts: 23,776

Re: Count Data

PROC UNIVARIATE can test this with histogram statements. 

Occasional Contributor
Posts: 6

Re: Count Data

Thank you for your suggestion.

Super User
Posts: 10,787

Re: Count Data

You could find answer at  @Rick_SAS  blog.

http://blogs.sas.com/content/iml/

Ask a Question
Discussion stats
  • 10 replies
  • 129 views
  • 0 likes
  • 5 in conversation