<?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 approach for controlled interrupted time-series in SAS Forecasting and Econometrics</title>
    <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Graphing-approach-for-controlled-interrupted-time-series/m-p/970984#M4990</link>
    <description>&lt;P&gt;Sorry for the slow reply,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;! Thank you for this. I will give it a whirl.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 17 Jul 2025 13:17:38 GMT</pubDate>
    <dc:creator>sasgorilla</dc:creator>
    <dc:date>2025-07-17T13:17:38Z</dc:date>
    <item>
      <title>Graphing approach for controlled interrupted time-series</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Graphing-approach-for-controlled-interrupted-time-series/m-p/970501#M4982</link>
      <description>&lt;P&gt;I have a dataset with an interruption and a control and intervention group, and observed monthly outcomes pre- and post-interruption over a few year period (i.e. CITS design).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have used proc arima to generate estimates for interruption level and trend changes based on exposure status.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;As far as graphically depicting this, I am wondering the best approach to make something like the below (&lt;A href="https://rpubs.com/chrissyhroberts/1006858" target="_self"&gt;source&lt;/A&gt;), where i have pre- and post-interruption trends and level changes clearly depicted PLUS the "counterfactual" had the intervention not occurred.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sasgorilla_0-1752125074243.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/108259i03A01B94615D6FB2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sasgorilla_0-1752125074243.png" alt="sasgorilla_0-1752125074243.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If any one has some suggestions I would appreciate it. Thank you.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jul 2025 05:27:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Graphing-approach-for-controlled-interrupted-time-series/m-p/970501#M4982</guid>
      <dc:creator>sasgorilla</dc:creator>
      <dc:date>2025-07-10T05:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: Graphing approach for controlled interrupted time-series</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Graphing-approach-for-controlled-interrupted-time-series/m-p/970614#M4983</link>
      <description>&lt;P&gt;You didn't supply data, so I simulated some data to illustrate. I only used one group, but you can add &lt;STRONG&gt;GROUP=factor&amp;nbsp;&lt;/STRONG&gt;to each BAND/SERIES/SCATTER statement to get separate lines/points for factor=0 and factor=1.&amp;nbsp; You can ignore the DATA step and just focus on the PROC SGPLOT statements.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Simulate data that looks like the OP's picture */
data Sim;
call streaminit(12);
sigma = 5;
offset = 100;
do t = 1 to 100;
   factor = 0;
   if t &amp;lt;= 50 then do;
      c = 0;
      m = -1;
   end;
   else do;
      c = -50;
      m = -1.5;
   end;
   pred = 300 + m*t + c;
   lclm = pred - sigma;
   uclm = pred + sigma;
   y = pred + rand("Normal", 0, sigma);
   counter_pred = 300 - t;
   counter_lclm = counter_pred - sigma;
   counter_uclm = counter_pred + sigma;
   output;
end;
run;

title "Time Series Model with Interruption";
proc sgplot data=Sim;
  /* plot counterfactual in background */
  band x=t lower=counter_lclm upper=counter_uclm / transparency=0.5;
  series x=t y=counter_pred / lineattrs=(pattern=dash);
  /* then overlay the predictions */
  band x=t lower=lclm upper=uclm;
  series x=t y=pred;
  /* then plot the data */
  scatter x=t y=y;
  xaxis grid;
  yaxis grid;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 11 Jul 2025 14:44:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Graphing-approach-for-controlled-interrupted-time-series/m-p/970614#M4983</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2025-07-11T14:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: Graphing approach for controlled interrupted time-series</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Graphing-approach-for-controlled-interrupted-time-series/m-p/970984#M4990</link>
      <description>&lt;P&gt;Sorry for the slow reply,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;! Thank you for this. I will give it a whirl.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jul 2025 13:17:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Graphing-approach-for-controlled-interrupted-time-series/m-p/970984#M4990</guid>
      <dc:creator>sasgorilla</dc:creator>
      <dc:date>2025-07-17T13:17:38Z</dc:date>
    </item>
  </channel>
</rss>

