<?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 estimating coefficients from Interrupted time series using ARIMA in PROC ARIMA in SAS Forecasting and Econometrics</title>
    <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/estimating-coefficients-from-Interrupted-time-series-using-ARIMA/m-p/557696#M3542</link>
    <description>&lt;P&gt;Hi SAS experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to do an interrupted time series (ITS) analysis to compare before and after certain intervention.&lt;/P&gt;&lt;P&gt;(Ref.&amp;nbsp;&lt;A href="https://academic.oup.com/ije/article/46/1/348/2622842" target="_blank"&gt;https://academic.oup.com/ije/article/46/1/348/2622842&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From the reference, here are the steps I went through so far.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1.I prepared the dataset with variables&amp;nbsp; (1) outcome (2) t_before [serial count 1,2,3...] (3) intervention [0 or 1] (4) t_after [0,0,0,...intervention... , 1, 2, 3...]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Then I used PROC ARIMA identify to check for the stationarity as follows:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc arima data=sample;
identify var=outcome stationarity=(adf);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;since the result showed that 'outcome' is nonstationary, I used first-order difference as follows and the test showed stationary:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc arima data=sample;
identify var=outcome(1) stationarity=(adf);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. and from the ACF, PACF plots from above, I thought AR(5) model would fit, so I tried final diagnosis as:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc arima data=sample;
identify var=outcome(1) ;
run;

estimate p=5;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and the result seemed reasonable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, here is my question.&lt;/P&gt;&lt;P&gt;0. the ITS equation I want to use is :&amp;nbsp; outcome&amp;nbsp; =&amp;nbsp; &amp;nbsp;t_before(b1 -&amp;gt; previous trend)&amp;nbsp; intervention(b2 -&amp;gt; level change)&amp;nbsp; t_after(b3 -&amp;gt; trend change) , under&amp;nbsp; ARIMA (5, 1, 0) model&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. if so, how can I put this equation into PROC ARIMA to get the coefficients of b1, b2, and b3?&lt;/P&gt;&lt;P&gt;some references seem to use PROC MODEL, or PROC AUTOREG, but I don't think those cases consider the ARIMA&amp;nbsp; (because those programs have no coded lines such as 'p=~~', 'q=~~' or checking ACF, PACF and so on)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. if I also want to estimate the slope of post trend, which is (b1+b3), how should I code to get the estimation and the p-value for (b1+b3)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I attached the sample dataset.&lt;/P&gt;&lt;P&gt;Thanks for your help in advance&lt;/P&gt;</description>
    <pubDate>Fri, 10 May 2019 07:01:53 GMT</pubDate>
    <dc:creator>medic</dc:creator>
    <dc:date>2019-05-10T07:01:53Z</dc:date>
    <item>
      <title>estimating coefficients from Interrupted time series using ARIMA in PROC ARIMA</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/estimating-coefficients-from-Interrupted-time-series-using-ARIMA/m-p/557696#M3542</link>
      <description>&lt;P&gt;Hi SAS experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to do an interrupted time series (ITS) analysis to compare before and after certain intervention.&lt;/P&gt;&lt;P&gt;(Ref.&amp;nbsp;&lt;A href="https://academic.oup.com/ije/article/46/1/348/2622842" target="_blank"&gt;https://academic.oup.com/ije/article/46/1/348/2622842&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From the reference, here are the steps I went through so far.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1.I prepared the dataset with variables&amp;nbsp; (1) outcome (2) t_before [serial count 1,2,3...] (3) intervention [0 or 1] (4) t_after [0,0,0,...intervention... , 1, 2, 3...]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Then I used PROC ARIMA identify to check for the stationarity as follows:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc arima data=sample;
identify var=outcome stationarity=(adf);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;since the result showed that 'outcome' is nonstationary, I used first-order difference as follows and the test showed stationary:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc arima data=sample;
identify var=outcome(1) stationarity=(adf);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. and from the ACF, PACF plots from above, I thought AR(5) model would fit, so I tried final diagnosis as:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc arima data=sample;
identify var=outcome(1) ;
run;

estimate p=5;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and the result seemed reasonable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, here is my question.&lt;/P&gt;&lt;P&gt;0. the ITS equation I want to use is :&amp;nbsp; outcome&amp;nbsp; =&amp;nbsp; &amp;nbsp;t_before(b1 -&amp;gt; previous trend)&amp;nbsp; intervention(b2 -&amp;gt; level change)&amp;nbsp; t_after(b3 -&amp;gt; trend change) , under&amp;nbsp; ARIMA (5, 1, 0) model&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. if so, how can I put this equation into PROC ARIMA to get the coefficients of b1, b2, and b3?&lt;/P&gt;&lt;P&gt;some references seem to use PROC MODEL, or PROC AUTOREG, but I don't think those cases consider the ARIMA&amp;nbsp; (because those programs have no coded lines such as 'p=~~', 'q=~~' or checking ACF, PACF and so on)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. if I also want to estimate the slope of post trend, which is (b1+b3), how should I code to get the estimation and the p-value for (b1+b3)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I attached the sample dataset.&lt;/P&gt;&lt;P&gt;Thanks for your help in advance&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2019 07:01:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/estimating-coefficients-from-Interrupted-time-series-using-ARIMA/m-p/557696#M3542</guid>
      <dc:creator>medic</dc:creator>
      <dc:date>2019-05-10T07:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: estimating coefficients from Interrupted time series using ARIMA in PROC ARIMA</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/estimating-coefficients-from-Interrupted-time-series-using-ARIMA/m-p/558271#M3545</link>
      <description>&lt;P&gt;Try&lt;/P&gt;
&lt;P&gt;proc arima data=sample;&lt;BR /&gt;identify var=outcome(1) crosscorr=intervention noprint;&lt;BR /&gt;estimate p=1 input=intervention method=ml;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note:&lt;/P&gt;
&lt;P&gt;1.&amp;nbsp; I have reduced your p=5 to p=1 because the higher order coefficients are not very significant.&amp;nbsp; The residual plots appear OK.&lt;/P&gt;
&lt;P&gt;2.&amp;nbsp; The pre-intervention slope (MU in this case) is estimated as&amp;nbsp;-0.72433, which seems reasonable since the outcome is trending downward prior to intervention.&lt;/P&gt;
&lt;P&gt;3.&amp;nbsp; Post-intervention slope, MU + intervention coefficient, turns out to be (&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #333333; cursor: text; font-family: 'HelevticaNeue-light','Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;-0.72433&lt;/SPAN&gt; + 12.49581).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this works for you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By the way, for carrying out more general types of analyses described in the paper you mention it is easier to use PROC SSM.&amp;nbsp; This is a newer procedure than ARIMA and provides much broader support for time series modeling and intervention analysis.&amp;nbsp; The learning curve for PROC SSM is a bit steep but I think worth taking a look.&amp;nbsp; See&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #333333; font-family: AvenirNext,Helvetica,Arial,sans-serif; font-size: 14.06px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;Selukar, R.&amp;nbsp;S. (2017). “Detecting and Adjusting Structural Breaks in Time Series and Panel Data Using the SSM Procedure.” In &lt;/SPAN&gt;&lt;SPAN style="background-color: transparent; box-sizing: border-box; color: #333333; font-family: AvenirNext,Helvetica,Arial,sans-serif; font-size: 14.06px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;&lt;EM style="box-sizing: border-box;"&gt;Proceedings of the SAS Global Forum 2017 Conference&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #333333; font-family: AvenirNext,Helvetica,Arial,sans-serif; font-size: 14.06px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;. Cary, NC: SAS Institute Inc. &lt;/SPAN&gt;&lt;A tabindex="0" style="background-color: transparent; box-sizing: border-box; color: #287eab; font-family: AvenirNext,Helvetica,Arial,sans-serif; font-size: 14.06px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;" href="http://support.sas.com/resources/papers/proceedings17/SAS0456-2017.pdf" target="_blank" rel="noopener"&gt;http://support.sas.com/resources/papers/proceedings17/SAS0456-2017.pdf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2019 12:11:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/estimating-coefficients-from-Interrupted-time-series-using-ARIMA/m-p/558271#M3545</guid>
      <dc:creator>rselukar</dc:creator>
      <dc:date>2019-05-13T12:11:22Z</dc:date>
    </item>
  </channel>
</rss>

