Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Analytics
- /
- Forecasting
- /
- estimating coefficients from Interrupted time series using ARIMA in PR...

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 05-10-2019 03:01 AM
(851 views)

Hi SAS experts,

I'm trying to do an interrupted time series (ITS) analysis to compare before and after certain intervention.

(Ref. https://academic.oup.com/ije/article/46/1/348/2622842)

From the reference, here are the steps I went through so far.

1.I prepared the dataset with variables (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...]

2. Then I used PROC ARIMA identify to check for the stationarity as follows:

```
proc arima data=sample;
identify var=outcome stationarity=(adf);
run;
```

since the result showed that 'outcome' is nonstationary, I used first-order difference as follows and the test showed stationary:

```
proc arima data=sample;
identify var=outcome(1) stationarity=(adf);
run;
```

3. and from the ACF, PACF plots from above, I thought AR(5) model would fit, so I tried final diagnosis as:

```
proc arima data=sample;
identify var=outcome(1) ;
run;
estimate p=5;
run;
```

and the result seemed reasonable.

So, here is my question.

0. the ITS equation I want to use is : outcome = t_before(b1 -> previous trend) intervention(b2 -> level change) t_after(b3 -> trend change) , under ARIMA (5, 1, 0) model

1. if so, how can I put this equation into PROC ARIMA to get the coefficients of b1, b2, and b3?

some references seem to use PROC MODEL, or PROC AUTOREG, but I don't think those cases consider the ARIMA (because those programs have no coded lines such as 'p=~~', 'q=~~' or checking ACF, PACF and so on)

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)

I attached the sample dataset.

Thanks for your help in advance

1 REPLY 1

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Try

proc arima data=sample;

identify var=outcome(1) crosscorr=intervention noprint;

estimate p=1 input=intervention method=ml;

quit;

Note:

1. I have reduced your p=5 to p=1 because the higher order coefficients are not very significant. The residual plots appear OK.

2. The pre-intervention slope (MU in this case) is estimated as -0.72433, which seems reasonable since the outcome is trending downward prior to intervention.

3. Post-intervention slope, MU + intervention coefficient, turns out to be (-0.72433 + 12.49581).

Hope this works for you.

By the way, for carrying out more general types of analyses described in the paper you mention it is easier to use PROC SSM. This is a newer procedure than ARIMA and provides much broader support for time series modeling and intervention analysis. The learning curve for PROC SSM is a bit steep but I think worth taking a look. See

Selukar, R. S. (2017). “Detecting and Adjusting Structural Breaks in Time Series and Panel Data Using the SSM Procedure.” In *Proceedings of the SAS Global Forum 2017 Conference*. Cary, NC: SAS Institute Inc. http://support.sas.com/resources/papers/proceedings17/SAS0456-2017.pdf

Are you ready for the spotlight? We're accepting content ideas for **SAS Innovate 2025** to be held May 6-9 in Orlando, FL. The call is **open **until September 25. Read more here about **why** you should contribute and **what is in it** for you!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.