Piecewise ITS Regression
Methodology
Interrupted Time Series (ITS) is a quasi-experimental design for evaluating interventions when randomization is not possible. This N-of-1 study uses a piecewise regression with three interruptions:
εt = ρ·εt-1 + ut (AR(1) autocorrelation correction)
bb is 1 only on days the beta-blocker was taken (167 days), and time_since_bb counts those days. The 2 pauses without the medicine (May 20 to May 23, Jul 20 to Aug 3, 19 days) are coded as off: bb is 0 and time_since_bb holds still. After the last dose on Oct 10, bb is 0, time_since_bb holds at 166 and bb_off is 1, so β6 is the level change after the stop beyond losing the level shift β4.
| β2 | Jakavi level shift - immediate change in the metric when Jakavi started |
| β3 | Jakavi slope change - change in daily trend after Jakavi |
| β4 | Beta-blocker level shift - immediate change when beta-blocker was added |
| β5 | Beta-blocker slope change - change in daily trend per day on the beta-blocker |
| β6 | Beta-blocker stop level shift - immediate change after the last dose |
AR(1) correction accounts for day-to-day autocorrelation in biometric data (today's measurement is correlated with yesterday's). Without this correction, standard errors would be underestimated and p-values too liberal.
Fitted via statsmodels.GLSAR (iterative Cochrane-Orcutt, up to
20 iterations). Residual diagnostics include the Durbin-Watson
statistic and Ljung-Box test for remaining autocorrelation.
Mean RMSSD (ms)
| Parameter | Estimate | Std Error | 95% CI | P-value |
|---|---|---|---|---|
| Intercept (b0) | +7.0790 | 2.5173 | [+2.1253, +12.0328] | p=0.005 * |
| Baseline trend (b1) | +0.0889 | 0.0639 | [-0.0369, +0.2147] | p=0.165 |
| Jakavi level shift (b2) | +5.6383 | 3.2332 | [-0.7243, +12.0009] | p=0.082 |
| Jakavi slope change (b3) | +0.0007 | 0.1128 | [-0.2212, +0.2226] | p=0.995 |
| Beta-blocker level shift (b4) | +6.7331 | 1.8188 | [+3.1538, +10.3124] | p<0.001 * |
| Beta-blocker slope change (b5) | -0.0973 | 0.1092 | [-0.3122, +0.1176] | p=0.373 |
| Beta-blocker stop level shift (b6) | -6.3767 | 3.3744 | [-13.0172, +0.2639] | p=0.060 |
Lowest Heart Rate (bpm)
| Parameter | Estimate | Std Error | 95% CI | P-value |
|---|---|---|---|---|
| Intercept (b0) | +82.5528 | 1.5381 | [+79.5260, +85.5796] | p<0.001 * |
| Baseline trend (b1) | -0.1707 | 0.0393 | [-0.2481, -0.0933] | p<0.001 * |
| Jakavi level shift (b2) | -1.2730 | 2.0270 | [-5.2619, +2.7159] | p=0.530 |
| Jakavi slope change (b3) | +0.1931 | 0.0697 | [+0.0559, +0.3302] | p=0.006 * |
| Beta-blocker level shift (b4) | -7.2923 | 1.1507 | [-9.5567, -5.0278] | p<0.001 * |
| Beta-blocker slope change (b5) | -0.0735 | 0.0679 | [-0.2072, +0.0602] | p=0.280 |
| Beta-blocker stop level shift (b6) | +2.2875 | 2.1147 | [-1.8740, +6.4491] | p=0.280 |
Average Heart Rate (bpm)
| Parameter | Estimate | Std Error | 95% CI | P-value |
|---|---|---|---|---|
| Intercept (b0) | +92.0781 | 1.6969 | [+88.7388, +95.4175] | p<0.001 * |
| Baseline trend (b1) | -0.2057 | 0.0433 | [-0.2909, -0.1205] | p<0.001 * |
| Jakavi level shift (b2) | +0.5030 | 2.2203 | [-3.8664, +4.8724] | p=0.821 |
| Jakavi slope change (b3) | +0.2267 | 0.0766 | [+0.0759, +0.3775] | p=0.003 * |
| Beta-blocker level shift (b4) | -6.9805 | 1.2574 | [-9.4549, -4.5061] | p<0.001 * |
| Beta-blocker slope change (b5) | -0.0768 | 0.0746 | [-0.2235, +0.0699] | p=0.304 |
| Beta-blocker stop level shift (b6) | +2.6276 | 2.3167 | [-1.9313, +7.1866] | p=0.258 |
Sleep Efficiency (%)
| Parameter | Estimate | Std Error | 95% CI | P-value |
|---|---|---|---|---|
| Intercept (b0) | +77.4100 | 1.2752 | [+74.9005, +79.9194] | p<0.001 * |
| Baseline trend (b1) | +0.0388 | 0.0326 | [-0.0254, +0.1030] | p=0.235 |
| Jakavi level shift (b2) | +0.1712 | 1.6854 | [-3.1455, +3.4879] | p=0.919 |
| Jakavi slope change (b3) | +0.0101 | 0.0579 | [-0.1038, +0.1239] | p=0.862 |
| Beta-blocker level shift (b4) | +0.2119 | 0.9577 | [-1.6728, +2.0966] | p=0.825 |
| Beta-blocker slope change (b5) | -0.0323 | 0.0565 | [-0.1434, +0.0788] | p=0.567 |
| Beta-blocker stop level shift (b6) | -4.1785 | 1.7583 | [-7.6387, -0.7183] | p=0.018 * |
Sensitivity Interpretation
The beta-blocker date sensitivity analysis re-fits each model with the start date shifted from -3 to +3 days.
Every shifted re-fit had at least 5 post-beta-blocker observations, so all shifts carry equal weight.
- Mean RMSSD: none of the supported shifts remained significant, so the estimated beta-blocker slope is not robust to plausible date changes.
- Lowest Heart Rate: none of the supported shifts remained significant, so the estimated beta-blocker slope is not robust to plausible date changes.
- Average Heart Rate: none of the supported shifts remained significant, so the estimated beta-blocker slope is not robust to plausible date changes.
- Sleep Efficiency: none of the supported shifts remained significant, so the estimated beta-blocker slope is not robust to plausible date changes.
Suggested manuscript wording: "In a sensitivity analysis that shifted the beta-blocker start date from -3 to +3 days, the post-beta-blocker slope term remained significant in 0 of 7 supported re-fits for Mean RMSSD, 0 of 7 for Lowest Heart Rate, 0 of 7 for Average Heart Rate and 0 of 7 for Sleep Efficiency. We therefore do not describe the beta-blocker slope effect as robust to ±3-day date uncertainty."
Sensitivity Analysis: BB Intervention Date ±3 Days
| Offset | BB Date | Post-BB n | Support | Level (b4) | p | Slope (b5) | p | R² |
|---|---|---|---|---|---|---|---|---|
| -3d | 2026-04-05 | 166 | supported | +5.27 ms * | p=0.007 | -0.030 ms/day | p=0.799 | 0.318 |
| -2d | 2026-04-06 | 165 | supported | +5.69 ms * | p=0.003 | -0.052 ms/day | p=0.652 | 0.328 |
| -1d | 2026-04-07 | 164 | supported | +6.46 ms * | p<0.001 | -0.074 ms/day | p=0.511 | 0.342 |
| +0d (actual) | 2026-04-08 | 163 | supported | +6.73 ms * | p<0.001 | -0.097 ms/day | p=0.373 | 0.353 |
| +1d | 2026-04-09 | 162 | supported | +7.50 ms * | p<0.001 | -0.120 ms/day | p=0.262 | 0.367 |
| +2d | 2026-04-10 | 162 | supported | +7.42 ms * | p<0.001 | -0.140 ms/day | p=0.186 | 0.369 |
| +3d | 2026-04-11 | 161 | supported | +7.09 ms * | p<0.001 | -0.167 ms/day | p=0.110 | 0.374 |
| Offset | BB Date | Post-BB n | Support | Level (b4) | p | Slope (b5) | p | R² |
|---|---|---|---|---|---|---|---|---|
| -3d | 2026-04-05 | 166 | supported | -6.32 bpm * | p<0.001 | -0.107 bpm/day | p=0.144 | 0.572 |
| -2d | 2026-04-06 | 165 | supported | -6.58 bpm * | p<0.001 | -0.097 bpm/day | p=0.178 | 0.581 |
| -1d | 2026-04-07 | 164 | supported | -7.27 bpm * | p<0.001 | -0.086 bpm/day | p=0.218 | 0.593 |
| +0d (actual) | 2026-04-08 | 163 | supported | -7.29 bpm * | p<0.001 | -0.074 bpm/day | p=0.280 | 0.605 |
| +1d | 2026-04-09 | 162 | supported | -7.98 bpm * | p<0.001 | -0.063 bpm/day | p=0.349 | 0.615 |
| +2d | 2026-04-10 | 162 | supported | -7.99 bpm * | p<0.001 | -0.054 bpm/day | p=0.413 | 0.615 |
| +3d | 2026-04-11 | 161 | supported | -7.75 bpm * | p<0.001 | -0.039 bpm/day | p=0.552 | 0.618 |
| Offset | BB Date | Post-BB n | Support | Level (b4) | p | Slope (b5) | p | R² |
|---|---|---|---|---|---|---|---|---|
| -3d | 2026-04-05 | 166 | supported | -5.95 bpm * | p<0.001 | -0.104 bpm/day | p=0.193 | 0.519 |
| -2d | 2026-04-06 | 165 | supported | -6.06 bpm * | p<0.001 | -0.096 bpm/day | p=0.224 | 0.527 |
| -1d | 2026-04-07 | 164 | supported | -6.99 bpm * | p<0.001 | -0.088 bpm/day | p=0.253 | 0.541 |
| +0d (actual) | 2026-04-08 | 163 | supported | -6.98 bpm * | p<0.001 | -0.077 bpm/day | p=0.304 | 0.554 |
| +1d | 2026-04-09 | 162 | supported | -7.94 bpm * | p<0.001 | -0.068 bpm/day | p=0.354 | 0.567 |
| +2d | 2026-04-10 | 162 | supported | -7.95 bpm * | p<0.001 | -0.060 bpm/day | p=0.408 | 0.567 |
| +3d | 2026-04-11 | 161 | supported | -7.57 bpm * | p<0.001 | -0.045 bpm/day | p=0.532 | 0.569 |
| Offset | BB Date | Post-BB n | Support | Level (b4) | p | Slope (b5) | p | R² |
|---|---|---|---|---|---|---|---|---|
| -3d | 2026-04-05 | 166 | supported | -0.38 % | p=0.693 | -0.029 %/day | p=0.611 | 0.150 |
| -2d | 2026-04-06 | 165 | supported | +0.07 % | p=0.942 | -0.029 %/day | p=0.608 | 0.150 |
| -1d | 2026-04-07 | 164 | supported | +0.07 % | p=0.944 | -0.031 %/day | p=0.586 | 0.150 |
| +0d (actual) | 2026-04-08 | 163 | supported | +0.21 % | p=0.825 | -0.032 %/day | p=0.567 | 0.150 |
| +1d | 2026-04-09 | 162 | supported | +0.72 % | p=0.451 | -0.033 %/day | p=0.557 | 0.152 |
| +2d | 2026-04-10 | 162 | supported | +0.70 % | p=0.465 | -0.036 %/day | p=0.522 | 0.152 |
| +3d | 2026-04-11 | 161 | supported | +0.40 % | p=0.676 | -0.040 %/day | p=0.467 | 0.152 |