Announcement

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

  • Interrupted time series analysis with controls and multilevel structure

    Dear Statalist,

    I would like to do an ITS analysis to model difference in rates before and after an intervention. In my dataset I have three levels (multiple measures nested within wings nested within centre) and the intervention has been carried out in one of the two centres, therefore the intervention applies to both wings in that centre. I would like to model difference in rates before and after the intervention.
    To make this more understandable I created a fake dataset and the variables of interest would be the following:

    time var: time

    id vars: centre and wing

    intervention var: intervention

    outcome: it can either be the crude rate (perc_event) or the combination of N of events (events) and exposure (sample)

    covariate: perc_female

    I was looking at the Stata package itsa but I would like to fit an ITS model with Poisson distribution and from my understanding the itsa package is based on OLS regression. Furthermore, my data is hierarchical and the intervention is carried out at the upper level (centre). My understanding is that itsa needs data to be specified as tsset and if I type 'tsset wings time' I would have multiple measures within each time point.

    I don't think the models I specified below contain all the essential specifications (I used the combination of events + sample in this case). Also, I would like to control for autocorrelation with one lag.

    meqrpoisson events perc_female c.time##i.intervention i.wing || centre:, exp(sample) irr
    meqrpoisson events perc_female c.time##i.intervention || centre: || wing:, exp(sample) irr

    Could you please advise on how to implement this model and what might be the post hoc command to estimate the pre and post intervention trends for intervention and control?

    Thanks
    E.

    ​​​​​​
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input byte(time centre wing intervention sample events female) float(perc_female perc_event)
     1 1 1 0 33 3 18 54.55  9.09
     1 1 2 0 32 4 20  62.5  12.5
     1 2 1 0 55 2 22    40  3.64
     1 2 2 0 44 5 10 22.73 11.36
     2 1 1 0 40 4 13  32.5    10
     2 1 2 0 40 6 22    55    15
     2 2 1 0 52 2 17 32.69  3.85
     2 2 2 0 34 2 18 52.94  5.88
     3 1 1 0 37 3 21 56.76  8.11
     3 1 2 0 50 5 18    36    10
     3 2 1 0 42 7 22 52.38 16.67
     3 2 2 0 44 4 16 36.36  9.09
     4 1 1 0 40 3 16    40   7.5
     4 1 2 0 40 4 19  47.5    10
     4 2 1 0 37 2 22 59.46  5.41
     4 2 2 0 50 3 24    48     6
     5 1 1 1 33 4 26 78.79 12.12
     5 1 2 1 32 4 10 31.25  12.5
     5 2 1 1 55 6 13 23.64 10.91
     5 2 2 1 44 2 22    50  4.55
     6 1 1 1 33 2 17 51.52  6.06
     6 1 2 1 44 3 10 22.73  6.82
     6 2 1 1 40 5 13  32.5  12.5
     6 2 2 1 40 7 21  52.5  17.5
     7 1 1 1 40 3 18    45   7.5
     7 1 2 1 40 4 22    55    10
     7 2 1 1 37 2 16 43.24  5.41
     7 2 2 1 50 5 26    52    10
     8 1 1 1 52 4 10 19.23  7.69
     8 1 2 1 40 6 13  32.5    15
     8 2 1 1 52 2 20 38.46  3.85
     8 2 2 1 34 4 21 61.76 11.76
     9 1 1 1 37 3 20 54.05  8.11
     9 1 2 1 40 4 19  47.5    10
     9 2 1 1 40 2 19  47.5     5
     9 2 2 1 37 3 19 51.35  8.11
    10 1 1 1 42 4 22 52.38  9.52
    10 1 2 1 44 4 24 54.55  9.09
    10 2 1 1 48 6 26 54.17  12.5
    10 2 2 1 51 4 26 50.98  7.84
    end

  • #2
    Hi, i wondered if you got a solution to this question on multilevel models using itsa? i would like to do something similar. thanks, C

    Comment

    Working...
    X