I am trying to model the effect of one or more discrete interventions (e.g., taking a pill, attending therapy) on a continuous outcome (e.g., pain level of a patient over time). The features are discrete binary events in time series. Here's an example of how the data might look:
timestamp took_pill attended_phys_therapy pain_level
------------------------------------------------------------------
1 4.1
2 true 4.0
3 4.2
4 3.1
5 true 2.8
6 2.6
7 2.3
8 2.4
In this simple example, I'm trying to capture the fact that the interventions (the subject took a pill) at time t=2 led to a change in pain at time t={4..6}.
Here are some options I am considering:
Apply a decay function (e.g., Gaussian, exponential) to the binary events to create a continuous feature (took_pill_decayed), and do time lag regression of pain_level ~ took_pill_decayed + attended_phys_therapy_decayed
Aggregate both indep and dep variables to longer time windows that would capture both the event and the outcome (say, 6-hour windows). Make a "sliding window" for each time step.
A few additional notes/assumptions:
The effects of the interventions are non-permanent. I've looked into ITS (interrupted time series analysis) and paired t-test analyses . However, these seem to be tailored towards semi-permanent interventions such as economic policy changes.
Ideally, I would also like to understand how long after an intervention the outcome was influenced, not just whether it influenced it.
Would love any suggestions!