# Modeling stimulus-response output

I am trying to analyse some data and I am a bit lost as to what is the correct approach to take.

The data are blood hormone levels, taken repeatedly from various subjects, after a certain treatment, which is given at 10', after 2 control samples are taken at time 0' and 10'.

So essentially I have some data that looks like this:

time <- c(0, 10, 20, 30, 45, 60)
response.1 <- c(8, 10, 66, 70, 30, 12)
response.2 <- c(5, 2, 20, 30, 10, 12)
response.3 <- c(10, 8, 80, 70, 40, 22)


As you can see the levels are low for the first two control points, then the stimulus is applied, the levels quickly rise and then slowly descend back to baseline over time.

I am a bit stuck as to how to model such a situation, especially what I am not sure how to include in the model is the fact that not all the points are equal in terms of exposure to the stimulus (for the first two points the subject did not have the stimulus at all, and the others are at different points in time after the stimulus).

The ultimate goal of this analysis would be to tell whether the response is the same for all of the subjects or not (depending on other factors that I will, of course, include in my model). In the example above, subject 2 had a very reduced response.

I would approach this in terms of a response trajectory whereby you can explicilty examine 1) any change in the mean level pre-to-post and 2) any change in the slope/curve before and after the stimulus. I have used multilevel models to do this in the past. The level 1 model is set up as an interupted time series and the variation in the pre-to-post change is examined at level 2 (i.e. treatment group memebership).

Think about it as a segmented regression, with each segment representing the pre- and post-treatment periods. This would be the level 1 model:

Yt= bo+ b1T + b2D + b3P + e

Level 2 models:

b2 = g2 + (person factors) + u2

b3 = g3 + (person factors) + u3

T is time from the start of the observational period; it is represented by a Continuous variable beginning at 1. b1 is the slope pre-treatment.

D is a dummy variable for pre or post intervention; Coded 0 prior to intervention, 1 post intervention. b2 is the change in level post-treatment.

P is time since the intervention; Prior to intervention coded 0. Post intervention; continuous starting at 1. b3 is the change in slope post-treatment.

g2/3 is the grand mean of these effects and ut2/3 is the error in these models.

In a mixed model, b2 and b3 could be specified as random effects; which you can model to see if person level factors explain the variation in the effects of the treatment.

• Interesting thoughts, if you have some time could you expand a little more (a practical example would be great) – nico May 1 '13 at 9:20
• Great, thank you very much for the edit! I will wait to see whether other answers show up before accepting – nico May 1 '13 at 14:44