<?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: Code for Single Interrupted Time Series graphic display? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Code-for-Single-Interrupted-Time-Series-graphic-display/m-p/789381#M32395</link>
    <description>Sorry, with the mean distress levels by year I used this code following the data lines above.&lt;BR /&gt;&lt;BR /&gt;Proc sgplot data=AimII_Table2;&lt;BR /&gt;scatter x=Time y=Distress;&lt;BR /&gt;series x=Time y=Distress;&lt;BR /&gt;reg x=Time y=Distress/group=Election;&lt;BR /&gt;refline&lt;BR /&gt;run;</description>
    <pubDate>Tue, 11 Jan 2022 00:09:08 GMT</pubDate>
    <dc:creator>cmc_NYC</dc:creator>
    <dc:date>2022-01-11T00:09:08Z</dc:date>
    <item>
      <title>Code for Single Interrupted Time Series graphic display?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Code-for-Single-Interrupted-Time-Series-graphic-display/m-p/789380#M32394</link>
      <description>&lt;P&gt;Hello all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have developed a model to test the impact of a 2017 event on distress in a population and it was run by a research center using data to which I don't have access.&amp;nbsp;I'm having trouble finding sample code for using this output to create a display like this.&amp;nbsp; I'm now working with the output and trying to display the coefficients in a graphic that looks something like this.&amp;nbsp; (This is from Warton et al 2020) For this particular display I would just have one line not two.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sample from Warton.jpg" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/67274i5ED0A5A34488FE8C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sample from Warton.jpg" alt="Sample from Warton.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;I have two kinds of output that seem relevant:&lt;/P&gt;&lt;P&gt;1) The mean distress score for the group each year from 2011 to 2018. Here's my first pass at that program, that shows those scores.&amp;nbsp; This did not work. In particular, I'm not seeing how to create the vertical line indicating the event in 2017&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data AimII_Table2;&lt;BR /&gt;input TimeElapsed Time Distress Event $;&lt;BR /&gt;datalines;&lt;BR /&gt;0 2011 3.7339771 Before&lt;BR /&gt;1 2012 3.8688698 Before&lt;BR /&gt;2 2013 3.8669976 Before&lt;BR /&gt;3 2014 3.5876379 Before&lt;BR /&gt;4 2015 3.64495 Before&lt;BR /&gt;5 2016 3.4850532 Before&lt;BR /&gt;6 2017 3.6610487 After&lt;BR /&gt;7 2018 3.5467001 After&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;2) The coefficients for the univariate regression, so coefficients for time, before and after the event, and the interaction terms for time*after the event&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Estimated Regression Coefficients&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Parameter&lt;/TD&gt;&lt;TD&gt;Estimate&lt;/TD&gt;&lt;TD&gt;Standard&lt;BR /&gt;Error&lt;/TD&gt;&lt;TD&gt;t&amp;nbsp;Value&lt;/TD&gt;&lt;TD&gt;Pr&amp;nbsp;&amp;gt;&amp;nbsp;|t|&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Intercept&lt;/TD&gt;&lt;TD&gt;3.8593132&lt;/TD&gt;&lt;TD&gt;0.06640163&lt;/TD&gt;&lt;TD&gt;58.12&lt;/TD&gt;&lt;TD&gt;&amp;lt;.0001&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;TimeElapsed&lt;/TD&gt;&lt;TD&gt;-0.0644708&lt;/TD&gt;&lt;TD&gt;0.02134668&lt;/TD&gt;&lt;TD&gt;-3.02&lt;/TD&gt;&lt;TD&gt;0.0025&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AfterEvent After Event&lt;/TD&gt;&lt;TD&gt;0.4878268&lt;/TD&gt;&lt;TD&gt;0.84369762&lt;/TD&gt;&lt;TD&gt;0.58&lt;/TD&gt;&lt;TD&gt;0.5631&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AfterEvent Before Event&lt;/TD&gt;&lt;TD&gt;0.0000000&lt;/TD&gt;&lt;TD&gt;0.00000000&lt;/TD&gt;&lt;TD&gt;.&lt;/TD&gt;&lt;TD&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;TimeElapsed*AfterEvent After&amp;nbsp;Event&lt;/TD&gt;&lt;TD&gt;-0.0498778&lt;/TD&gt;&lt;TD&gt;0.13118431&lt;/TD&gt;&lt;TD&gt;-0.38&lt;/TD&gt;&lt;TD&gt;0.7038&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;TimeElapsed*AfterEvent Before&amp;nbsp;Event&lt;/TD&gt;&lt;TD&gt;0.0000000&lt;/TD&gt;&lt;TD&gt;0.00000000&lt;/TD&gt;&lt;TD&gt;.&lt;/TD&gt;&lt;TD&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for any ideas!&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jan 2022 00:05:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Code-for-Single-Interrupted-Time-Series-graphic-display/m-p/789380#M32394</guid>
      <dc:creator>cmc_NYC</dc:creator>
      <dc:date>2022-01-11T00:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: Code for Single Interrupted Time Series graphic display?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Code-for-Single-Interrupted-Time-Series-graphic-display/m-p/789381#M32395</link>
      <description>Sorry, with the mean distress levels by year I used this code following the data lines above.&lt;BR /&gt;&lt;BR /&gt;Proc sgplot data=AimII_Table2;&lt;BR /&gt;scatter x=Time y=Distress;&lt;BR /&gt;series x=Time y=Distress;&lt;BR /&gt;reg x=Time y=Distress/group=Election;&lt;BR /&gt;refline&lt;BR /&gt;run;</description>
      <pubDate>Tue, 11 Jan 2022 00:09:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Code-for-Single-Interrupted-Time-Series-graphic-display/m-p/789381#M32395</guid>
      <dc:creator>cmc_NYC</dc:creator>
      <dc:date>2022-01-11T00:09:08Z</dc:date>
    </item>
    <item>
      <title>Re: Code for Single Interrupted Time Series graphic display?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Code-for-Single-Interrupted-Time-Series-graphic-display/m-p/789383#M32396</link>
      <description>You need to add a value for where you want the refline and specify the axis. &lt;BR /&gt;&lt;BR /&gt;refline 2017 / axis=x label='Event 2017';&lt;BR /&gt;&lt;BR /&gt;Ref Lines examples:&lt;BR /&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grstatproc/n19gxtzyuf79t3n16g5v26b73ckv.htm#n1vl5u624cjn05n1xvpnhei9b8s4" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grstatproc/n19gxtzyuf79t3n16g5v26b73ckv.htm#n1vl5u624cjn05n1xvpnhei9b8s4&lt;/A&gt;</description>
      <pubDate>Tue, 11 Jan 2022 00:15:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Code-for-Single-Interrupted-Time-Series-graphic-display/m-p/789383#M32396</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-01-11T00:15:41Z</dc:date>
    </item>
    <item>
      <title>Re: Code for Single Interrupted Time Series graphic display?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Code-for-Single-Interrupted-Time-Series-graphic-display/m-p/789482#M32405</link>
      <description>Thank you. I had lots of examples of REFLINE code, but just needed something that broke down how that worked.</description>
      <pubDate>Tue, 11 Jan 2022 15:33:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Code-for-Single-Interrupted-Time-Series-graphic-display/m-p/789482#M32405</guid>
      <dc:creator>cmc_NYC</dc:creator>
      <dc:date>2022-01-11T15:33:28Z</dc:date>
    </item>
  </channel>
</rss>

