help > repeat measures, multiple group comparison
Showing 1-8 of 8 posts
Aug 19, 2017 01:08 PM | Jaykumar Grandhi - Cleveland Clinic Foundation
repeat measures, multiple group comparison
Hello!
Thanks for designing this helpful program. I asked a question earlier and got some very helpful feedback, so thank you for that as well
I need some help with preparing the DM, blocks, and contrast for 2 study paradigms.
My study contains:
90 subjects, 3 groups (or 2 groups, depending on hypothesis tested), and 2 measures.
Thanks for designing this helpful program. I asked a question earlier and got some very helpful feedback, so thank you for that as well
I need some help with preparing the DM, blocks, and contrast for 2 study paradigms.
My study contains:
90 subjects, 3 groups (or 2 groups, depending on hypothesis tested), and 2 measures.
Demonstrating using 3 subjects to save
space, the following design has been working beautifully to show a
difference between the measures(t-test):
_______________________________________________________
time1 = 1
const time2 =-1
subj1 1 1
subj2 1 1
subj3 1 1
subj1 1 -1
subj2 1 -1
subj3 1 -1
contrast 0 1
exchangeblocks 1 2 3 1 2 3
_______________________________________________________
_______________________________________________________
time1 = 1
const time2 =-1
subj1 1 1
subj2 1 1
subj3 1 1
subj1 1 -1
subj2 1 -1
subj3 1 -1
contrast 0 1
exchangeblocks 1 2 3 1 2 3
_______________________________________________________
Now I need to compare the (time1-time2)
repeated measures from group 1 to group (2 or 3), and additionally
to compare all three. Will the following work?
1. Repeated measures, comparing
(group 1 - group 2): t-test.
_______________________________________________________
time1 = 1 group1
const time2 =-1 group(2or3)
subj1 1 1 1
subj2 1 1 1
subj3 1 1 -2
subj1 1 -1 1
subj2 1 -1 1
subj3 1 -1 -2
contrast 0 0 1
exchangeblocks 1 2 3 1 2 3
_______________________________________________________
2. Repeated measures, (group 1 = group 2 = group 3): f-test
_______________________________________________________
time1 = 1 group1 group2
const time2 =-1 group3 group3
subj1 1 1 1 0
subj2 1 1 0 1
subj3 1 1 0 0
subj1 1 -1 1 0
subj2 1 -1 0 1
subj3 1 -1 0 0
contrast 0 0 1 1
exchangeblocks 1 2 3 1 2 3
_______________________________________________________
time1 = 1 group1
const time2 =-1 group(2or3)
subj1 1 1 1
subj2 1 1 1
subj3 1 1 -2
subj1 1 -1 1
subj2 1 -1 1
subj3 1 -1 -2
contrast 0 0 1
exchangeblocks 1 2 3 1 2 3
_______________________________________________________
2. Repeated measures, (group 1 = group 2 = group 3): f-test
_______________________________________________________
time1 = 1 group1 group2
const time2 =-1 group3 group3
subj1 1 1 1 0
subj2 1 1 0 1
subj3 1 1 0 0
subj1 1 -1 1 0
subj2 1 -1 0 1
subj3 1 -1 0 0
contrast 0 0 1 1
exchangeblocks 1 2 3 1 2 3
_______________________________________________________
Thanks so much for the help!
Jay
Aug 21, 2017 11:08 AM | Andrew Zalesky
repeated measures
Hi Jay,
these designs are not quite correct.
In the first case, subject means should be modeled as follows:
subj1 1 1 1 0 0
subj2 1 1 0 1 0
subj3 1 1 0 0 1
subj1 1 -1 1 0 0
subj2 1 -1 0 1 0
subj3 1 -1 0 0 1
contrast 0 1 0 0 0
exchangeblocks 1 2 3 1 2 3
Note that I have added 3 columns to the design matrix (one for each subject) to account for within-subjects means (repeated measures).
The first column of 1's should be removed in this case.
Regarding the second design, it is not clear to me what you are trying to test. What is the null hypothesis? I think you are interested in a 2 x 2 ANOVA with repeated measures on one factor.
these designs are not quite correct.
In the first case, subject means should be modeled as follows:
subj1 1 1 1 0 0
subj2 1 1 0 1 0
subj3 1 1 0 0 1
subj1 1 -1 1 0 0
subj2 1 -1 0 1 0
subj3 1 -1 0 0 1
contrast 0 1 0 0 0
exchangeblocks 1 2 3 1 2 3
Note that I have added 3 columns to the design matrix (one for each subject) to account for within-subjects means (repeated measures).
The first column of 1's should be removed in this case.
Regarding the second design, it is not clear to me what you are trying to test. What is the null hypothesis? I think you are interested in a 2 x 2 ANOVA with repeated measures on one factor.
Aug 22, 2017 02:08 PM | Jaykumar Grandhi - Cleveland Clinic Foundation
RE: repeated measures
Thanks for the quick response and the correction! I wonder
why I as getting significant results with the wrong model? I ran it
again with the model you outlined and it looks even better!
I am now doing:
Case 1:
Ho: T1-T2 > 0
T1= 1 subj1subj3
T2=-1 subj2
subj1 1 1 0 0
subj2 1 0 1 0
subj3 1 0 0 1
subj1 -1 1 0 0
subj2 -1 0 1 0
subj3 -1 0 0 1
contrast 1 0 0 0
exchangeblocks 1 2 3 1 2 3
t-test
______________________________________________________
Case 2: Thanks for directing me to the 2x2 ANOVA, I think it is exactly what I am looking for. I'd like to show the difference between groups in their treatment response (T1-T2). I think what I would be looking for here is the 'interaction term' between the 2 independent variables of group and time. Would it look like this?
Case 1:
Ho: (T1-T2)gp1 - (T1-T2)gp2 > 0 ... not sure if this is how to write it
T1= 1 gp1=2 Tgp subj1subj3
T2=-1 gp2=-1 subj2
subj1 1 2 2 1 0 0
subj2 1 -1 -1 0 1 0
subj3 1 -1 -1 0 0 1
subj1 -1 2 -2 1 0 0
subj2 -1 -1 1 0 1 0
subj3 -1 -1 1 0 0 1
contrast 0 0 1 0 0 0
exchangeblocks 1 2 3 1 2 3
f-test
Thanks again!
Case 1:
Ho: T1-T2 > 0
T1= 1 subj1subj3
T2=-1 subj2
subj1 1 1 0 0
subj2 1 0 1 0
subj3 1 0 0 1
subj1 -1 1 0 0
subj2 -1 0 1 0
subj3 -1 0 0 1
contrast 1 0 0 0
exchangeblocks 1 2 3 1 2 3
t-test
______________________________________________________
Case 2: Thanks for directing me to the 2x2 ANOVA, I think it is exactly what I am looking for. I'd like to show the difference between groups in their treatment response (T1-T2). I think what I would be looking for here is the 'interaction term' between the 2 independent variables of group and time. Would it look like this?
Case 1:
Ho: (T1-T2)gp1 - (T1-T2)gp2 > 0 ... not sure if this is how to write it
T1= 1 gp1=2 Tgp subj1subj3
T2=-1 gp2=-1 subj2
subj1 1 2 2 1 0 0
subj2 1 -1 -1 0 1 0
subj3 1 -1 -1 0 0 1
subj1 -1 2 -2 1 0 0
subj2 -1 -1 1 0 1 0
subj3 -1 -1 1 0 0 1
contrast 0 0 1 0 0 0
exchangeblocks 1 2 3 1 2 3
f-test
Thanks again!
Aug 23, 2017 01:08 AM | Andrew Zalesky
RE: repeated measures
Hi Jay,
Case 1 looks ok now.
For case 2 (2 x 2 ANOVA with repeated measures on one factor), consider the following: Lets assume C1T1 denotes control subject 1 at time point 1 and P1T1 denotes patient 1 and time point 1. We have two main effects: patient or control (main effect 1); and time point 1 or 2 (main effect 2, repeated measured). You are interested in the interaction between these two main effects.
Design Matrix:
C1T1 0 1 1 0 0 0
C1T2 1 0 1 0 0 0
C2T1 0 1 0 1 0 0
C2T2 1 0 0 1 0 0
P1T1 0 0 0 0 1 0
P1T2 1 1 0 0 1 0
P2T1 0 0 0 0 0 1
P2T2 1 1 0 0 0 1
First column is main effect of time, 2nd column is interaction between group and time, last 4 columns are subject means.
Note that we do not model the main effect of group in the design matrix (otherwise it would be rank deficient).
Contrast (for interaction)
0 1 0 0 0 0
or: 0 -1 0 0 0 0
Exchange blocks
1 1 2 2 3 3 4 4
t-test (or you can select F-test with the first contrast)
Andrew
Originally posted by Jaykumar Grandhi:
Case 1 looks ok now.
For case 2 (2 x 2 ANOVA with repeated measures on one factor), consider the following: Lets assume C1T1 denotes control subject 1 at time point 1 and P1T1 denotes patient 1 and time point 1. We have two main effects: patient or control (main effect 1); and time point 1 or 2 (main effect 2, repeated measured). You are interested in the interaction between these two main effects.
Design Matrix:
C1T1 0 1 1 0 0 0
C1T2 1 0 1 0 0 0
C2T1 0 1 0 1 0 0
C2T2 1 0 0 1 0 0
P1T1 0 0 0 0 1 0
P1T2 1 1 0 0 1 0
P2T1 0 0 0 0 0 1
P2T2 1 1 0 0 0 1
First column is main effect of time, 2nd column is interaction between group and time, last 4 columns are subject means.
Note that we do not model the main effect of group in the design matrix (otherwise it would be rank deficient).
Contrast (for interaction)
0 1 0 0 0 0
or: 0 -1 0 0 0 0
Exchange blocks
1 1 2 2 3 3 4 4
t-test (or you can select F-test with the first contrast)
Andrew
Originally posted by Jaykumar Grandhi:
Thanks for the quick response and the
correction! I wonder why I as getting significant results
with the wrong model? I ran it again with the model you outlined
and it looks even better! I am now doing:
Case 1:
Ho: T1-T2 > 0
T1= 1 subj1subj3
T2=-1 subj2
subj1 1 1 0 0
subj2 1 0 1 0
subj3 1 0 0 1
subj1 -1 1 0 0
subj2 -1 0 1 0
subj3 -1 0 0 1
contrast 1 0 0 0
exchangeblocks 1 2 3 1 2 3
t-test
______________________________________________________
Case 2: Thanks for directing me to the 2x2 ANOVA, I think it is exactly what I am looking for. I'd like to show the difference between groups in their treatment response (T1-T2). I think what I would be looking for here is the 'interaction term' between the 2 independent variables of group and time. Would it look like this?
Case 1:
Ho: (T1-T2)gp1 - (T1-T2)gp2 > 0 ... not sure if this is how to write it
T1= 1 gp1=2 Tgp subj1subj3
T2=-1 gp2=-1 subj2
subj1 1 2 2 1 0 0
subj2 1 -1 -1 0 1 0
subj3 1 -1 -1 0 0 1
subj1 -1 2 -2 1 0 0
subj2 -1 -1 1 0 1 0
subj3 -1 -1 1 0 0 1
contrast 0 0 1 0 0 0
exchangeblocks 1 2 3 1 2 3
f-test
Thanks again!
Case 1:
Ho: T1-T2 > 0
T1= 1 subj1subj3
T2=-1 subj2
subj1 1 1 0 0
subj2 1 0 1 0
subj3 1 0 0 1
subj1 -1 1 0 0
subj2 -1 0 1 0
subj3 -1 0 0 1
contrast 1 0 0 0
exchangeblocks 1 2 3 1 2 3
t-test
______________________________________________________
Case 2: Thanks for directing me to the 2x2 ANOVA, I think it is exactly what I am looking for. I'd like to show the difference between groups in their treatment response (T1-T2). I think what I would be looking for here is the 'interaction term' between the 2 independent variables of group and time. Would it look like this?
Case 1:
Ho: (T1-T2)gp1 - (T1-T2)gp2 > 0 ... not sure if this is how to write it
T1= 1 gp1=2 Tgp subj1subj3
T2=-1 gp2=-1 subj2
subj1 1 2 2 1 0 0
subj2 1 -1 -1 0 1 0
subj3 1 -1 -1 0 0 1
subj1 -1 2 -2 1 0 0
subj2 -1 -1 1 0 1 0
subj3 -1 -1 1 0 0 1
contrast 0 0 1 0 0 0
exchangeblocks 1 2 3 1 2 3
f-test
Thanks again!
Aug 23, 2017 05:08 PM | Jaykumar Grandhi - Cleveland Clinic Foundation
RE: repeated measures
Andrew,
I see! yes that makes sense. Thank you for explaining.
3 additional questions:
1) you note that the F-test will work for the positive contrast and t-test will work for either. Is this because a t-test and f-test are essentially the same thing when comparing just 2 groups? And a negative contrast doesn't make sense in the f-test because it measures variance?
2) I have unequal sample sizes for the 2 groups. one group has 33 patients and the other has 57. Will I need to adjust the model?
3) I have some nuissance variables to also add. Can put them in the last column with a corresponding contrast of '0'?
Thanks again,
J
I see! yes that makes sense. Thank you for explaining.
3 additional questions:
1) you note that the F-test will work for the positive contrast and t-test will work for either. Is this because a t-test and f-test are essentially the same thing when comparing just 2 groups? And a negative contrast doesn't make sense in the f-test because it measures variance?
2) I have unequal sample sizes for the 2 groups. one group has 33 patients and the other has 57. Will I need to adjust the model?
3) I have some nuissance variables to also add. Can put them in the last column with a corresponding contrast of '0'?
Thanks again,
J
Aug 23, 2017 11:08 PM | Andrew Zalesky
RE: repeated measures
1. F is two-sided. t is
one-sided. Details in manual.
2. Yes - number of rows must equal number of subjects.
3. Yes. Details in manual.
Originally posted by Jaykumar Grandhi:
2. Yes - number of rows must equal number of subjects.
3. Yes. Details in manual.
Originally posted by Jaykumar Grandhi:
Andrew,
I see! yes that makes sense. Thank you for explaining.
3 additional questions:
1) you note that the F-test will work for the positive contrast and t-test will work for either. Is this because a t-test and f-test are essentially the same thing when comparing just 2 groups? And a negative contrast doesn't make sense in the f-test because it measures variance?
2) I have unequal sample sizes for the 2 groups. one group has 33 patients and the other has 57. Will I need to adjust the model?
3) I have some nuissance variables to also add. Can put them in the last column with a corresponding contrast of '0'?
Thanks again,
J
I see! yes that makes sense. Thank you for explaining.
3 additional questions:
1) you note that the F-test will work for the positive contrast and t-test will work for either. Is this because a t-test and f-test are essentially the same thing when comparing just 2 groups? And a negative contrast doesn't make sense in the f-test because it measures variance?
2) I have unequal sample sizes for the 2 groups. one group has 33 patients and the other has 57. Will I need to adjust the model?
3) I have some nuissance variables to also add. Can put them in the last column with a corresponding contrast of '0'?
Thanks again,
J
Sep 5, 2017 06:09 PM | Jaykumar Grandhi - Cleveland Clinic Foundation
RE: repeated measures
Hi Andrew,
Thanks for the help! How would I structure the inputs if I wanted the following null hypotheses:
Ho(1) CT2 = CT1
Ho(2) CT1 = PT1
I was reading about the cell mean method and came up with the following: (C-control, P-patient)
Design
CT1 CT2 PT1 PT2
C1T1 1 0 0 0
C1T2 0 1 0 0
C2T1 1 0 0 0
C2T2 0 1 0 0
P1T2 0 0 1 0
P1T2 0 0 0 1
P2T1 0 0 1 0
P2T2 0 0 0 1
and then the contrast would be:
Ho(1) contrast [1 -1 0 0]
Ho(2) contrast [1 0 -1 0]
I understand that I cannot subtract the within-subject means due to rank deficiency.
Is it appropriate to still use exchange blocks as such: 1 1 2 2 3 3 4 4?
Thanks!
Thanks for the help! How would I structure the inputs if I wanted the following null hypotheses:
Ho(1) CT2 = CT1
Ho(2) CT1 = PT1
I was reading about the cell mean method and came up with the following: (C-control, P-patient)
Design
CT1 CT2 PT1 PT2
C1T1 1 0 0 0
C1T2 0 1 0 0
C2T1 1 0 0 0
C2T2 0 1 0 0
P1T2 0 0 1 0
P1T2 0 0 0 1
P2T1 0 0 1 0
P2T2 0 0 0 1
and then the contrast would be:
Ho(1) contrast [1 -1 0 0]
Ho(2) contrast [1 0 -1 0]
I understand that I cannot subtract the within-subject means due to rank deficiency.
Is it appropriate to still use exchange blocks as such: 1 1 2 2 3 3 4 4?
Thanks!
Sep 6, 2017 02:09 AM | Andrew Zalesky
RE: repeated measures
Hi Jay,
I assume you mean by CT2=CT1 the null hypothesis of controls do not differ between the two time points.
In the case, you can use a standard repeated measures t-test and exclude the patients from the analysis completely.
There is an example of a repeated measures t-test in the Help menu.
For the null of CT1=PT1, this is a standard t-test. No need for exchange blocks here and your design matrix will just have two columns.
I hope this is clear.
Andrew
Originally posted by Jaykumar Grandhi:
I assume you mean by CT2=CT1 the null hypothesis of controls do not differ between the two time points.
In the case, you can use a standard repeated measures t-test and exclude the patients from the analysis completely.
There is an example of a repeated measures t-test in the Help menu.
For the null of CT1=PT1, this is a standard t-test. No need for exchange blocks here and your design matrix will just have two columns.
I hope this is clear.
Andrew
Originally posted by Jaykumar Grandhi:
Hi Andrew,
Thanks for the help! How would I structure the inputs if I wanted the following null hypotheses:
Ho(1) CT2 = CT1
Ho(2) CT1 = PT1
I was reading about the cell mean method and came up with the following: (C-control, P-patient)
Design
CT1 CT2 PT1 PT2
C1T1 1 0 0 0
C1T2 0 1 0 0
C2T1 1 0 0 0
C2T2 0 1 0 0
P1T2 0 0 1 0
P1T2 0 0 0 1
P2T1 0 0 1 0
P2T2 0 0 0 1
and then the contrast would be:
Ho(1) contrast [1 -1 0 0]
Ho(2) contrast [1 0 -1 0]
I understand that I cannot subtract the within-subject means due to rank deficiency.
Is it appropriate to still use exchange blocks as such: 1 1 2 2 3 3 4 4?
Thanks!
Thanks for the help! How would I structure the inputs if I wanted the following null hypotheses:
Ho(1) CT2 = CT1
Ho(2) CT1 = PT1
I was reading about the cell mean method and came up with the following: (C-control, P-patient)
Design
CT1 CT2 PT1 PT2
C1T1 1 0 0 0
C1T2 0 1 0 0
C2T1 1 0 0 0
C2T2 0 1 0 0
P1T2 0 0 1 0
P1T2 0 0 0 1
P2T1 0 0 1 0
P2T2 0 0 0 1
and then the contrast would be:
Ho(1) contrast [1 -1 0 0]
Ho(2) contrast [1 0 -1 0]
I understand that I cannot subtract the within-subject means due to rank deficiency.
Is it appropriate to still use exchange blocks as such: 1 1 2 2 3 3 4 4?
Thanks!