turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Poisson Means Test

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

09-24-2015 09:48 AM

I want to compare the count of events between two years to see if they are statistically significantly different. Does SAS have anything similar to what's on this web site:

http://www.evanmiller.org/ab-testing/poisson-means.html#

Thanks,

Brian

Accepted Solutions

Solution

09-25-2015
06:23 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

09-24-2015 01:44 PM

All Replies

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

09-24-2015 10:28 AM

This can be easily done in PROC GENMOD. For example,

proc genmod;

class year;

model count = year / dist=poisson;

run;

The test you want is the test of the YEAR parameter.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

09-24-2015 10:45 AM

Dave,

Thanks for the quick reply!

So this is what I submitted:

**data** stents;

input c year;

datalines;

2216 2012

2533 2014

;

**proc** **genmod**;

class year;

model c = year / dist=poisson;

**run**;

and the results give me a Wald Chi-Square of 21.13 for year 2012 (P-value < 0.0001). Does this mean there is a significant difference between years? Also, should I be concerned that, in the Criteria for Assessing Goodness of Fit table, the Deviance, Scaled deviance, Pearson Chi-Square, and Scaled pearson X2 values are all 0?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

09-24-2015 11:28 AM

Yes, small p-values indicate significance. The zeros occur because this is a saturated model (all degrees of freedom used in the model) and is not a problem.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

09-24-2015 12:31 PM

Dave,

Thanks for enlightening me!

I was looking at this example here: http://support.sas.com/kb/37/344.html

Would it make sense for me to include Log(n) offset in Proc GenMod?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

09-24-2015 12:39 PM

For example:

**data** stents;

input Days Count year;

ln = log(Days);

ObsRate=Count/Days;

datalines;

365 2216 2012

365 2533 2014

;

**proc** **genmod** data=stents;

class year;

model Count=year / dist=poisson offset=ln;

estimate 'Year rate ratio' year **1** -**1**;

lsmeans year / diff exp cl;

store out=insmodel;

**run**;

Solution

09-25-2015
06:23 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

09-24-2015 01:44 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

09-24-2015 01:46 PM

Dave,

Yes, I noticed there was no difference in results. Thanks again for all your help!

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

09-24-2015 02:00 PM

Dave,

One more question: in the SAS example in the previous post they do an analysis of Rate Difference using Proc NLMixed. How is this different from what GenMod is doing?