Well, I am getting jealous by all of the posting on this topic. I have my own power calculation that I need to run and thought I would see if you all could provide a little guidance. I haven't done one for MLM data before.
Study:
-Two treatments groups (Treatment1 = Tx1; Treatment2 = Tx2)
- 30 subjects (#subjects)
- Crossover design: each subject will receive each treatment five times then the other treatment. Subjects treatment order is balanced via randomization.
- Outcome: continuous variable (DV), 5 serial measures for Tx1 and 5 serial measures for treatment Tx2, order of serial Tx randomized
Assumptions:
Tx1_1 will have an effect on DV of rnorm(#subject, 25, 5) and the value will go down with each Tx1 application, so autoregressive correlation across 5 serial measures
Tx2_1 will have an effect on DV of Tx1_1 + rnorm(subject#, 1.5, 0.5) and the DV value will go down with each Tx2 application, so autoregressive
correlation across 5 serial measures)
The second treatment given (either Tx1 or Tx2) will start off with an effect on DV of rnorm(subject#, 5, 1.5) lower than the first observation for the first time in the first period.
I am happy to do this in R. Below is what the dataframe could look like, these data are manually made up.
So I guess I need to write out a function, but the correlation between DV values will need to be accounted for.
Tx1_1_1 = treatment 1 first period and first timepoint
E(DV_Tx1) = (Tx1_1_1) + (AR(Tx1_1_1) +,..., (AR(Tx1_1_4), something like this gets the first period obs for Tx1
E(DV_Tx2) = (Tx1_1_1 + Tx2_1_1) + (AR(Tx2_1_1) +,..., (AR(Tx2_1_4), something like this gets the first period obs for Tx2
Then I need to add an indicator to halve of the obs if they occurred during the second period, so Tx?_2_1 will be lower.
So moreover, DV is slightly lower for Tx1 than Tx2 and the DV goes down a little with each treatment during the period, then the starting value in the second period should go down - so not a clean washout between the periods.
Getting ready to leave work, but I will check back to see if there are any comments. The autoregressive correlation with the values going down will be the interesting part.
Study:
-Two treatments groups (Treatment1 = Tx1; Treatment2 = Tx2)
- 30 subjects (#subjects)
- Crossover design: each subject will receive each treatment five times then the other treatment. Subjects treatment order is balanced via randomization.
- Outcome: continuous variable (DV), 5 serial measures for Tx1 and 5 serial measures for treatment Tx2, order of serial Tx randomized
Assumptions:
Tx1_1 will have an effect on DV of rnorm(#subject, 25, 5) and the value will go down with each Tx1 application, so autoregressive correlation across 5 serial measures
Tx2_1 will have an effect on DV of Tx1_1 + rnorm(subject#, 1.5, 0.5) and the DV value will go down with each Tx2 application, so autoregressive
correlation across 5 serial measures)
The second treatment given (either Tx1 or Tx2) will start off with an effect on DV of rnorm(subject#, 5, 1.5) lower than the first observation for the first time in the first period.
I am happy to do this in R. Below is what the dataframe could look like, these data are manually made up.
Code:
Sequence Time Period Subject Treatment DV
1 1 1 1 1 25
1 2 1 1 1 24
1 3 1 1 1 22
1 4 1 1 1 20
1 5 1 1 1 20
1 1 2 1 2 20
1 2 2 1 2 18
1 3 2 1 2 16
1 4 2 1 2 15
1 5 2 1 2 20
2 1 1 2 2 19
2 2 1 2 2 19
2 3 1 2 2 17
2 4 1 2 2 16
2 5 1 2 2 15
2 1 2 2 1 16
2 2 2 2 1 16
2 3 2 2 1 14
2 4 2 2 1 13
2 5 2 2 1 13
...
1 5 2 30 1 15
Tx1_1_1 = treatment 1 first period and first timepoint
E(DV_Tx1) = (Tx1_1_1) + (AR(Tx1_1_1) +,..., (AR(Tx1_1_4), something like this gets the first period obs for Tx1
E(DV_Tx2) = (Tx1_1_1 + Tx2_1_1) + (AR(Tx2_1_1) +,..., (AR(Tx2_1_4), something like this gets the first period obs for Tx2
Then I need to add an indicator to halve of the obs if they occurred during the second period, so Tx?_2_1 will be lower.
So moreover, DV is slightly lower for Tx1 than Tx2 and the DV goes down a little with each treatment during the period, then the starting value in the second period should go down - so not a clean washout between the periods.
Getting ready to leave work, but I will check back to see if there are any comments. The autoregressive correlation with the values going down will be the interesting part.