Announcement

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

  • Interrupted time series with control outcome (non-equivalent dependent variable)

    Dear Statlisters.

    I have a time series dataset consisting of three variables: time_period (range 1-56), A (dependent variable, rate of antibiotic prescriptions) and B (control/non-equivalent dependent variable, a rate of prescriptions of another antibiotic). Both my variables are measured in the same population within the same time period.

    Extract from dataset:

    input float(time_period A B)
    1 45.78904 8.830744
    2 46.38866 8.122104
    3 44.0447 9.648406
    4 43.0635 10.68411
    5 53.36604 10.575089

    I want to perform an interrupted time series with two interventions (intervention 1 in time_period 27 and intervention 2 in time_period 34) with A as dependent variable and B as control variable.
    I have run the code for a single series itsa with the two interventions, and it works well:

    tsset time_period
    itsa A, single trperiod(27 34) lag(1) fig posttrend replace

    However, I run into trouble when trying to add the control series. As I understand the itsa command there are two ways to code this. Either ommit single from the code and let all other series (than A) be control (which should work out here because I only have two series), or to specify the control series in the code:

    Syntax for multi-group ITSA: itsa depvar indepvars if in weight , trperiod(numlist) single treatid(#) contid(numlist) prais lag(#) figure posttrend replace prefix(string) model options

    Either way, I have concluded that I probably have to make a dummy variable indicating treatment status, with 1 for dependent variable/A and 0 for control variable/B to be able to run this code. And here is where it stops for me. I have tried every way I know to make this dummy variable, but I cannot seem to make a code that will achieve what I desire.

    This might be a simple question with a simple answer, but I have searched everywhere I can think of to figure it out.

    If anyone can assist me on this matter it will be highly appreciated
Working...
X