-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path10-itsa-workflow.Rmd
More file actions
59 lines (39 loc) · 2.32 KB
/
10-itsa-workflow.Rmd
File metadata and controls
59 lines (39 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Interrupted Time Series Analysis (ITSA): Worked Workflow {#itsa-applied}
This chapter summarizes a practical workflow for implementing ITSA. The goal is to structure applied work so that assumptions are checked, diagnostics are reported, and results are communicated clearly.
Roadmap
We outline a step-by-step process from data preparation to model refinement and reporting. The workflow is compatible with regression-based ITSA and time-series error models.
Learning objectives
- Prepare and structure time-series data for ITSA.
- Use plots to check trends, outliers, and seasonality.
- Specify a segmented regression model and interpret parameters.
- Diagnose autocorrelation and adjust inference.
- Report results with uncertainty and sensitivity checks.
```{r fig-itsa-workflow, echo=FALSE, fig.cap='Practical ITSA workflow: prepare data, visualize, specify model, check autocorrelation, refine, and report effects with uncertainty and sensitivity checks.', out.width='95%'}
knitr::include_graphics('images/10_itsa_workflow.png')
```
Figure \@ref(fig:fig-itsa-workflow) is a checklist for applied work. It helps ensure that evaluation is transparent and reproducible.
After fitting a segmented regression, a key check is whether residuals are autocorrelated.
```{r itsa-diagnostics-template, eval=FALSE, echo=TRUE}
# Template: basic diagnostics after a segmented regression
# install.packages(c("lmtest","sandwich","forecast")) if needed
library(lmtest)
library(forecast)
# model_itsa is the fitted model from the segmented regression
dwtest(model_itsa) # Durbin-Watson test for autocorrelation
checkresiduals(model_itsa) # residual plot + ACF check
```
## Reporting recommendations
A strong ITSA report includes:
- clear definition of the intervention and timing
- justification for pre and post windows
- plots of the outcome with intervention markers
- model specification with level and slope terms
- autocorrelation diagnostics and corrected inference
- sensitivity analysis (alternative windows, functional forms, seasonality)
Common pitfalls
- Reporting a single model with no sensitivity checks.
- Omitting diagnostic evidence for autocorrelation.
- Over-interpreting short post-intervention windows.
Key takeaways
- A transparent workflow improves credibility.
- Sensitivity checks are part of good evaluation practice.