# Quantifying effect of a categorical variable in time series analysis

I have a dependent variable ($y$ axis in the pictured graph) trending over time ($x$ axis). I also have a categorical variable, which was constant until one point in time, then changed to another value, with which value it has remained constant since; that point in time is indicated in the picture by a break in the pictured graph. What test can I use to find the effect size of the categorical variable?

• Did the variable blip and then return to its earlier value? Or make a permanent change to a different value? – Henry Dec 8 '11 at 21:18
• @Henry, the latter. I've edited the question to (I hope) clarify that. – msh210 Dec 8 '11 at 21:20

What you have is call an INTERVENTION MODEL where you know the point of the intervention. This is the the de jure point of intervention. Simply form a model which includes a constant, a regressor(X) variable containing 0's prior to the point in time and 1'a thereafter. Include in this model an ARIMA component reflecting the impact of memory. Now oftentimes there is an initial response to the new level of X and a gradual increase/decrease to a final limiting value. This is then called a transient intervention model. Now oftentimes the de facto date of the intervention is different from the de jure date. For example if a law change is announced to begin on JULY 1 , it is possible that there is an advance response or a delayed response to the announced law change. In this case one has to perform Intervention Detection to empirically identify the "by fact" date of the "change". The coefficients of the regressor variable suggest the importance of the regressor. One piece of advice early researchers identified the ARIMA component and then identified the nature/form of the intervention. A more thorough approach is to also investigate the identification of the regressor structure first and then identify the ARIMA structure from the residuals using the identified Intervention Variable.

• Many thanks. Since posting my question, I've discovered that there's an entire subfield I was unaware of, time-series analysis. Any chance you can recommend a book or Web site for the starting practitioner? (Or perhaps I should ask that as a separate question.) – msh210 Dec 9 '11 at 15:13
• I'll +1 the answer just for the effort, not because I have any idea whether it's correct or helpful (and likewise for the other answer). – msh210 Dec 9 '11 at 15:14
• @msh210 That's best asked as a separate question--it's a good one, please consider posting it. I deleted some comments here because they were not appropriate for this site. – whuber Dec 12 '11 at 15:02

Irishstat gave a great answer! In the context of ARIMA models, the change can be identified by interventional analysis. If you are not doing sophisticated ARIMA modeling, then you can create a 0/1 indicator variable (0 for all the periods up to the point of intervention, and 1 for all periods afterwards). Introduce this variable along with trend (e.g., time index) and possibly lag variables to the regression and see if the indicator variable is viewed significant. You can also multiply the indicator variable times the trend variable to pick up the possibility of a change in trending after the intervention.

• :Badgerman . Thanks for the kudos. I should have added that it is possible to actually search for Trend Point Changes in the case that when the Interruption starts the Y series does not simply move to another level but actually begins to trend. Your comments reflect an uncommon awareness of the possible bodels that might be approriate. I prefer computer-based search procedures which "duplicates" the human eye in terms of suggesting the sufficient combination of dummy variables ( Pulse, Level Shift, Seasonal Pulse and of course Local Time Trends in conjunction with any needed ARIMA structure. – IrishStat Dec 9 '11 at 12:33