<?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 Adjusted rate from a GEE model in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Adjusted-rate-from-a-GEE-model/m-p/971564#M48822</link>
    <description>&lt;P&gt;Hi, I am trying to obtain adjusted rate with 95% CI from a Poisson model for each cluster in the dataset. Please see the attached dataset. I am fitting the following GEE model. I am also happy to consider a random effects model if that helps.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC GENMOD data=ForIndQ.sample_data;
  CLASS x1 cid;
  MODEL y=x1-x4 /d=poisson link=log offset=log_offset;
  REPEATED subject=cid/ type=exch;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Here CID is the cluster id and I want to get the adjusted rates from the model with 95% CI for each of the CID.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Jul 2025 13:24:12 GMT</pubDate>
    <dc:creator>BayzidurRahman</dc:creator>
    <dc:date>2025-07-28T13:24:12Z</dc:date>
    <item>
      <title>Adjusted rate from a GEE model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Adjusted-rate-from-a-GEE-model/m-p/971564#M48822</link>
      <description>&lt;P&gt;Hi, I am trying to obtain adjusted rate with 95% CI from a Poisson model for each cluster in the dataset. Please see the attached dataset. I am fitting the following GEE model. I am also happy to consider a random effects model if that helps.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC GENMOD data=ForIndQ.sample_data;
  CLASS x1 cid;
  MODEL y=x1-x4 /d=poisson link=log offset=log_offset;
  REPEATED subject=cid/ type=exch;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Here CID is the cluster id and I want to get the adjusted rates from the model with 95% CI for each of the CID.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jul 2025 13:24:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Adjusted-rate-from-a-GEE-model/m-p/971564#M48822</guid>
      <dc:creator>BayzidurRahman</dc:creator>
      <dc:date>2025-07-28T13:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: Adjusted rate from a GEE model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Adjusted-rate-from-a-GEE-model/m-p/971599#M48823</link>
      <description>You could check %margin macro :&lt;BR /&gt;&lt;A href="https://support.sas.com/kb/63/038.html" target="_blank"&gt;https://support.sas.com/kb/63/038.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;EXAMPLE 4: Margins and marginal effects in a GEE model&lt;BR /&gt;&lt;BR /&gt;or %nlmeas macro:&lt;BR /&gt;&lt;A href="https://support.sas.com/kb/62/362.html" target="_blank"&gt;https://support.sas.com/kb/62/362.html&lt;/A&gt;</description>
      <pubDate>Tue, 29 Jul 2025 06:42:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Adjusted-rate-from-a-GEE-model/m-p/971599#M48823</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-07-29T06:42:56Z</dc:date>
    </item>
    <item>
      <title>Re: Adjusted rate from a GEE model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Adjusted-rate-from-a-GEE-model/m-p/971662#M48827</link>
      <description>&lt;P&gt;The easiest way to obtain an estimated rate for each CID is to simply average the predicted rates within each CID.&amp;nbsp; Using the SCORE statement in PROC PLM to obtain the predicted rates as described in &lt;A href="https://support.sas.com/kb/24/188.html" target="_self"&gt;this note&lt;/A&gt;, the following produces a data set of the average predicted rates for the CIDs:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC GENMOD data=sample_data;
  CLASS x1 cid;
  MODEL y=x1-x4 /d=poisson link=log offset=log_offset;
  REPEATED subject=cid/ type=exch;
  store out=mod;
  run;
proc plm source=mod;
  score data=sample_data out=pred pred stderr lclm uclm / nooffset ilink;
  run;
proc means data=pred; class cid; var predicted; run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This is essentially a predictive margin, which is an average predicted value, but averaged only over the predicted values in a CID. It might be slightly better to get the sum of the predicted counts, not rates, in a CID and then divide it by the sum of the offset values in the CID. You can use the P= option in the OUTPUT statement to get the predicted counts.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But the above only provides point estimates, not standard errors. To obtain predictive margin point estimates and standard errors and confidence intervals, you could use the &lt;A href="http://support.sas.com/kb/63038" target="_self"&gt;Margins macro&lt;/A&gt; including the WITHIN= option to identify a specify CID. For example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%margins(data=sample_data, class=x1 cid, response=y, 
     model=x1 x2 x3 x4, dist=poisson, offset=log_offset,
     geesubject=cid, geecorr=exch, within=cid='AC-1010',
     options=cl rate )
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;By itself, the macro only allows you to do this for one CID at a time, so you would need to run the macro for each CID. Or you could do them all in one shot by using the Margins macro with the &lt;A href="http://support.sas.com/kb/66249" target="_self"&gt;RunBY macro&lt;/A&gt; as described in the Margins macro documentation and shown in the last two examples in the Results tab there.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jul 2025 22:33:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Adjusted-rate-from-a-GEE-model/m-p/971662#M48827</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2025-07-29T22:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: Adjusted rate from a GEE model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Adjusted-rate-from-a-GEE-model/m-p/971664#M48830</link>
      <description>&lt;P&gt;Thanks for your support.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jul 2025 04:39:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Adjusted-rate-from-a-GEE-model/m-p/971664#M48830</guid>
      <dc:creator>BayzidurRahman</dc:creator>
      <dc:date>2025-07-30T04:39:54Z</dc:date>
    </item>
    <item>
      <title>Re: Adjusted rate from a GEE model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Adjusted-rate-from-a-GEE-model/m-p/971693#M48831</link>
      <description>&lt;P&gt;Is it possible to obtain directly standardized rates for each CID with 95% CI using the covariate structure of the whole dataset by doing some modification of your code?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jul 2025 13:04:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Adjusted-rate-from-a-GEE-model/m-p/971693#M48831</guid>
      <dc:creator>BayzidurRahman</dc:creator>
      <dc:date>2025-07-30T13:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: Adjusted rate from a GEE model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Adjusted-rate-from-a-GEE-model/m-p/971732#M48834</link>
      <description>&lt;P&gt;As mentioned in the note I referred you to in your direct standardization post, the directly standardized rate, DSR, is just a weighted crude rate, where the weight is the exposure proportion of the particular stratum in the reference population, P. Given that proportion, DSR=P*CR and stderr(DSR)=P*stderr(CR), where CR is the crude rate. This is easily computed by hand or you can use the &lt;A href="http://support.sas.com/kb/58775" target="_self"&gt;NLEST macro&lt;/A&gt; to do it for you after using the Margins macro call as I showed, but adding COVOUT in OPTIONS= in the Margins macro call. For example, replace P with its numerical value in the following and use it after the Margins macro call.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%nlest(inest=_margins, incovb=_covmarg, f=b_p1*P, label=direct stdzd rate)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Jul 2025 21:49:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Adjusted-rate-from-a-GEE-model/m-p/971732#M48834</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2025-07-30T21:49:03Z</dc:date>
    </item>
  </channel>
</rss>

