<?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: Graphing Poisson regression for segmented regression in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Graphing-Poisson-regression-for-segmented-regression/m-p/774989#M37921</link>
    <description>&lt;P&gt;Thank you for this. However, the graph does not look right.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please clarify what the statements:&lt;/P&gt;&lt;P&gt;count=rand ("Poisson", 0.8);&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;count=rand ("Poisson, 2.4);&lt;/P&gt;&lt;P&gt;mean? It seems to be a random number generation, but I'm not sure why you would do that? And why are 0.8 and 2.4 chosen, in particular.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want the graph to show the true count (which are outcomes per week and are in the range of 100-750, varying per week) and overlay the Poisson regression line, divided by pre and post intervention. When I use this code, "count" becomes a number between 1-3 or so...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for all of your assistance!&lt;/P&gt;</description>
    <pubDate>Mon, 18 Oct 2021 20:08:01 GMT</pubDate>
    <dc:creator>syoung15</dc:creator>
    <dc:date>2021-10-18T20:08:01Z</dc:date>
    <item>
      <title>Graphing Poisson regression for segmented regression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Graphing-Poisson-regression-for-segmented-regression/m-p/773993#M37867</link>
      <description>&lt;P&gt;I am doing a segmented poisson regression to look at counts pre- and post- an intervention.&lt;/P&gt;&lt;P&gt;There is therefore a poisson regression line pre-intervention and post-intervention. The delineation is by week - 141 weeks total, the break point is week 105.&lt;/P&gt;&lt;P&gt;I can create a variable ("preintervention") and code it as 1 if week &amp;lt; 105 and 0 if week &amp;gt;=105.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to graph the poisson regression lines pre- and post- intervention.&lt;/P&gt;&lt;P&gt;The overall regresson would be:&lt;/P&gt;&lt;P&gt;proc genmod data=have;&lt;/P&gt;&lt;P&gt;model count=week / dist=poisson link=log;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My questions is - how do I transform this into a visual graph (presumably using proc sgplot) that will divide into 2 separate poisson regression lines - 1 pre intervention and 1 post.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for any assistance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Oct 2021 17:03:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Graphing-Poisson-regression-for-segmented-regression/m-p/773993#M37867</guid>
      <dc:creator>syoung15</dc:creator>
      <dc:date>2021-10-13T17:03:01Z</dc:date>
    </item>
    <item>
      <title>Re: Graphing Poisson regression for segmented regression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Graphing-Poisson-regression-for-segmented-regression/m-p/774185#M37868</link>
      <description>&lt;P&gt;1. Add a CLASS statement and list the PreIntervention variable.&lt;/P&gt;
&lt;P&gt;2. Include the PreIntervention variable in the model&lt;/P&gt;
&lt;P&gt;3. Use the OUTPUT statement to get the predicted values in a SAS data set.&lt;/P&gt;
&lt;P&gt;4. Graph the predicted value vs weeks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* simulate data as an example */&lt;BR /&gt;data have;
call streaminit(1);
preintervention = 1;
do week = 1 to 105;
   count = rand("Poisson", 0.8);
   output;
end;
preintervention = 0;
do week = 106 to 150;
   count = rand("Poisson", 2.4);
   output;
end;
run;
/* end simulation */&lt;BR /&gt;
/* read whatever data you have and graph the results */&lt;BR /&gt;proc genmod data=have plots=none;
class preintervention;
model count=week preintervention / dist=poisson link=log;
output out=PoiOut pre=Pred;
run;

proc sgplot data=PoiOut;
scatter x=week y=count / group=preintervention transparency=0.5;
series x=week y=Pred / group=preintervention;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 Oct 2021 20:20:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Graphing-Poisson-regression-for-segmented-regression/m-p/774185#M37868</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-10-18T20:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: Graphing Poisson regression for segmented regression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Graphing-Poisson-regression-for-segmented-regression/m-p/774989#M37921</link>
      <description>&lt;P&gt;Thank you for this. However, the graph does not look right.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please clarify what the statements:&lt;/P&gt;&lt;P&gt;count=rand ("Poisson", 0.8);&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;count=rand ("Poisson, 2.4);&lt;/P&gt;&lt;P&gt;mean? It seems to be a random number generation, but I'm not sure why you would do that? And why are 0.8 and 2.4 chosen, in particular.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want the graph to show the true count (which are outcomes per week and are in the range of 100-750, varying per week) and overlay the Poisson regression line, divided by pre and post intervention. When I use this code, "count" becomes a number between 1-3 or so...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for all of your assistance!&lt;/P&gt;</description>
      <pubDate>Mon, 18 Oct 2021 20:08:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Graphing-Poisson-regression-for-segmented-regression/m-p/774989#M37921</guid>
      <dc:creator>syoung15</dc:creator>
      <dc:date>2021-10-18T20:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: Graphing Poisson regression for segmented regression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Graphing-Poisson-regression-for-segmented-regression/m-p/774991#M37922</link>
      <description>&lt;P&gt;You did not provide any data, so I simulated some to illustrate the process. Ignore the DATA step and just focus on the PROC GENMOD and PROC SGPLOT steps.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Oct 2021 20:21:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Graphing-Poisson-regression-for-segmented-regression/m-p/774991#M37922</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-10-18T20:21:35Z</dc:date>
    </item>
  </channel>
</rss>

