How do you implement interrupted time series? I recently found that Stata has a user developed command packaged called itsa (Interrupted Time Series Analysis).
According to the package description, "itsa estimates the effect of an intervention when the outcome variable is ordered as a time series, and a number of observations are available in both pre- and post-intervention periods. The study design is generally referred to as an interrupted time series because the intervention is expected to interrupt the level and/or trend subsequent to its introduction (Campbell & Stanley, 1966; Glass, Willson & Gottman, 1975; Shadish, Cook & Campbell, 2002)"
Let us try this lovely Stata command. Type the following in your command panel:
1. sysuse cigsales_single, clear // this opens the data set
2. tsset year // in stata, it is important to declare the dataset as time series
3. itsa cigsale, single trperiod(1989) lag(1) fig posttrend //this implements the itsa, the single trperiod (1989) is the introduction of the intervention, while fig creates the graph while posttrend computes for post-intervention linear trend.
No comments:
Post a Comment