<?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: Estimate risk differences with clustered data in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Estimate-risk-differences-with-clustered-data/m-p/872397#M43146</link>
    <description>&lt;P&gt;I have to assume that when you say "exposure" you mean RS_pctNOHS. If that is the case and that variable has continuous values, then you can't get a "risk difference" since a difference implies a comparison of two levels, not a continuous range. The variable in the LSMEANS statement should be a categorical variable specified in the CLASS statement. That is what the message you are seeing means. Additionally, the ODS OUTPUT statement will fail unless you include the E option as shown in the note I referred to.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And, sorry, but for the code you showed using a count response, you should use DIST=POISSON. But it would actually make more sense to specify "&lt;SPAN&gt;model deaths/n = RS_pctNOHS/ dist=bin;" , where n is your variable of denominator counts (NOT logged). This models the proportions as binomial.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 26 Apr 2023 21:31:46 GMT</pubDate>
    <dc:creator>StatDave</dc:creator>
    <dc:date>2023-04-26T21:31:46Z</dc:date>
    <item>
      <title>Estimate risk differences with clustered data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimate-risk-differences-with-clustered-data/m-p/872379#M43143</link>
      <description>&lt;P&gt;I am trying to estimate a risk difference using GEE (proc genmod). The outcome is clustered count data modeled as a rate (deaths over births), so Poisson distribution is preferred but I can only seem to get this to work with the normal distribution.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's what works:&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc genmod data= a.pmss;&lt;BR /&gt;class geoid1;&lt;BR /&gt;model prmr= RS_pctNOHS/ link=identity dist=normal;&lt;BR /&gt;repeated subject=geoid1;&lt;BR /&gt;weight births;&lt;BR /&gt;run;&lt;BR /&gt;*RD: 1.6358 1.1015 to 2.1701&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea for code to get a similar output but based on the Poisson or Binomial? So far nothing will converge.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 20:47:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimate-risk-differences-with-clustered-data/m-p/872379#M43143</guid>
      <dc:creator>EpiMoby</dc:creator>
      <dc:date>2023-04-26T20:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: Estimate risk differences with clustered data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimate-risk-differences-with-clustered-data/m-p/872388#M43144</link>
      <description>&lt;P&gt;If the response data are counts or proportions, then the response is not normally distributed. Use the NLMeans macro as shown in &lt;A href="http://support.sas.com/kb/37228" target="_self"&gt;this note&lt;/A&gt;. It works the same way with a procedure like GENMOD, but you should use the newer PROC GEE to fit GEE models. It has essentially the same syntax as PROC GENMOD. When fitting the GEE model, specify the variable containing the counts in the numerator of your risks as the response variable, and then specify a variable containing the log of the counts in the denominator of your risks in the OFFSET= option. Specify DIST=BIN. Then use LSMEANS, STORE, and ODS OUTPUT statements as shown followed by the NLMeans macro call.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 20:59:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimate-risk-differences-with-clustered-data/m-p/872388#M43144</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2023-04-26T20:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: Estimate risk differences with clustered data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimate-risk-differences-with-clustered-data/m-p/872393#M43145</link>
      <description>&lt;P&gt;Thank you - I have tried that but can't get the code right. The exposure is the percent of people in the county without a high school education (this shouldn't be in the class statement but SAS is telling me the exposure needs to be). Further assistance is greatly appreciated!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc gee data= dataset;&lt;BR /&gt;class geoid1;&lt;BR /&gt;model deaths= RS_pctNOHS/ dist=bin offset=ln_n;&lt;BR /&gt;repeated subject=geoid1;&lt;BR /&gt;lsmeans deaths / diff cl;&lt;BR /&gt;store out = diffmodel;&lt;BR /&gt;ods output coef=coeffs;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%NLMeans(instore=diffmodel, coef=Coeffs, title=Differences of Means)&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 21:16:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimate-risk-differences-with-clustered-data/m-p/872393#M43145</guid>
      <dc:creator>EpiMoby</dc:creator>
      <dc:date>2023-04-26T21:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: Estimate risk differences with clustered data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimate-risk-differences-with-clustered-data/m-p/872397#M43146</link>
      <description>&lt;P&gt;I have to assume that when you say "exposure" you mean RS_pctNOHS. If that is the case and that variable has continuous values, then you can't get a "risk difference" since a difference implies a comparison of two levels, not a continuous range. The variable in the LSMEANS statement should be a categorical variable specified in the CLASS statement. That is what the message you are seeing means. Additionally, the ODS OUTPUT statement will fail unless you include the E option as shown in the note I referred to.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And, sorry, but for the code you showed using a count response, you should use DIST=POISSON. But it would actually make more sense to specify "&lt;SPAN&gt;model deaths/n = RS_pctNOHS/ dist=bin;" , where n is your variable of denominator counts (NOT logged). This models the proportions as binomial.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 21:31:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimate-risk-differences-with-clustered-data/m-p/872397#M43146</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2023-04-26T21:31:46Z</dc:date>
    </item>
    <item>
      <title>Re: Estimate risk differences with clustered data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimate-risk-differences-with-clustered-data/m-p/872400#M43147</link>
      <description>&lt;P&gt;Yes - the exposure is&amp;nbsp;&lt;SPAN&gt;RS_pctNOHS, which you're right, it's&amp;nbsp;not a categorical variable. What I'm trying to estimate is the absolute difference in mortality between individuals living in counties with the median percent no high school compared to individuals living in counties 1 standard deviation above the median. The exposure has been robustly standardized to the median. I am able to do this with the initial code I posted that utilized the normal distribution but as you've mentioned Poisson&amp;nbsp;or binomial would be more appropriate,&amp;nbsp;so I am trying to figure it out.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 21:33:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimate-risk-differences-with-clustered-data/m-p/872400#M43147</guid>
      <dc:creator>EpiMoby</dc:creator>
      <dc:date>2023-04-26T21:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: Estimate risk differences with clustered data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimate-risk-differences-with-clustered-data/m-p/872403#M43148</link>
      <description>Then you would need to have a binary predictor variable that has just those two values and it would appear in the CLASS and LSMEANS statements. Which would presumably limit the data used considerably. The alternative would be to use a marginal effect for your continuous predictor, which would give you the change in risk for a unit change in the predictor. You could use the Margins macro for that (shown earlier in the note), or the MARGINS statement in PROC GENMOD if you have a recent release of Viya 4.</description>
      <pubDate>Wed, 26 Apr 2023 21:43:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimate-risk-differences-with-clustered-data/m-p/872403#M43148</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2023-04-26T21:43:12Z</dc:date>
    </item>
  </channel>
</rss>

