Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Data structure considerations for interrupted time series analysis

    Dear all,

    I am looking at a policy's impact on a person's hours spent on a program (lognr). The data set included person-month level observations from 2014 to 2019, below is a snapshot of the first few observations. The policy was implemented Jan 2016. So I have a binary variable "post" indicating post-intervention, month_nu is a count variable for the month from the start of the observation period (March 2014), ranging from 1 to 57, and postime is a count variable for the month after the intervention, ranging from 0 to 35.
    id month_nu month year post postime lognr
    1 22 1 2016 1 0 5.452146
    1 23 2 2016 1 1 5.477448
    2 5 8 2014 0 0 9.318163
    3 24 3 2016 1 2 6.293419
    3 25 4 2016 1 3 6.057523
    3 26 5 2016 1 4 5.452146
    3 27 6 2016 1 5 5.70711
    3 28 7 2016 1 6 5.198497
    3 35 2 2016 1 13 8.412055
    3 36 3 2016 1 14 0
    4 49 4 2018 1 27 7.591357
    5 15 6 2015 0 0 9.335924
    6 12 3 2015 0 0 8.937678
    6 13 4 2015 0 0 9.244839
    7 22 1 2016 1 0 7.151485
    7 23 2 2016 1 1 6.768454
    7 24 3 2016 1 2 6.288038
    7 25 4 2016 1 3 6.447306
    7 26 5 2016 1 4 6.173853
    7 27 6 2016 1 5 6.320768
    7 28 7 2016 1 6 4.731803
    8 33 12 2017 1 11 7.650169
    8 34 1 2017 1 12 6.459122
    9 16 7 2015 0 0 9.335924
    I have 4 questions about running interrupted time series based on my data:
    1. A person may have gaps in the month variable, because a person may leave the program and re-enroll (e.g., id=3). Would this be a concern in running interrupted time series?
    2. As you can see in the example, the data is very unbalanced. Would this be an issue?
    3. when I ran this model with person fixed effects, the postime variable was omitted due to collinearity. I also tried estimating the interaction between post and month_nu, interaction items were also ommitted. This makes me wonder if I constructed the data wrong

    reg lognr post i.month_nu i.postime, absorb(bene_id_18900)
    note: 57.month_nu omitted because of collinearity.
    note: 1.postime omitted because of collinearity.
    note: 2.postime omitted because of collinearity.
    note: 3.postime omitted because of collinearity.
    note: 4.postime omitted because of collinearity.
    note: 5.postime omitted because of collinearity.
    note: 6.postime omitted because of collinearity.
    note: 7.postime omitted because of collinearity.
    note: 8.postime omitted because of collinearity.
    note: 9.postime omitted because of collinearity.
    note: 10.postime omitted because of collinearity.
    note: 11.postime omitted because of collinearity.
    note: 12.postime omitted because of collinearity.
    note: 13.postime omitted because of collinearity.
    note: 14.postime omitted because of collinearity.
    note: 15.postime omitted because of collinearity.
    note: 16.postime omitted because of collinearity.
    note: 17.postime omitted because of collinearity.
    note: 18.postime omitted because of collinearity.
    note: 19.postime omitted because of collinearity.
    note: 20.postime omitted because of collinearity.
    note: 21.postime omitted because of collinearity.
    note: 22.postime omitted because of collinearity.
    note: 23.postime omitted because of collinearity.
    note: 24.postime omitted because of collinearity.
    note: 25.postime omitted because of collinearity.
    note: 26.postime omitted because of collinearity.
    note: 27.postime omitted because of collinearity.
    note: 28.postime omitted because of collinearity.
    note: 29.postime omitted because of collinearity.
    note: 30.postime omitted because of collinearity.
    note: 31.postime omitted because of collinearity.
    note: 32.postime omitted because of collinearity.
    note: 33.postime omitted because of collinearity.
    note: 34.postime omitted because of collinearity.
    note: 35.postime omitted because of collinearity.

    Linear regression, absorbing indicators Number of obs = 756,090
    F(57, 583947) = 57.26
    Prob > F = 0.0000
    R-squared = 0.5819
    Adj R-squared = 0.4586
    Root MSE = .91965

    ------------------------------------------------------------------------------
    lognr | Coefficient Std. err. t P>|t| [95% conf. interval]
    -------------+----------------------------------------------------------------
    post | .4232109 .0173184 24.44 0.000 .3892673 .4571544
    |
    month_nu |
    1 | .1417533 .0135981 10.42 0.000 .1151014 .1684051
    2 | .1059786 .0140503 7.54 0.000 .0784405 .1335166
    3 | .1326668 .0143079 9.27 0.000 .1046237 .16071
    4 | .1713529 .0144687 11.84 0.000 .1429947 .1997111
    5 | .1295269 .014602 8.87 0.000 .1009074 .1581463
    6 | .2276912 .0147316 15.46 0.000 .1988177 .2565646
    7 | .2283748 .0148195 15.41 0.000 .1993292 .2574205
    8 | .0778554 .0149922 5.19 0.000 .0484711 .1072397
    9 | .2757938 .0151173 18.24 0.000 .2461644 .3054231
    10 | .2665129 .0150689 17.69 0.000 .2369783 .2960474
    11 | .2454189 .0151806 16.17 0.000 .2156654 .2751725
    12 | .2912395 .0151577 19.21 0.000 .2615308 .3209482
    13 | .2891548 .0152158 19.00 0.000 .2593323 .3189773
    14 | .2124447 .0152697 13.91 0.000 .1825166 .2423728
    15 | .2830509 .0153282 18.47 0.000 .2530081 .3130938
    16 | .2503669 .0153477 16.31 0.000 .2202858 .280448
    17 | .1999821 .0154207 12.97 0.000 .169758 .2302062
    18 | .2717751 .0154475 17.59 0.000 .2414984 .3020517
    19 | .2378721 .0155018 15.34 0.000 .2074891 .2682552
    20 | .2315162 .0156309 14.81 0.000 .2008801 .2621523
    21 | .3139541 .0156872 20.01 0.000 .2832078 .3447005
    22 | -.1803032 .0150555 -11.98 0.000 -.2098116 -.1507949
    23 | -.0698333 .0149635 -4.67 0.000 -.0991612 -.0405053
    24 | -.0214595 .0148515 -1.44 0.148 -.050568 .0076491
    25 | -.0803024 .0147719 -5.44 0.000 -.1092549 -.0513499
    26 | -.106384 .0146912 -7.24 0.000 -.1351782 -.0775897
    27 | -.0168029 .0146296 -1.15 0.251 -.0454765 .0118706
    28 | -.1243798 .0145748 -8.53 0.000 -.1529459 -.0958137
    29 | -.0150378 .0145146 -1.04 0.300 -.043486 .0134104
    30 | -.0459414 .0144849 -3.17 0.002 -.0743313 -.0175514
    31 | -.0750275 .0144568 -5.19 0.000 -.1033623 -.0466927
    32 | -.0349116 .014475 -2.41 0.016 -.0632821 -.006541
    33 | -.0338533 .0144526 -2.34 0.019 -.0621798 -.0055267
    34 | .0202339 .0142953 1.42 0.157 -.0077845 .0482523
    35 | .019503 .0142198 1.37 0.170 -.0083674 .0473734
    36 | .0680086 .0140718 4.83 0.000 .0404284 .0955888
    37 | -.0375247 .0140236 -2.68 0.007 -.0650104 -.010039
    38 | .0363259 .0139443 2.61 0.009 .0089955 .0636563
    39 | .0536832 .0138531 3.88 0.000 .0265315 .0808349
    40 | -.044161 .0138092 -3.20 0.001 -.0712265 -.0170954
    41 | .0556618 .0137686 4.04 0.000 .0286757 .0826478
    42 | -.0075407 .0137519 -0.55 0.583 -.034494 .0194126
    43 | .0691815 .013711 5.05 0.000 .0423083 .0960547
    44 | .0811058 .0137032 5.92 0.000 .054248 .1079636
    45 | .0327677 .013697 2.39 0.017 .005922 .0596134
    46 | .1568503 .0134656 11.65 0.000 .1304582 .1832425
    47 | .1165342 .0133838 8.71 0.000 .0903023 .1427661
    48 | .1161287 .013201 8.80 0.000 .0902551 .1420022
    49 | .0916526 .0130999 7.00 0.000 .0659773 .1173279
    50 | .1332971 .0129758 10.27 0.000 .1078648 .1587293
    51 | .1014378 .0128735 7.88 0.000 .0762061 .1266695
    52 | .0917984 .0127491 7.20 0.000 .0668106 .1167863
    53 | .1412905 .0126113 11.20 0.000 .1165727 .1660082
    54 | .0290632 .0124987 2.33 0.020 .0045663 .0535602
    55 | .1766851 .0122573 14.41 0.000 .1526611 .200709
    56 | .1144995 .0118941 9.63 0.000 .0911875 .1378116
    57 | 0 (omitted)
    |
    postime |
    1 | 0 (omitted)
    2 | 0 (omitted)
    3 | 0 (omitted)
    4 | 0 (omitted)
    5 | 0 (omitted)
    6 | 0 (omitted)
    7 | 0 (omitted)
    8 | 0 (omitted)
    9 | 0 (omitted)
    10 | 0 (omitted)
    11 | 0 (omitted)
    12 | 0 (omitted)
    13 | 0 (omitted)
    14 | 0 (omitted)
    15 | 0 (omitted)
    16 | 0 (omitted)
    17 | 0 (omitted)
    18 | 0 (omitted)
    19 | 0 (omitted)
    20 | 0 (omitted)
    21 | 0 (omitted)
    22 | 0 (omitted)
    23 | 0 (omitted)
    24 | 0 (omitted)
    25 | 0 (omitted)
    26 | 0 (omitted)
    27 | 0 (omitted)
    28 | 0 (omitted)
    29 | 0 (omitted)
    30 | 0 (omitted)
    31 | 0 (omitted)
    32 | 0 (omitted)
    33 | 0 (omitted)
    34 | 0 (omitted)
    35 | 0 (omitted)
    |
    _cons | 5.786728 .0123437 468.80 0.000 5.762535 5.810921
    ------------------------------------------------------------------------------
    4. I did try using xtitsa and the model went through. But I can't figure out run interrupted time series with the regression above
    gen date = ym(year, month)
    format date %tm
    tsset id date
    xtitsa lognr, single treat(post) trperiod(2016m1) vce(robust) posttrend figure

    I feel like I'm missing something basic. Any suggestion is greatly appreciated!
    Thanks in advance!
Working...
X