BookmarkSubscribeRSS Feed
xiuyanzhao
Calcite | Level 5

I have a series, which obviously increased the mean at one point. I was thinking to create a variable x=1 after the change point and x=0 before the change point.

however, the series also has a seasonality. I did  span of 12 differencing to remove the seasonality. but the shift disappeared after the differencing. instead it shows some big or low value around the change point.

if I test x for the original series , it is very significant. but after differencing, x is non-significant any more. I guess the differencing just removed the effect of x...what should I do ?

please help!

Xiu Yan

11 REPLIES 11
PGStats
Opal | Level 21

You should span of 12 difference x as well. - PG

PG
xiuyanzhao
Calcite | Level 5

how to span of difference X? it is only has 0 and 1, not a series? does that make sense? in addition how to do it in terms of syntax? Could you pls elaborate it and guide me?

Thanks!

Xiu Yan

PGStats
Opal | Level 21

Let's say your series is Y(t), t=1...96 and, as you described, X(t) = 0, t=1...63 and X(t) = 1, t=64...96. Then the deseasonalized series will be Y'(t) = Y(t)-Y(t-12) and X'(t) = X(t)-X(t-12), t=13...96. The X'(t) series will be zero everywhere except for t=64...75 where it will be = 1.

If X turns out to be significant, it will signal that observations up to one year after the change of level were higher than observations for the same month, the year before.

Hope this helps.

PG

PG
xiuyanzhao
Calcite | Level 5

Hi PG,

Thanks! do you mean if the coef. of x is still not sig. after using differencing  the x on span of 12, we  can conclude that there is no change on that point at 5% level.

we then can just remove the x from the model?  or we can leave it in the model.

Thanks!

Xiu Yan

proc arima;

var=copd_ohip(12)  crosscorr=(x(12))  ;

p=(1)(4)  input=(x) method=ml ;

run;quit;

PGStats
Opal | Level 21

You cannot conclude that there is no changepoint. You can only say that you don't have the evidence to detect it statistically. It can also mean that some other aspect of your time series model is inadequate, including the assumed timing of the changepoint.

PG

PG
xiuyanzhao
Calcite | Level 5

Hi PG,

Thanks!  That is very helpful!  I asked the researcher, she felt this is important from clinical point of view. I would like to take it into account for the forecast, however, my forecast plot does not seem to do this.

Do you have an idea how to incorporate this mean increases in the forecast?  could you please guide me?

Xiu Yan

PGStats
Opal | Level 21

Hi Xiu Yan,

If your forecasts are more than a year away from the changepoint, they will not depend on the series before the changepoint, they will depend almost entirely on recent values and the corresponding values from the previous year. What's wrong with your forecasts? - PG

Prediction is very difficult, especially about the future. - Niels Bohr (1885 - 1962)

PG
xiuyanzhao
Calcite | Level 5

Hi PG,

Here are the forecasts.

Thanks!

xiuyanzhao
Calcite | Level 5

Hi PG,

   

Thanks!  I got it.  I thought the forecasts should have similar
behaviour. I mean two means-one mean increases after point.

You are right. The incorporation of that change will depending on the value
after the point since we usually predict more than one year.

I rechecked my data, and re-set the changing point. now it is sig. in my
model. I guess your guidance have helped me solve this problem.

please see my forecast plot. Does this looks OK?

    Thanks!

    Xiu Yan

PGStats
Opal | Level 21

Hi Xiu Yan,

Yes! That looks pretty good! Congratulations. Glad I could help.

PG

PG
xiuyanzhao
Calcite | Level 5

Hi PG,

One  more thought, will my forecast be questionable due to the fact that my forecast is more rely on the recent value ?

I incorporate the mean increases behavior, but I lost something. .. right?

how about an example, that the series keep flat before the point and downward after the point. The forecast would be decreasing then...is that appropriate?

  

Xiu Yan

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 11 replies
  • 1634 views
  • 6 likes
  • 2 in conversation