I have data from an experiment that records the effects of stress on blood pressure.
The study went as follows:
- Participants had their blood pressure measured 4 times over ten minutes to assess their baseline blood pressure.
- Participants underwent a psychological stress task for 6 minutes, yielding 3 measures.
- Participants were assessed 4 times after the stress task to assess how they recovered from the stress task.
I've been asked to try to use piece-wise growth curve models to understand the effects of a predictor X on the stress phase and recovery phase of the study. I'm using R to do so.
However, I'm confused on how to code time for this.
Do I dummy code it to be like this where 1 indicates when we're in the baseline, stress, and recovery phases like this:
| Baseline | Stress | Recovery |
|---|---|---|
| 1 | 0 | 0 |
| 1 | 0 | 0 |
| 1 | 0 | 0 |
| 1 | 0 | 0 |
| 0 | 1 | 0 |
| 0 | 1 | 0 |
| 0 | 1 | 0 |
| 0 | 0 | 1 |
| 0 | 0 | 1 |
| 0 | 0 | 1 |
| 0 | 0 | 1 |
Or something like this where time is always incrementing?
| Baseline | Stress | Recovery |
|---|---|---|
| 0 | 0 | 0 |
| 1 | 0 | 0 |
| 2 | 0 | 0 |
| 3 | 0 | 0 |
| 3 | 1 | 0 |
| 3 | 2 | 0 |
| 3 | 3 | 0 |
| 3 | 3 | 1 |
| 3 | 3 | 2 |
| 3 | 3 | 3 |
| 3 | 3 | 4 |
Would really appreciate any help as I'm very stuck and confused.