<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Adjusted incidence rates from Proc Genmod very different from unadjusted rates in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Adjusted-incidence-rates-from-Proc-Genmod-very-different-from/m-p/538694#M27066</link>
    <description>&lt;P&gt;Thank you! That does explain a lot and using the means rather than 0 values for the covariates brought the estimates of the means down. But even if I run the model without covariates, the estimates of the means are still about 1000 times greater than the crude incidence rate that I get when I do it by hand, which doesn't seem right. It makes me wonder if my proc sql code is wrong?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's the unadjusted model that still gives a huge mean estimates:&lt;/P&gt;
&lt;P&gt;proc genmod data=adjtable1;&lt;BR /&gt;class yearofEvent&amp;nbsp; ;&lt;BR /&gt;model sumEvent= yearofEvent&amp;nbsp; /dist=poisson link=log offset=ln;&lt;BR /&gt;lsmeans yearofEvent&amp;nbsp; / cl e ilink ;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you again, I really appreciate it!&lt;/P&gt;</description>
    <pubDate>Tue, 26 Feb 2019 16:28:39 GMT</pubDate>
    <dc:creator>Lefty</dc:creator>
    <dc:date>2019-02-26T16:28:39Z</dc:date>
    <item>
      <title>Adjusted incidence rates from Proc Genmod very different from unadjusted rates</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Adjusted-incidence-rates-from-Proc-Genmod-very-different-from/m-p/538562#M27058</link>
      <description>&lt;P&gt;Hi, I'm having trouble calculating adjusted incidence rates per year using proc genmod (SAS version 9.4).&amp;nbsp;The issue is, the results from the Estimate statements from my adjusted model are completely different (like, 5 decimal places larger) than the unadjusted incidence ratios that I get when I make the calculations by hand and I assume I'm adjusting incorrectly.&lt;/P&gt;
&lt;P&gt;Here is a sample of my data:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="branch"&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" style="height: 209px; width: 790px;" summary="Procedure Print: Data Set WORK.IMPUTED" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TD width="35" style="width: 51px;"&gt;
&lt;P&gt;&lt;STRONG&gt;Obs&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="26" style="width: 51px;"&gt;
&lt;P&gt;&lt;STRONG&gt;ID&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="46" style="width: 57px;"&gt;
&lt;P&gt;&lt;STRONG&gt;Event&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="77" style="width: 88px;"&gt;
&lt;P&gt;&lt;STRONG&gt;yrstoEvent&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;&lt;STRONG&gt;covar1&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;&lt;STRONG&gt;covar2&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;&lt;STRONG&gt;covar3&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;&lt;STRONG&gt;covar4&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;&lt;STRONG&gt;covar5&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;&lt;STRONG&gt;Covar6&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="81" style="width: 92px;"&gt;
&lt;P&gt;&lt;STRONG&gt;yearofevent&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TH class="r header" style="height: 19px; width: 79px;" scope="col"&gt;&amp;nbsp;&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="35" style="width: 51px;"&gt;
&lt;P&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="26" style="width: 51px;"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="46" style="width: 57px;"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="77" style="width: 88px;"&gt;
&lt;P&gt;0.01644&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="81" style="width: 92px;"&gt;
&lt;P&gt;2014&lt;/P&gt;
&lt;/TD&gt;
&lt;TD class="r data" style="height: 19px; width: 79px;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="35" style="width: 51px;"&gt;
&lt;P&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="26" style="width: 51px;"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="46" style="width: 57px;"&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="77" style="width: 88px;"&gt;
&lt;P&gt;1.36712&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="81" style="width: 92px;"&gt;
&lt;P&gt;2015&lt;/P&gt;
&lt;/TD&gt;
&lt;TD class="r data" style="height: 19px; width: 79px;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="35" style="width: 51px;"&gt;
&lt;P&gt;&lt;STRONG&gt;3&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="26" style="width: 51px;"&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="46" style="width: 57px;"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="77" style="width: 88px;"&gt;
&lt;P&gt;0.44932&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="81" style="width: 92px;"&gt;
&lt;P&gt;2016&lt;/P&gt;
&lt;/TD&gt;
&lt;TD class="r data" style="height: 19px; width: 79px;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="35" style="width: 51px;"&gt;
&lt;P&gt;&lt;STRONG&gt;4&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="26" style="width: 51px;"&gt;
&lt;P&gt;4&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="46" style="width: 57px;"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="77" style="width: 88px;"&gt;
&lt;P&gt;0.04658&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="81" style="width: 92px;"&gt;
&lt;P&gt;2015&lt;/P&gt;
&lt;/TD&gt;
&lt;TD class="r data" style="height: 19px; width: 79px;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="35" style="width: 51px;"&gt;
&lt;P&gt;&lt;STRONG&gt;5&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="26" style="width: 51px;"&gt;
&lt;P&gt;5&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="46" style="width: 57px;"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="77" style="width: 88px;"&gt;
&lt;P&gt;0.33425&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="81" style="width: 92px;"&gt;
&lt;P&gt;2012&lt;/P&gt;
&lt;/TD&gt;
&lt;TD class="r data" style="height: 19px; width: 79px;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="35" style="width: 51px;"&gt;
&lt;P&gt;&lt;STRONG&gt;6&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="26" style="width: 51px;"&gt;
&lt;P&gt;6&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="46" style="width: 57px;"&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="77" style="width: 88px;"&gt;
&lt;P&gt;2.57534&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="81" style="width: 92px;"&gt;
&lt;P&gt;2012&lt;/P&gt;
&lt;/TD&gt;
&lt;TD class="r data" style="height: 19px; width: 79px;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="35" style="width: 51px;"&gt;
&lt;P&gt;&lt;STRONG&gt;7&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="26" style="width: 51px;"&gt;
&lt;P&gt;7&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="46" style="width: 57px;"&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="77" style="width: 88px;"&gt;
&lt;P&gt;2.95068&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="81" style="width: 92px;"&gt;
&lt;P&gt;2011&lt;/P&gt;
&lt;/TD&gt;
&lt;TD class="r data" style="height: 19px; width: 79px;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="35" style="width: 51px;"&gt;
&lt;P&gt;&lt;STRONG&gt;8&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="26" style="width: 51px;"&gt;
&lt;P&gt;8&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="46" style="width: 57px;"&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="77" style="width: 88px;"&gt;
&lt;P&gt;0.16986&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="81" style="width: 92px;"&gt;
&lt;P&gt;2014&lt;/P&gt;
&lt;/TD&gt;
&lt;TD class="r data" style="height: 19px; width: 79px;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="35" style="width: 51px;"&gt;
&lt;P&gt;&lt;STRONG&gt;9&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="26" style="width: 51px;"&gt;
&lt;P&gt;9&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="46" style="width: 57px;"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="77" style="width: 88px;"&gt;
&lt;P&gt;0.03836&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="81" style="width: 92px;"&gt;
&lt;P&gt;2011&lt;/P&gt;
&lt;/TD&gt;
&lt;TD class="r data" style="height: 19px; width: 79px;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="35" style="width: 51px;"&gt;
&lt;P&gt;&lt;STRONG&gt;10&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="26" style="width: 51px;"&gt;
&lt;P&gt;10&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="46" style="width: 57px;"&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="77" style="width: 88px;"&gt;
&lt;P&gt;0.18904&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="51" style="width: 62px;"&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="width: 92px;"&gt;
&lt;P&gt;2014&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="width: 79px;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;I first used proc sql to calculate the number of events and amount of person-time for each strata of the covariates, using this code:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table adjtable&lt;BR /&gt;as&lt;BR /&gt;select sum(Event) as sumEvent,count(unique id) as totalpts,sum(yrstoEvent)as sumofyears,&lt;BR /&gt;calculated sumofyears * calculated totalpts as personyears,&lt;BR /&gt;covar1, covar2, covar3, covar4, covar5, covar6, yearofevent from have group by covar1, covar2, covar3, covar4, covar5, covar6, yearofevent;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Next, I calculated the offset variable:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;data adjtable1;&lt;BR /&gt;set adjtable;&lt;BR /&gt;ln=log(personyears);run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally, I ran this code to calculate the adjusted incidence per year of event:&lt;BR /&gt;proc genmod data=adjtable1;&lt;BR /&gt;class yearofEvent covar1 covar2&amp;nbsp;covar3 covar4 covar5 covar6 ;&lt;BR /&gt;model sumEvent= yearofEvent covar1 covar2&amp;nbsp;covar3 covar4 covar5 covar6 /dist=poisson offset=ln;&lt;BR /&gt;estimate "2010" intercept 1 yearofEvent 1 0 0 0 0 0 0;&lt;BR /&gt;estimate "2011" intercept 1 yearofEvent 0 1 0 0 0 0 0;&lt;BR /&gt;estimate "2012" intercept 1 yearofEvent 0 0 1 0 0 0 0;&lt;BR /&gt;estimate "2013" intercept 1 yearofEvent 0 0 0 1 0 0 0;&lt;BR /&gt;estimate "2014" intercept 1 yearofEvent 0 0 0 0 1 0 0;&lt;BR /&gt;estimate "2015" intercept 1 yearofEvent 0 0 0 0 0 1 0;&lt;BR /&gt;estimate "2016" intercept 1 yearofEvent 0 0 0 0 0 0 1;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is this code the correct way to obtain adjusted incidence rates?&lt;/P&gt;
&lt;P&gt;Any help is greatly appreciated!&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 26 Feb 2019 05:49:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Adjusted-incidence-rates-from-Proc-Genmod-very-different-from/m-p/538562#M27058</guid>
      <dc:creator>Lefty</dc:creator>
      <dc:date>2019-02-26T05:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: Adjusted incidence rates from Proc Genmod very different from unadjusted rates</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Adjusted-incidence-rates-from-Proc-Genmod-very-different-from/m-p/538645#M27064</link>
      <description>&lt;P&gt;Probably because the values you are getting have all of the covariates set at zero which is probably not what you want. Add the E option in your ESTIMATE statements to see the linear combination of model parameters that was used. Because of this extremely common problem of setting reasonable contrast coefficients, you should avoid using the ESTIMATE (or CONTRAST) statement and use instead the LSMEANS (or SLICE or LSMESTIMATE) statement whenever possible. Regardless of the statement you use, it is advisable to include the E option so that you can see exactly what you are estimating.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See &lt;A href="http://support.sas.com/kb/24188" target="_self"&gt;this note&lt;/A&gt; that discusses and illustrates using the LSMEANS statement to estimate rates. Using the example there, the following shows that the ESTIMATE statement sets the covariate coefficient to zero, while the LSMEANS statement uses the mean of the covariate (2):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;      proc genmod data=insure;
         class age;
         model c = carnum age / dist=poisson link=log offset=ln;
         estimate "Rate: age=1, small" intercept 1 age 1 0 / e;
         lsmeans age / ilink e;
         run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 15:25:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Adjusted-incidence-rates-from-Proc-Genmod-very-different-from/m-p/538645#M27064</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2019-02-26T15:25:33Z</dc:date>
    </item>
    <item>
      <title>Re: Adjusted incidence rates from Proc Genmod very different from unadjusted rates</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Adjusted-incidence-rates-from-Proc-Genmod-very-different-from/m-p/538694#M27066</link>
      <description>&lt;P&gt;Thank you! That does explain a lot and using the means rather than 0 values for the covariates brought the estimates of the means down. But even if I run the model without covariates, the estimates of the means are still about 1000 times greater than the crude incidence rate that I get when I do it by hand, which doesn't seem right. It makes me wonder if my proc sql code is wrong?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's the unadjusted model that still gives a huge mean estimates:&lt;/P&gt;
&lt;P&gt;proc genmod data=adjtable1;&lt;BR /&gt;class yearofEvent&amp;nbsp; ;&lt;BR /&gt;model sumEvent= yearofEvent&amp;nbsp; /dist=poisson link=log offset=ln;&lt;BR /&gt;lsmeans yearofEvent&amp;nbsp; / cl e ilink ;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you again, I really appreciate it!&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 16:28:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Adjusted-incidence-rates-from-Proc-Genmod-very-different-from/m-p/538694#M27066</guid>
      <dc:creator>Lefty</dc:creator>
      <dc:date>2019-02-26T16:28:39Z</dc:date>
    </item>
    <item>
      <title>Re: Adjusted incidence rates from Proc Genmod very different from unadjusted rates</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Adjusted-incidence-rates-from-Proc-Genmod-very-different-from/m-p/538755#M27068</link>
      <description>&lt;P&gt;Without knowing much about your data, I would think the person-time would just be the sum of your YRSTOEVENT variable.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 19:01:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Adjusted-incidence-rates-from-Proc-Genmod-very-different-from/m-p/538755#M27068</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2019-02-26T19:01:31Z</dc:date>
    </item>
    <item>
      <title>Re: Adjusted incidence rates from Proc Genmod very different from unadjusted rates</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Adjusted-incidence-rates-from-Proc-Genmod-very-different-from/m-p/538814#M27070</link>
      <description>&lt;P&gt;Thank you! The combination of using LSMEANS instead of estimate statements and the sum of the yearstoevent variable gave me answers much more in line with the crude incidence rates! I really appreciate it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 21:16:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Adjusted-incidence-rates-from-Proc-Genmod-very-different-from/m-p/538814#M27070</guid>
      <dc:creator>Lefty</dc:creator>
      <dc:date>2019-02-26T21:16:15Z</dc:date>
    </item>
  </channel>
</rss>

