<?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 interrupted time series/ segmented regression in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/interrupted-time-series-segmented-regression/m-p/633400#M187898</link>
    <description>&lt;PRE&gt;hi!&lt;BR /&gt;I have  a data ( number of  crashes ). I used interrupted time series to show the effect of speed camera that introduced at time=49&lt;BR /&gt;&lt;SPAN&gt;I want to plot in one graph as in the Figure1a in the link &lt;A href="http://www.cdc.gov/pcd/issues/2013/12_0268.htm" target="_blank" rel="nofollow noopener noreferrer"&gt;http://www.cdc.gov/pcd/issues/2013/12_0268.htm&lt;/A&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;30 1 &lt;BR /&gt;26 2&lt;BR /&gt;39 3 &lt;BR /&gt;44 4 &lt;BR /&gt;35 5     &lt;BR /&gt;20 6 &lt;BR /&gt;27 7 &lt;BR /&gt;67 8 &lt;BR /&gt;25 9 &lt;BR /&gt;39 10 &lt;BR /&gt;69 11   &lt;BR /&gt;74 12 &lt;BR /&gt;45 13 &lt;BR /&gt;41 14 &lt;BR /&gt;50 15 &lt;BR /&gt;67 16 &lt;BR /&gt;55 17   &lt;BR /&gt;77 18 &lt;BR /&gt;41 19 &lt;BR /&gt;38 20&lt;BR /&gt;38 21 &lt;BR /&gt;46 22 &lt;BR /&gt;45 23   &lt;BR /&gt;62 24  &lt;BR /&gt;60 25  &lt;BR /&gt;62 26 &lt;BR /&gt;49 27 &lt;BR /&gt;60 28&lt;BR /&gt;78 29         &lt;BR /&gt;69 30      &lt;BR /&gt;64 31 &lt;BR /&gt;86 32&lt;BR /&gt;68 33 &lt;BR /&gt;53 34 &lt;BR /&gt;59 35 &lt;BR /&gt;56 36 &lt;BR /&gt;68 37 &lt;BR /&gt;57 38 &lt;BR /&gt;59 39 &lt;BR /&gt;101 40 &lt;BR /&gt;63 41&lt;BR /&gt;90 42 &lt;BR /&gt;92 43 &lt;BR /&gt;64 44      &lt;BR /&gt;77 45 &lt;BR /&gt;69 46&lt;BR /&gt;82 47 &lt;BR /&gt;70 48 &lt;BR /&gt;63 49 &lt;BR /&gt;66 50  &lt;BR /&gt;78 51 &lt;BR /&gt;94 52 &lt;BR /&gt;88 53 &lt;BR /&gt;62 54 &lt;BR /&gt;77 55 &lt;BR /&gt;92 56 &lt;BR /&gt;76 57 &lt;BR /&gt;55 58 &lt;BR /&gt;70 59 &lt;BR /&gt;54 60 &lt;BR /&gt;76 61 &lt;BR /&gt;58 62 &lt;BR /&gt;58 63&lt;BR /&gt;79 64 &lt;BR /&gt;77 65 &lt;BR /&gt;79 66 &lt;BR /&gt;;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 19 Mar 2020 19:30:58 GMT</pubDate>
    <dc:creator>esraa1</dc:creator>
    <dc:date>2020-03-19T19:30:58Z</dc:date>
    <item>
      <title>interrupted time series/ segmented regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/interrupted-time-series-segmented-regression/m-p/633400#M187898</link>
      <description>&lt;PRE&gt;hi!&lt;BR /&gt;I have  a data ( number of  crashes ). I used interrupted time series to show the effect of speed camera that introduced at time=49&lt;BR /&gt;&lt;SPAN&gt;I want to plot in one graph as in the Figure1a in the link &lt;A href="http://www.cdc.gov/pcd/issues/2013/12_0268.htm" target="_blank" rel="nofollow noopener noreferrer"&gt;http://www.cdc.gov/pcd/issues/2013/12_0268.htm&lt;/A&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;30 1 &lt;BR /&gt;26 2&lt;BR /&gt;39 3 &lt;BR /&gt;44 4 &lt;BR /&gt;35 5     &lt;BR /&gt;20 6 &lt;BR /&gt;27 7 &lt;BR /&gt;67 8 &lt;BR /&gt;25 9 &lt;BR /&gt;39 10 &lt;BR /&gt;69 11   &lt;BR /&gt;74 12 &lt;BR /&gt;45 13 &lt;BR /&gt;41 14 &lt;BR /&gt;50 15 &lt;BR /&gt;67 16 &lt;BR /&gt;55 17   &lt;BR /&gt;77 18 &lt;BR /&gt;41 19 &lt;BR /&gt;38 20&lt;BR /&gt;38 21 &lt;BR /&gt;46 22 &lt;BR /&gt;45 23   &lt;BR /&gt;62 24  &lt;BR /&gt;60 25  &lt;BR /&gt;62 26 &lt;BR /&gt;49 27 &lt;BR /&gt;60 28&lt;BR /&gt;78 29         &lt;BR /&gt;69 30      &lt;BR /&gt;64 31 &lt;BR /&gt;86 32&lt;BR /&gt;68 33 &lt;BR /&gt;53 34 &lt;BR /&gt;59 35 &lt;BR /&gt;56 36 &lt;BR /&gt;68 37 &lt;BR /&gt;57 38 &lt;BR /&gt;59 39 &lt;BR /&gt;101 40 &lt;BR /&gt;63 41&lt;BR /&gt;90 42 &lt;BR /&gt;92 43 &lt;BR /&gt;64 44      &lt;BR /&gt;77 45 &lt;BR /&gt;69 46&lt;BR /&gt;82 47 &lt;BR /&gt;70 48 &lt;BR /&gt;63 49 &lt;BR /&gt;66 50  &lt;BR /&gt;78 51 &lt;BR /&gt;94 52 &lt;BR /&gt;88 53 &lt;BR /&gt;62 54 &lt;BR /&gt;77 55 &lt;BR /&gt;92 56 &lt;BR /&gt;76 57 &lt;BR /&gt;55 58 &lt;BR /&gt;70 59 &lt;BR /&gt;54 60 &lt;BR /&gt;76 61 &lt;BR /&gt;58 62 &lt;BR /&gt;58 63&lt;BR /&gt;79 64 &lt;BR /&gt;77 65 &lt;BR /&gt;79 66 &lt;BR /&gt;;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2020 19:30:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/interrupted-time-series-segmented-regression/m-p/633400#M187898</guid>
      <dc:creator>esraa1</dc:creator>
      <dc:date>2020-03-19T19:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: interrupted time series/ segmented regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/interrupted-time-series-segmented-regression/m-p/633793#M188041</link>
      <description>&lt;P&gt;Create two additional variables that mimic the original data, for use in SGPLOT REG statements.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input crash_count time;
if time &amp;lt;  49 then y1 = crash_count;  * y1 missing when time &amp;gt;=49;
if time &amp;gt;= 49 then y2 = crash_count; * y2 missing when time &amp;lt; 49;
datalines;
30 1
26 2
39 3
44 4
35 5
etc...


proc sgplot data=have;
  series x=time y=crash_count / markers markerattrs=(symbol=circlefilled) ;
  reg    x=time y=y1 / nomarkers lineattrs=(pattern=dot  color=black) legendlabel='Trendline Pre-49';
  reg    x=time y=y2 / nomarkers lineattrs=(pattern=dash color=black) legendlabel='Trendline Post-49';
  keylegend / across=1 location=inside;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV id="tinyMceEditorRichardADeVenezia_0" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="split fit.png" style="width: 647px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/37155iAB4C009C46991DA7/image-size/large?v=v2&amp;amp;px=999" role="button" title="split fit.png" alt="split fit.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Note: The REG statement has no option for extending a fit line (such as the pre-49 dotted line) from left edge to right edge.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Mar 2020 06:37:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/interrupted-time-series-segmented-regression/m-p/633793#M188041</guid>
      <dc:creator>RichardDeVen</dc:creator>
      <dc:date>2020-03-21T06:37:27Z</dc:date>
    </item>
  </channel>
</rss>

