<?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 proc glimmix for count data model fit assessment in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/proc-glimmix-for-count-data-model-fit-assessment/m-p/838414#M41513</link>
    <description>&lt;P&gt;I'm conducting a difference-in-difference analysis to assess the impact of an intervention on violent crime.My outcome is violent crime, inputted as a count that is converted to a rate via an offset of (ln of population years) to account for a changing population over time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to asses whether my count outcome data are overdispersed to confirm that I am appropriately using a negative binomial distribution. I'm using proc glimmix (SAS 9.4).&amp;nbsp;I read about using the standard "Gener. Chi-Square/DF" output to determine whether data are overdispersed, with a value closer to 1.0 showing that the data are not overdispersed; but I was cautioned not to use this calculation to determine whether I should use a negative binomial model instead of a Poisson model.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been advised to assess whether my outcome data are overdispersed by dividing the residual deviance by the predicted mean. Is there SAS code I can add to my glimmix model to calculate this? Here is my present code for a difference-in-difference model with a negative binomial distribution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc glimmix data=main.simple_model;&lt;BR /&gt;class tract post (ref='0') exposed (ref='0');&lt;BR /&gt;model totcrime = post exposed post*exposed covariates/&lt;BR /&gt;solution&lt;BR /&gt;dist = negbin&lt;BR /&gt;link = log&lt;BR /&gt;offset = logpopyrs&lt;BR /&gt;cl;&lt;BR /&gt;random int/subject=tract type=un s;&lt;BR /&gt;covtest 'var(tract)=0' . 0;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would another possibility be to run the model as a Poisson model and then a negative binomial model and do a likelihood ratio test?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&lt;DIV align="center"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 13 Oct 2022 14:56:01 GMT</pubDate>
    <dc:creator>DID</dc:creator>
    <dc:date>2022-10-13T14:56:01Z</dc:date>
    <item>
      <title>proc glimmix for count data model fit assessment</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-glimmix-for-count-data-model-fit-assessment/m-p/838414#M41513</link>
      <description>&lt;P&gt;I'm conducting a difference-in-difference analysis to assess the impact of an intervention on violent crime.My outcome is violent crime, inputted as a count that is converted to a rate via an offset of (ln of population years) to account for a changing population over time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to asses whether my count outcome data are overdispersed to confirm that I am appropriately using a negative binomial distribution. I'm using proc glimmix (SAS 9.4).&amp;nbsp;I read about using the standard "Gener. Chi-Square/DF" output to determine whether data are overdispersed, with a value closer to 1.0 showing that the data are not overdispersed; but I was cautioned not to use this calculation to determine whether I should use a negative binomial model instead of a Poisson model.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been advised to assess whether my outcome data are overdispersed by dividing the residual deviance by the predicted mean. Is there SAS code I can add to my glimmix model to calculate this? Here is my present code for a difference-in-difference model with a negative binomial distribution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc glimmix data=main.simple_model;&lt;BR /&gt;class tract post (ref='0') exposed (ref='0');&lt;BR /&gt;model totcrime = post exposed post*exposed covariates/&lt;BR /&gt;solution&lt;BR /&gt;dist = negbin&lt;BR /&gt;link = log&lt;BR /&gt;offset = logpopyrs&lt;BR /&gt;cl;&lt;BR /&gt;random int/subject=tract type=un s;&lt;BR /&gt;covtest 'var(tract)=0' . 0;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would another possibility be to run the model as a Poisson model and then a negative binomial model and do a likelihood ratio test?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&lt;DIV align="center"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 13 Oct 2022 14:56:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-glimmix-for-count-data-model-fit-assessment/m-p/838414#M41513</guid>
      <dc:creator>DID</dc:creator>
      <dc:date>2022-10-13T14:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: proc glimmix for count data model fit assessment</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-glimmix-for-count-data-model-fit-assessment/m-p/838468#M41514</link>
      <description>&lt;P&gt;The link gives an R approach to answering the question using a likelihood ratio test:&amp;nbsp;&lt;A href="https://www.statology.org/negative-binomial-vs-poisson/" target="_self"&gt;https://www.statology.org/negative-binomial-vs-poisson/&lt;/A&gt;&amp;nbsp; To accomplish the same thing in SAS, use the converged log likelihood value from the two choices. The difference should be distributed as a chi-squared variate with a single degree of freedom.&amp;nbsp; But the big thing that is in this website is "LOOK AT THE RESIDUALS GRAPHICALLY".&amp;nbsp; Over or underdispersion to the degree that inferences may be affected should be readily apparent from a plot of residuals vs. predicted values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2022 18:18:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-glimmix-for-count-data-model-fit-assessment/m-p/838468#M41514</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2022-10-13T18:18:26Z</dc:date>
    </item>
    <item>
      <title>Re: proc glimmix for count data model fit assessment</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-glimmix-for-count-data-model-fit-assessment/m-p/838722#M41528</link>
      <description>&lt;P&gt;Thank you Steve.This is helpful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I used proc genmod for another project I used the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;output out=residuals&lt;BR /&gt;stdreschi = Stdreschi;&lt;BR /&gt;Proc plot data=residuals;&lt;BR /&gt;plot stdreschi*time_yrs_t;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code doesn't seem to be available for/work in proc glimmix. Do you know of code with me that will enable proc glimmix to output the residuals and predicted values so that I can plot them?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 20:32:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-glimmix-for-count-data-model-fit-assessment/m-p/838722#M41528</guid>
      <dc:creator>DID</dc:creator>
      <dc:date>2022-10-14T20:32:31Z</dc:date>
    </item>
    <item>
      <title>Re: proc glimmix for count data model fit assessment</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-glimmix-for-count-data-model-fit-assessment/m-p/839005#M41536</link>
      <description>&lt;P&gt;You might try adding PLOTS=pearsonpanel(conditional marginal) to the PROC GLIMMIX statement.&amp;nbsp; Not sure that is what you are going after but it will produce plots of the Pearson residuals versus the predicted values, both conditional and marginal.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also use the OUTPUT statement for something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;output out=out1 pred(/* choose what predicted value you want*/)=predicted &lt;BR /&gt;                pearson/* choose what predicted value you want, but make sure it is the same as for the predicted value*/) =pearson;&lt;/PRE&gt;
&lt;P&gt;That ought to give you a similar dataset where you could use PROC SGPLOT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2022 15:34:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-glimmix-for-count-data-model-fit-assessment/m-p/839005#M41536</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2022-10-17T15:34:05Z</dc:date>
    </item>
    <item>
      <title>Re: proc glimmix for count data model fit assessment</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-glimmix-for-count-data-model-fit-assessment/m-p/839019#M41541</link>
      <description>&lt;P&gt;This has all been very helpful Steve! Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2022 16:24:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-glimmix-for-count-data-model-fit-assessment/m-p/839019#M41541</guid>
      <dc:creator>DID</dc:creator>
      <dc:date>2022-10-17T16:24:20Z</dc:date>
    </item>
  </channel>
</rss>

