Hi Freesurfer experts, I'm very sorry to bother you, but I am very confused with the following questions:
My experimental design includes three discrete factors: factor 1 with three levels (A,B,C ); factor 2 with three levels (O,P,Q); gender (F, M), and one covariate.
So I can get 18 classes: FAO, FAP,FAQ,FBO,FBP,FBQ,FCO,FCP,FCQ,MAO, MAP,MAQ,MBO,MBP,MBQ,MCO,MCP,MCQ. I want to perform the interaction between factor 1 and factor 2 regressing out the effect of gender and one covariate, but I don't know the rules for setting the contrasts for the F-test. The contrast matrix I used is:
1 1 1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 -1 0 1 -1 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 1 1 0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 -1 1 0 -1 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 1 1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 -1 0 1 -1 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 0 -1 1 0 -1 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
is it correct?
Any help will be very appreciated.
Best wishes,
Bo Xiang
Hi Bo,
I'm definitely not an expert of this, but I see that you really nead some help, so I tried to look at your matrix. From my humble opinion it doesn't look correct. Firstly, the first 9 groups are male groups and the last 9 are female groups. Then why are all female groups assigned 0 in the matrix? Secondly, since the interaction you are interested in have a df of 4, do you think maybe you should have 4 rows rather than 8 in your matrix?
Cherry
On Sat, Nov 17, 2012 at 9:21 PM, xiangbo_2010 xiangbo_2010@126.com wrote:
Hi Freesurfer experts,****
I'm very sorry to bother you, but I am very confused with the following questions:
My experimental design includes three discrete factors: factor 1 with three levels (A,B,C ); factor 2 with three levels (O,P,Q); gender (F, M), and one covariate.
So I can get 18 classes: FAO, FAP,FAQ,FBO,FBP,FBQ,FCO,FCP,FCQ,MAO, MAP,MAQ,MBO,MBP,MBQ,MCO,MCP,MCQ. I want to perform the interaction between factor 1 and factor 2 regressing out the effect of gender and one covariate, but I don't know the rules for setting the contrasts for the F-test. The contrast matrix I used is:
1 1 1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 -1 0 1 -1 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 1 1 0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 -1 1 0 -1 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 1 1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 -1 0 1 -1 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 0 -1 1 0 -1 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
is it correct?
Any help will be very appreciated.
Best wishes,
Bo Xiang
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Dear Cherry I our analysis, the gender as a Covariate, so all female groups assigned 0 in the matrix, following is new matrix: 1 -1 -1 -1 -1 -1 0 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-1 -1 0 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 -1 -1 -1 -1 -1 0 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-1 -1 0 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
is it correct?
Any help will be very appreciated.
Best wishes,
Bo Xiang
At 2012-11-18 10:51:07,"Yizhou Ma" ym850@nyu.edu wrote: Hi Bo,
I'm definitely not an expert of this, but I see that you really nead some help, so I tried to look at your matrix. From my humble opinion it doesn't look correct. Firstly, the first 9 groups are male groups and the last 9 are female groups. Then why are all female groups assigned 0 in the matrix? Secondly, since the interaction you are interested in have a df of 4, do you think maybe you should have 4 rows rather than 8 in your matrix?
Cherry
On Sat, Nov 17, 2012 at 9:21 PM, xiangbo_2010 xiangbo_2010@126.com wrote:
Hi Freesurfer experts, I'm very sorry to bother you, but I am very confused with the following questions:
My experimental design includes three discrete factors: factor 1 with three levels (A,B,C ); factor 2 with three levels (O,P,Q); gender (F, M), and one covariate.
So I can get 18 classes: FAO, FAP,FAQ,FBO,FBP,FBQ,FCO,FCP,FCQ,MAO, MAP,MAQ,MBO,MBP,MBQ,MCO,MCP,MCQ. I want to perform the interaction between factor 1 and factor 2 regressing out the effect of gender and one covariate, but I don't know the rules for setting the contrasts for the F-test. The contrast matrix I used is:
1 1 1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 -1 0 1 -1 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 1 1 0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 -1 1 0 -1 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 1 1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 -1 0 1 -1 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 0 -1 1 0 -1 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
is it correct?
Any help will be very appreciated.
Best wishes,
Bo Xiang
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Hi Bo,
Sorry I made a mistake in the last letter. I now know that 1-9 columns are for male groups and 9-18 columns are for female groups.
But according to your description, gender should be a factor rather than a covariate in your analysis.
I think your matrix still doesn't look quite right to me. Since the interaction you are interested in doesn't involve gender, the coefficients for F&M groups should really be identical, from what I see.
I tried to write a matrix and included it in the attachment. Since I'm not sure if it is correct, I included the intermediate steps, so hopefully you can judge for yourself.
Cherry
On Sat, Nov 17, 2012 at 10:22 PM, xiangbo_2010 xiangbo_2010@126.com wrote:
Dear Cherry I our analysis, the gender as a Covariate, so all female groups assigned 0 in the matrix, following is new matrix: 1 -1 -1 -1 -1 -1 0 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-1 -1 0 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 -1 -1 -1 -1 -1 0 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-1 -1 0 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
is it correct?
Any help will be very appreciated.
Best wishes,
Bo Xiang
At 2012-11-18 10:51:07,"Yizhou Ma" ym850@nyu.edu wrote:
Hi Bo,
I'm definitely not an expert of this, but I see that you really nead some help, so I tried to look at your matrix. From my humble opinion it doesn't look correct. Firstly, the first 9 groups are male groups and the last 9 are female groups. Then why are all female groups assigned 0 in the matrix? Secondly, since the interaction you are interested in have a df of 4, do you think maybe you should have 4 rows rather than 8 in your matrix?
Cherry
On Sat, Nov 17, 2012 at 9:21 PM, xiangbo_2010 xiangbo_2010@126.comwrote:
Hi Freesurfer experts,****
I'm very sorry to bother you, but I am very confused with the following questions:
My experimental design includes three discrete factors: factor 1 with three levels (A,B,C ); factor 2 with three levels (O,P,Q); gender (F, M), and one covariate.
So I can get 18 classes: FAO, FAP,FAQ,FBO,FBP,FBQ,FCO,FCP,FCQ,MAO, MAP,MAQ,MBO,MBP,MBQ,MCO,MCP,MCQ. I want to perform the interaction between factor 1 and factor 2 regressing out the effect of gender and one covariate, but I don't know the rules for setting the contrasts for the F-test. The contrast matrix I used is:
1 1 1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 -1 0 1 -1 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 1 1 0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 -1 1 0 -1 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 1 1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 -1 0 1 -1 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 0 -1 1 0 -1 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
is it correct?
Any help will be very appreciated.
Best wishes,
Bo Xiang
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/co! mpliancelinehttp://www.partners.org/complianceline. If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Hi Bo, you can think of the Ftest as a logical 'OR' between the t-test contrasts indicated in each row. Each row is a difference of differences, so
1. (A-B)om - (A-B)pm --> Does the difference between A and B differ between groups O and P for Males? 2. (A-B)om - (A-B)qm 3. (A-C)om - (A-C)pm 4. (A-C)om - (A-C)qm 5. (A-B)of - (A-B)pf --> Does the difference between A and B differ between groups O and P for Females? 6. (A-B)of - (A-B)qf 7. (A-C)of - (A-C)pf 8. (A-C)of - (A-C)pf
I've put together the first 9 columns of the first 4 rows. The last 9 columns are all 0s. For the last for rows, the 0s and below matrix are swapped to give you the same for the females
doug
AOM BOM APM BPM AQM BQM COM CPM CQM -------------------------------------------------------------------------- +AOM -BOM -APM -BPM 0 0 0 0 0 +AOM -BOM 0 0 -AQM +BQM 0 0 0 +AOM 0 -APM 0 0 0 -COM +CPM 0 +AOM 0 0 0 -AQM -COM 0 +CQM
On 11/17/12 9:21 PM, xiangbo_2010 wrote:
Hi Freesurfer experts,
I'm very sorry to bother you, but I am very confused with the following questions: My experimental design includes three discrete factors: factor 1 with three levels (A,B,C ); factor 2 with three levels (O,P,Q); gender (F, M), and one covariate. So I can get 18 classes: FAO, FAP,FAQ,FBO,FBP,FBQ,FCO,FCP,FCQ,MAO, MAP,MAQ,MBO,MBP,MBQ,MCO,MCP,MCQ.I want to perform the interaction between factor 1 and factor 2 regressing out the effect of gender and one covariate, but I don't know the rules for setting the contrasts for the F-test. The contrast matrix I used is: 1 1 1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 -1 0 1 -1 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 -1 1 0 -1 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 -1 0 1 -1 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 -1 1 0 -1 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 is it correct? Any help will be very appreciated. Best wishes, Bo Xiang
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Hi Doug,
Thanks for replying. Yet I have a question on this matrix. From what I see, each row corresponds to one contrast, which has one df. Thus why are we having 8 rows while the interaction has a df of 4?
Thanks, Cherry
On Sun, Nov 18, 2012 at 6:23 PM, Douglas Greve greve@nmr.mgh.harvard.eduwrote:
Hi Bo, you can think of the Ftest as a logical 'OR' between the t-test contrasts indicated in each row. Each row is a difference of differences, so
- (A-B)om - (A-B)pm --> Does the difference between A and B differ
between groups O and P for Males? 2. (A-B)om - (A-B)qm 3. (A-C)om - (A-C)pm 4. (A-C)om - (A-C)qm 5. (A-B)of - (A-B)pf --> Does the difference between A and B differ between groups O and P for Females? 6. (A-B)of - (A-B)qf 7. (A-C)of - (A-C)pf 8. (A-C)of - (A-C)pf
I've put together the first 9 columns of the first 4 rows. The last 9 columns are all 0s. For the last for rows, the 0s and below matrix are swapped to give you the same for the females
doug
AOM BOM APM BPM AQM BQM COM CPM CQM
+AOM -BOM -APM -BPM 0 0 0 0 0 +AOM -BOM 0 0 -AQM +BQM 0 0 0 +AOM 0 -APM 0 0 0 -COM +CPM 0 +AOM 0 0 0 -AQM -COM 0 +CQM
On 11/17/12 9:21 PM, xiangbo_2010 wrote:
Hi Freesurfer experts,****
I'm very sorry to bother you, but I am very confused with the following questions:
My experimental design includes three discrete factors: factor 1 with three levels (A,B,C ); factor 2 with three levels (O,P,Q); gender (F, M), and one covariate.
So I can get 18 classes: FAO, FAP,FAQ,FBO,FBP,FBQ,FCO,FCP,FCQ,MAO, MAP,MAQ,MBO,MBP,MBQ,MCO,MCP,MCQ. I want to perform the interaction between factor 1 and factor 2 regressing out the effect of gender and one covariate, but I don't know the rules for setting the contrasts for the F-test. The contrast matrix I used is:
1 1 1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 -1 0 1 -1 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 1 1 0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 -1 1 0 -1 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 1 1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 -1 0 1 -1 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 0 -1 1 0 -1 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
is it correct?
Any help will be very appreciated.
Best wishes,
Bo Xiang
Freesurfer mailing listFreesurfer@nmr.mgh.harvard.eduhttps://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Dear doug Thank you for your reply! +AOM -BOM -APM -BPM 0 0 0 0 0 +AOM -BOM 0 0 -AQM +BQM 0 0 0 +AOM 0 -APM 0 0 0 -COM +CPM 0 +AOM 0 0 0 -AQM -COM 0 +CQM there should be use 1 -1 or 0.5 -0.5? whether the -BPM should be change BPM? Thanks
Bo Xiang
At 2012-11-19 07:23:31,"Douglas Greve" greve@nmr.mgh.harvard.edu wrote:
Hi Bo, you can think of the Ftest as a logical 'OR' between the t-test contrasts indicated in each row. Each row is a difference of differences, so
1. (A-B)om - (A-B)pm --> Does the difference between A and B differ between groups O and P for Males? 2. (A-B)om - (A-B)qm 3. (A-C)om - (A-C)pm 4. (A-C)om - (A-C)qm 5. (A-B)of - (A-B)pf --> Does the difference between A and B differ between groups O and P for Females? 6. (A-B)of - (A-B)qf 7. (A-C)of - (A-C)pf 8. (A-C)of - (A-C)pf
I've put together the first 9 columns of the first 4 rows. The last 9 columns are all 0s. For the last for rows, the 0s and below matrix are swapped to give you the same for the females
doug
AOM BOM APM BPM AQM BQM COM CPM CQM -------------------------------------------------------------------------- +AOM -BOM -APM -BPM 0 0 0 0 0 +AOM -BOM 0 0 -AQM +BQM 0 0 0 +AOM 0 -APM 0 0 0 -COM +CPM 0 +AOM 0 0 0 -AQM -COM 0 +CQM
On 11/17/12 9:21 PM, xiangbo_2010 wrote:
Hi Freesurfer experts, I'm very sorry to bother you, but I am very confused with the following questions:
My experimental design includes three discrete factors: factor 1 with three levels (A,B,C ); factor 2 with three levels (O,P,Q); gender (F, M), and one covariate.
So I can get 18 classes: FAO, FAP,FAQ,FBO,FBP,FBQ,FCO,FCP,FCQ,MAO, MAP,MAQ,MBO,MBP,MBQ,MCO,MCP,MCQ. I want to perform the interaction between factor 1 and factor 2 regressing out the effect of gender and one covariate, but I don't know the rules for setting the contrasts for the F-test. The contrast matrix I used is:
1 1 1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 -1 0 1 -1 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 1 1 0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 -1 1 0 -1 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 1 1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 -1 0 1 -1 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 0 -1 1 0 -1 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
is it correct?
Any help will be very appreciated.
Best wishes,
Bo Xiang
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.eduhttps://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Bo,
Doug asked me to chime in on your issue. Here are some points that you (and others) will hopefully find useful.
(1) Inferences are two-step process. First, you create and estimate the design matrix. Every column in the design matrix accounts can account for some of the variance in the data. Second, you have contrasts that allow you to infer specific effects. Because the model contains your covariates, you are always controlling for the covariates and by extension any factor/covariate not in the contrast.
(2) Forming contrasts is often the most difficult thing to do. I assume that your three factors (1, 2, and gender) are all between-subject factors. If one of them is a within-subject factor please let me know and disregard the rest of the email. The final F-contrast will have 4 rows (factor 1 levels-1)*(factor 2 levels -1)=(3-1)*(3-1)=2*2=4
The following is an outline for creating contrasts: (a) Start simple - difference between levels of 1 factor (b) Define your null hypothesis: AO=AP=AQ (c) Make it equal to 0: AO-AP=0 AND AP-AQ=0 (d) Repeat for the other levels of the factor... BO-BP=0 AND BP-BQ=0 CO-CP=0 AND CP-CQ=0
(e) Now combine them AO-AP=BO-BP=CO-CP AND AP-AQ=BP-BQ=CP-CQ
(f) Make them equal to 0: AO-AP-BO+BP=0 BO-BP-CO+CP=0 AP-AQ-BP+BQ=0 BP-BQ-CP+CQ=0
(g) Expand them to include gender, for example: AO-AP-BO+BP=0 becomes FAO-FAP-FBO+FBP+MAO-MAP-MBO+MBP=0
Since the contrast now has 2 columns per level, you should divide all values by 2. This will produce the correct amplitude and statistics. If you leave the values as 1 and -1, then you will have an incorrect amplitude, but the statistics will still be correct.
(h) Fill in the respective columns of your design matrix.
(3) The degrees of freedom are defined based on the rows of the F-matrix and the number of rows in the design matrix. The F-test has a numerator and denominator degrees of freedom. F(n,d).
Best Regards, Donald McLaren ================= D.G. McLaren, Ph.D. Research Fellow, Department of Neurology, Massachusetts General Hospital and Harvard Medical School Postdoctoral Research Fellow, GRECC, Bedford VA Website: http://www.martinos.org/~mclaren Office: (773) 406-2464 ===================== This e-mail contains CONFIDENTIAL INFORMATION which may contain PROTECTED HEALTHCARE INFORMATION and may also be LEGALLY PRIVILEGED and which is intended only for the use of the individual or entity named above. If the reader of the e-mail is not the intended recipient or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that you are in possession of confidential and privileged information. Any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited and may be unlawful. If you have received this e-mail unintentionally, please immediately notify the sender via telephone at (773) 406-2464 or email.
On Tue, Nov 20, 2012 at 8:17 AM, xiangbo_2010 xiangbo_2010@126.com wrote:
Dear doug Thank you for your reply! +AOM -BOM -APM -BPM 0 0 0 0 0 +AOM -BOM 0 0 -AQM +BQM 0 0 0 +AOM 0 -APM 0 0 0 -COM +CPM 0 +AOM 0 0 0 -AQM -COM 0 +CQM there should be use 1 -1 or 0.5 -0.5? whether the -BPM should be change BPM? Thanks
Bo Xiang
At 2012-11-19 07:23:31,"Douglas Greve" greve@nmr.mgh.harvard.edu wrote:
Hi Bo, you can think of the Ftest as a logical 'OR' between the t-test contrasts indicated in each row. Each row is a difference of differences, so
- (A-B)om - (A-B)pm --> Does the difference between A and B differ between
groups O and P for Males? 2. (A-B)om - (A-B)qm 3. (A-C)om - (A-C)pm 4. (A-C)om - (A-C)qm 5. (A-B)of - (A-B)pf --> Does the difference between A and B differ between groups O and P for Females? 6. (A-B)of - (A-B)qf 7. (A-C)of - (A-C)pf 8. (A-C)of - (A-C)pf
I've put together the first 9 columns of the first 4 rows. The last 9 columns are all 0s. For the last for rows, the 0s and below matrix are swapped to give you the same for the females
doug
AOM BOM APM BPM AQM BQM COM CPM CQM
+AOM -BOM -APM -BPM 0 0 0 0 0 +AOM -BOM 0 0 -AQM +BQM 0 0 0 +AOM 0 -APM 0 0 0 -COM +CPM 0 &! nbsp;&nb sp; +AOM 0 0 0 -AQM -COM 0 +CQM
On 11/17/12 9:21 PM, xiangbo_2010 wrote:
Hi Freesurfer experts,
I'm very sorry to bother you, but I am very confused with the following questions:
My experimental design includes three discrete factors: factor 1 with three levels (A,B,C ); factor 2 with three levels (O,P,Q); gender (F, M), and one covariate.
So I can get 18 classes: FAO, FAP,FAQ,FBO,FBP,FBQ,FCO,FCP,FCQ,MAO, MAP,MAQ,MBO,MBP,MBQ,MCO,MCP,MCQ. I want to perform the interaction between factor 1 and factor 2 regressing out the effect of gender and one covariate, but I don't know the rules for setting the contrasts for the F-test. The contrast matrix I used is:
1 1 1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 -1 0 1 -1 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 1 1 0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 -1 1 0 -1 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 1 1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 -1 0 1 -1 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 0 -1 1 0 -1 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
is it correct?
Any help will be very appreciated.
Best wishes,
Bo Xiang
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Thanks Donald. Is this the standard way to do this? I had used 8 rows instead of 4 with the difference being that 8 rows gives you an opportunity to look for an effect in males OR females. If there is an effect in both males and females but the effects go in opposite directions, then the 4 row implementation will resolve to 0 (no effect). Or am I misunderstanding something (again:)? thanks! doug
On 11/20/2012 01:50 PM, MCLAREN, Donald wrote:
Bo,
Doug asked me to chime in on your issue. Here are some points that you (and others) will hopefully find useful.
(1) Inferences are two-step process. First, you create and estimate the design matrix. Every column in the design matrix accounts can account for some of the variance in the data. Second, you have contrasts that allow you to infer specific effects. Because the model contains your covariates, you are always controlling for the covariates and by extension any factor/covariate not in the contrast.
(2) Forming contrasts is often the most difficult thing to do. I assume that your three factors (1, 2, and gender) are all between-subject factors. If one of them is a within-subject factor please let me know and disregard the rest of the email. The final F-contrast will have 4 rows (factor 1 levels-1)*(factor 2 levels -1)=(3-1)*(3-1)=2*2=4
The following is an outline for creating contrasts: (a) Start simple - difference between levels of 1 factor (b) Define your null hypothesis: AO=AP=AQ (c) Make it equal to 0: AO-AP=0 AND AP-AQ=0 (d) Repeat for the other levels of the factor... BO-BP=0 AND BP-BQ=0 CO-CP=0 AND CP-CQ=0
(e) Now combine them AO-AP=BO-BP=CO-CP AND AP-AQ=BP-BQ=CP-CQ
(f) Make them equal to 0: AO-AP-BO+BP=0 BO-BP-CO+CP=0 AP-AQ-BP+BQ=0 BP-BQ-CP+CQ=0
(g) Expand them to include gender, for example: AO-AP-BO+BP=0 becomes FAO-FAP-FBO+FBP+MAO-MAP-MBO+MBP=0
Since the contrast now has 2 columns per level, you should divide all values by 2. This will produce the correct amplitude and statistics. If you leave the values as 1 and -1, then you will have an incorrect amplitude, but the statistics will still be correct.
(h) Fill in the respective columns of your design matrix.
(3) The degrees of freedom are defined based on the rows of the F-matrix and the number of rows in the design matrix. The F-test has a numerator and denominator degrees of freedom. F(n,d).
Best Regards, Donald McLaren
D.G. McLaren, Ph.D. Research Fellow, Department of Neurology, Massachusetts General Hospital and Harvard Medical School Postdoctoral Research Fellow, GRECC, Bedford VA Website: http://www.martinos.org/~mclaren Office: (773) 406-2464 ===================== This e-mail contains CONFIDENTIAL INFORMATION which may contain PROTECTED HEALTHCARE INFORMATION and may also be LEGALLY PRIVILEGED and which is intended only for the use of the individual or entity named above. If the reader of the e-mail is not the intended recipient or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that you are in possession of confidential and privileged information. Any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited and may be unlawful. If you have received this e-mail unintentionally, please immediately notify the sender via telephone at (773) 406-2464 or email.
On Tue, Nov 20, 2012 at 8:17 AM, xiangbo_2010xiangbo_2010@126.com wrote:
Dear doug Thank you for your reply! +AOM -BOM -APM -BPM 0 0 0 0 0 +AOM -BOM 0 0 -AQM +BQM 0 0 0 +AOM 0 -APM 0 0 0 -COM +CPM 0 +AOM 0 0 0 -AQM -COM 0 +CQM there should be use 1 -1 or 0.5 -0.5? whether the -BPM should be change BPM? Thanks
Bo Xiang
At 2012-11-19 07:23:31,"Douglas Greve"greve@nmr.mgh.harvard.edu wrote:
Hi Bo, you can think of the Ftest as a logical 'OR' between the t-test contrasts indicated in each row. Each row is a difference of differences, so
- (A-B)om - (A-B)pm --> Does the difference between A and B differ between
groups O and P for Males? 2. (A-B)om - (A-B)qm 3. (A-C)om - (A-C)pm 4. (A-C)om - (A-C)qm 5. (A-B)of - (A-B)pf --> Does the difference between A and B differ between groups O and P for Females? 6. (A-B)of - (A-B)qf 7. (A-C)of - (A-C)pf 8. (A-C)of - (A-C)pf
I've put together the first 9 columns of the first 4 rows. The last 9 columns are all 0s. For the last for rows, the 0s and below matrix are swapped to give you the same for the females
doug
AOM BOM APM BPM AQM BQM COM CPM CQM
+AOM -BOM -APM -BPM 0 0 0 0 0 +AOM -BOM 0 0 -AQM +BQM 0 0 0 +AOM 0 -APM 0 0 0 -COM +CPM 0&! nbsp;&nb sp; +AOM 0 0 0 -AQM -COM 0 +CQM
On 11/17/12 9:21 PM, xiangbo_2010 wrote:
Hi Freesurfer experts,
I'm very sorry to bother you, but I am very confused with the following questions:
My experimental design includes three discrete factors: factor 1 with three levels (A,B,C ); factor 2 with three levels (O,P,Q); gender (F, M), and one covariate.
So I can get 18 classes: FAO, FAP,FAQ,FBO,FBP,FBQ,FCO,FCP,FCQ,MAO, MAP,MAQ,MBO,MBP,MBQ,MCO,MCP,MCQ. I want to perform the interaction between factor 1 and factor 2 regressing out the effect of gender and one covariate, but I don't know the rules for setting the contrasts for the F-test. The contrast matrix I used is:
1 1 1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 -1 0 1 -1 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 1 1 0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 -1 1 0 -1 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 1 1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 -1 0 1 -1 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 0 -1 1 0 -1 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
is it correct?
Any help will be very appreciated.
Best wishes,
Bo Xiang
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
On Tue, Nov 20, 2012 at 12:56 PM, Douglas N Greve greve@nmr.mgh.harvard.edu wrote:
Thanks Donald. Is this the standard way to do this? I had used 8 rows instead of 4 with the difference being that 8 rows gives you an opportunity to look for an effect in males OR females.
Yes. Having 8 rows would tell you if you have an interaction between factor 1 and 2 in either males or females. My 4 rows only tell you if the interaction exists. Technically speaking, one would run the three-way interaction first. If nothing existed then you do the two-way interaction as I suggested. If there is a three-way interaction, then you would use Doug's approach of the interaction in either males or females.
If there is an effect in both
males and females but the effects go in opposite directions, then the 4 row implementation will resolve to 0 (no effect). Or am I misunderstanding something (again:)?
Nope. You are right. If the male and female effects are different, then they could cancel each other out. If you suspect this to be the case, then you should be able to demonstrate a three-way interaction.
thanks! doug
On 11/20/2012 01:50 PM, MCLAREN, Donald wrote:
Bo,
Doug asked me to chime in on your issue. Here are some points that you (and others) will hopefully find useful.
(1) Inferences are two-step process. First, you create and estimate the design matrix. Every column in the design matrix accounts can account for some of the variance in the data. Second, you have contrasts that allow you to infer specific effects. Because the model contains your covariates, you are always controlling for the covariates and by extension any factor/covariate not in the contrast.
(2) Forming contrasts is often the most difficult thing to do. I assume that your three factors (1, 2, and gender) are all between-subject factors. If one of them is a within-subject factor please let me know and disregard the rest of the email. The final F-contrast will have 4 rows (factor 1 levels-1)*(factor 2 levels -1)=(3-1)*(3-1)=2*2=4
The following is an outline for creating contrasts: (a) Start simple - difference between levels of 1 factor (b) Define your null hypothesis: AO=AP=AQ (c) Make it equal to 0: AO-AP=0 AND AP-AQ=0 (d) Repeat for the other levels of the factor... BO-BP=0 AND BP-BQ=0 CO-CP=0 AND CP-CQ=0
(e) Now combine them AO-AP=BO-BP=CO-CP AND AP-AQ=BP-BQ=CP-CQ
(f) Make them equal to 0: AO-AP-BO+BP=0 BO-BP-CO+CP=0 AP-AQ-BP+BQ=0 BP-BQ-CP+CQ=0
(g) Expand them to include gender, for example: AO-AP-BO+BP=0 becomes FAO-FAP-FBO+FBP+MAO-MAP-MBO+MBP=0
Since the contrast now has 2 columns per level, you should divide all values by 2. This will produce the correct amplitude and statistics. If you leave the values as 1 and -1, then you will have an incorrect amplitude, but the statistics will still be correct.
(h) Fill in the respective columns of your design matrix.
(3) The degrees of freedom are defined based on the rows of the F-matrix and the number of rows in the design matrix. The F-test has a numerator and denominator degrees of freedom. F(n,d).
Best Regards, Donald McLaren
D.G. McLaren, Ph.D. Research Fellow, Department of Neurology, Massachusetts General Hospital and Harvard Medical School Postdoctoral Research Fellow, GRECC, Bedford VA Website: http://www.martinos.org/~mclaren Office: (773) 406-2464 ===================== This e-mail contains CONFIDENTIAL INFORMATION which may contain PROTECTED HEALTHCARE INFORMATION and may also be LEGALLY PRIVILEGED and which is intended only for the use of the individual or entity named above. If the reader of the e-mail is not the intended recipient or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that you are in possession of confidential and privileged information. Any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited and may be unlawful. If you have received this e-mail unintentionally, please immediately notify the sender via telephone at (773) 406-2464 or email.
On Tue, Nov 20, 2012 at 8:17 AM, xiangbo_2010xiangbo_2010@126.com wrote:
Dear doug Thank you for your reply! +AOM -BOM -APM -BPM 0 0 0 0 0 +AOM -BOM 0 0 -AQM +BQM 0 0 0 +AOM 0 -APM 0 0 0 -COM +CPM 0 +AOM 0 0 0 -AQM -COM 0 +CQM there should be use 1 -1 or 0.5 -0.5? whether the -BPM should be change BPM? Thanks
Bo Xiang
At 2012-11-19 07:23:31,"Douglas Greve"greve@nmr.mgh.harvard.edu wrote:
Hi Bo, you can think of the Ftest as a logical 'OR' between the t-test contrasts indicated in each row. Each row is a difference of differences, so
- (A-B)om - (A-B)pm --> Does the difference between A and B differ
between groups O and P for Males? 2. (A-B)om - (A-B)qm 3. (A-C)om - (A-C)pm 4. (A-C)om - (A-C)qm 5. (A-B)of - (A-B)pf --> Does the difference between A and B differ between groups O and P for Females? 6. (A-B)of - (A-B)qf 7. (A-C)of - (A-C)pf 8. (A-C)of - (A-C)pf
I've put together the first 9 columns of the first 4 rows. The last 9 columns are all 0s. For the last for rows, the 0s and below matrix are swapped to give you the same for the females
doug
AOM BOM APM BPM AQM BQM COM CPM CQM
+AOM -BOM -APM -BPM 0 0 0 0 0 +AOM -BOM 0 0 -AQM +BQM 0 0 0 +AOM 0 -APM 0 0 0 -COM +CPM 0&! nbsp;&nb sp;
+AOM 0 0 0 -AQM -COM 0 +CQM
On 11/17/12 9:21 PM, xiangbo_2010 wrote:
Hi Freesurfer experts,
I'm very sorry to bother you, but I am very confused with the following questions:
My experimental design includes three discrete factors: factor 1 with three levels (A,B,C ); factor 2 with three levels (O,P,Q); gender (F, M), and one covariate.
So I can get 18 classes: FAO, FAP,FAQ,FBO,FBP,FBQ,FCO,FCP,FCQ,MAO, MAP,MAQ,MBO,MBP,MBQ,MCO,MCP,MCQ. I want to perform the interaction between factor 1 and factor 2 regressing out the effect of gender and one covariate, but I don't know the rules for setting the contrasts for the F-test. The contrast matrix I used is:
1 1 1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 -1 0 1 -1 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 1 1 0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 -1 1 0 -1 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 1 1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 -1 0 1 -1 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 0 -1 1 0 -1 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
is it correct?
Any help will be very appreciated.
Best wishes,
Bo Xiang
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
-- Douglas N. Greve, Ph.D. MGH-NMR Center greve@nmr.mgh.harvard.edu Phone Number: 617-724-2358 Fax: 617-726-7422
Bugs: surfer.nmr.mgh.harvard.edu/fswiki/BugReporting FileDrop: www.nmr.mgh.harvard.edu/facility/filedrop/index.html Outgoing: ftp://surfer.nmr.mgh.harvard.edu/transfer/outgoing/flat/greve/
Dear Donald McLaren Thank you for your reply! I make the contrast according to your method is following,but I want to make interaction between factor 1 (A,B)and factor 2(C,D,E), gender (M,F) and one continuous variable (age) as covariates, the following contrast:
2 -2 0 -2 2 0 2 -2 0 -2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 -2 0 -2 2 0 2 -2 0 -2 2 0 0 0 0 0 0 0 0 0 0 0 0
is correct? Thanks!
Bo Xiang
At 2012-11-21 04:07:37,"MCLAREN, Donald" mclaren.donald@gmail.com wrote:
On Tue, Nov 20, 2012 at 12:56 PM, Douglas N Greve greve@nmr.mgh.harvard.edu wrote:
Thanks Donald. Is this the standard way to do this? I had used 8 rows instead of 4 with the difference being that 8 rows gives you an opportunity to look for an effect in males OR females.
Yes. Having 8 rows would tell you if you have an interaction between factor 1 and 2 in either males or females. My 4 rows only tell you if the interaction exists. Technically speaking, one would run the three-way interaction first. If nothing existed then you do the two-way interaction as I suggested. If there is a three-way interaction, then you would use Doug's approach of the interaction in either males or females.
If there is an effect in both
males and females but the effects go in opposite directions, then the 4 row implementation will resolve to 0 (no effect). Or am I misunderstanding something (again:)?
Nope. You are right. If the male and female effects are different, then they could cancel each other out. If you suspect this to be the case, then you should be able to demonstrate a three-way interaction.
thanks! doug
On 11/20/2012 01:50 PM, MCLAREN, Donald wrote:
Bo,
Doug asked me to chime in on your issue. Here are some points that you (and others) will hopefully find useful.
(1) Inferences are two-step process. First, you create and estimate the design matrix. Every column in the design matrix accounts can account for some of the variance in the data. Second, you have contrasts that allow you to infer specific effects. Because the model contains your covariates, you are always controlling for the covariates and by extension any factor/covariate not in the contrast.
(2) Forming contrasts is often the most difficult thing to do. I assume that your three factors (1, 2, and gender) are all between-subject factors. If one of them is a within-subject factor please let me know and disregard the rest of the email. The final F-contrast will have 4 rows (factor 1 levels-1)*(factor 2 levels -1)=(3-1)*(3-1)=2*2=4
The following is an outline for creating contrasts: (a) Start simple - difference between levels of 1 factor (b) Define your null hypothesis: AO=AP=AQ (c) Make it equal to 0: AO-AP=0 AND AP-AQ=0 (d) Repeat for the other levels of the factor... BO-BP=0 AND BP-BQ=0 CO-CP=0 AND CP-CQ=0
(e) Now combine them AO-AP=BO-BP=CO-CP AND AP-AQ=BP-BQ=CP-CQ
(f) Make them equal to 0: AO-AP-BO+BP=0 BO-BP-CO+CP=0 AP-AQ-BP+BQ=0 BP-BQ-CP+CQ=0
(g) Expand them to include gender, for example: AO-AP-BO+BP=0 becomes FAO-FAP-FBO+FBP+MAO-MAP-MBO+MBP=0
Since the contrast now has 2 columns per level, you should divide all values by 2. This will produce the correct amplitude and statistics. If you leave the values as 1 and -1, then you will have an incorrect amplitude, but the statistics will still be correct.
(h) Fill in the respective columns of your design matrix.
(3) The degrees of freedom are defined based on the rows of the F-matrix and the number of rows in the design matrix. The F-test has a numerator and denominator degrees of freedom. F(n,d).
Best Regards, Donald McLaren
D.G. McLaren, Ph.D. Research Fellow, Department of Neurology, Massachusetts General Hospital and Harvard Medical School Postdoctoral Research Fellow, GRECC, Bedford VA Website: http://www.martinos.org/~mclaren Office: (773) 406-2464 ===================== This e-mail contains CONFIDENTIAL INFORMATION which may contain PROTECTED HEALTHCARE INFORMATION and may also be LEGALLY PRIVILEGED and which is intended only for the use of the individual or entity named above. If the reader of the e-mail is not the intended recipient or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that you are in possession of confidential and privileged information. Any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited and may be unlawful. If you have received this e-mail unintentionally, please immediately notify the sender via telephone at (773) 406-2464 or email.
On Tue, Nov 20, 2012 at 8:17 AM, xiangbo_2010xiangbo_2010@126.com wrote:
Dear doug Thank you for your reply! +AOM -BOM -APM -BPM 0 0 0 0 0 +AOM -BOM 0 0 -AQM +BQM 0 0 0 +AOM 0 -APM 0 0 0 -COM +CPM 0 +AOM 0 0 0 -AQM -COM 0 +CQM there should be use 1 -1 or 0.5 -0.5? whether the -BPM should be change BPM? Thanks
Bo Xiang
At 2012-11-19 07:23:31,"Douglas Greve"greve@nmr.mgh.harvard.edu wrote:
Hi Bo, you can think of the Ftest as a logical 'OR' between the t-test contrasts indicated in each row. Each row is a difference of differences, so
- (A-B)om - (A-B)pm --> Does the difference between A and B differ
between groups O and P for Males? 2. (A-B)om - (A-B)qm 3. (A-C)om - (A-C)pm 4. (A-C)om - (A-C)qm 5. (A-B)of - (A-B)pf --> Does the difference between A and B differ between groups O and P for Females? 6. (A-B)of - (A-B)qf 7. (A-C)of - (A-C)pf 8. (A-C)of - (A-C)pf
I've put together the first 9 columns of the first 4 rows. The last 9 columns are all 0s. For the last for rows, the 0s and below matrix are swapped to give you the same for the females
doug
AOM BOM APM BPM AQM BQM COM CPM CQM
+AOM -BOM -APM -BPM 0 0 0 0 0 +AOM -BOM 0 0 -AQM +BQM 0 0 0 +AOM 0 -APM 0 0 0 -COM +CPM 0&! nbsp;&nb sp;
+AOM 0 0 0 -AQM -COM 0 +CQM
On 11/17/12 9:21 PM, xiangbo_2010 wrote:
Hi Freesurfer experts,
I'm very sorry to bother you, but I am very confused with the following questions:
My experimental design includes three discrete factors: factor 1 with three levels (A,B,C ); factor 2 with three levels (O,P,Q); gender (F, M), and one covariate.
So I can get 18 classes: FAO, FAP,FAQ,FBO,FBP,FBQ,FCO,FCP,FCQ,MAO, MAP,MAQ,MBO,MBP,MBQ,MCO,MCP,MCQ. I want to perform the interaction between factor 1 and factor 2 regressing out the effect of gender and one covariate, but I don't know the rules for setting the contrasts for the F-test. The contrast matrix I used is:
1 1 1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 -1 0 1 -1 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 1 1 0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 -1 1 0 -1 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 1 1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 -1 0 1 -1 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 0 -1 1 0 -1 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
is it correct?
Any help will be very appreciated.
Best wishes,
Bo Xiang
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
-- Douglas N. Greve, Ph.D. MGH-NMR Center greve@nmr.mgh.harvard.edu Phone Number: 617-724-2358 Fax: 617-726-7422
Bugs: surfer.nmr.mgh.harvard.edu/fswiki/BugReporting FileDrop: www.nmr.mgh.harvard.edu/facility/filedrop/index.html Outgoing: ftp://surfer.nmr.mgh.harvard.edu/transfer/outgoing/flat/greve/
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Hi Bo, I don't understand the contrast you are trying to make. Are you really trying to compute the interaction between four variables (factor 1, factor 2, gender, and age)? doug
On 11/21/2012 10:49 AM, xiangbo_2010 wrote:
Dear Donald McLaren Thank you for your reply! I make the contrast according to your method is following,but I want to make interaction between factor 1 (A,B)and factor 2(C,D,E), gender (M,F) and one continuous variable (age) as covariates, the following contrast: 2 -2 0 -2 2 0 2 -2 0 -2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 -2 0 -2 2 0 2 -2 0 -2 2 0 0 0 0 0 0 0 0 0 0 0 0
is correct? Thanks! Bo Xiang
At 2012-11-21 04:07:37,"MCLAREN, Donald"<mclaren.donald@gmail.com mailto:mclaren.donald@gmail.com> wrote:
On Tue, Nov 20, 2012 at 12:56 PM, Douglas N Greve <greve@nmr.mgh.harvard.edu mailto:greve@nmr.mgh.harvard.edu> wrote:
Thanks Donald. Is this the standard way to do this? I had used 8 rows instead of 4 with the difference being that 8 rows gives you an opportunity to look for an effect in males OR females.
Yes. Having 8 rows would tell you if you have an interaction between factor 1 and 2 in either males or females. My 4 rows only tell you if the interaction exists. Technically speaking, one would run the three-way interaction first. If nothing existed then you do the two-way interaction as I suggested. If there is a three-way interaction, then you would use Doug's approach of the interaction in either males or females.
If there is an effect in both
males and females but the effects go in opposite directions, then the 4 row implementation will resolve to 0 (no effect). Or am I misunderstanding something (again:)?
Nope. You are right. If the male and female effects are different, then they could cancel each other out. If you suspect this to be the case, then you should be able to demonstrate a three-way interaction.
thanks! doug
On 11/20/2012 01:50 PM, MCLAREN, Donald wrote:
Bo,
Doug asked me to chime in on your issue. Here are some points that you (and others) will hopefully find useful.
(1) Inferences are two-step process. First, you create and estimate the design matrix. Every column in the design matrix accounts can account for some of the variance in the data. Second, you have contrasts that allow you to infer specific effects. Because the model contains your covariates, you are always controlling for the covariates and by extension any factor/covariate not in the contrast.
(2) Forming contrasts is often the most difficult thing to do. I assume that your three factors (1, 2, and gender) are all between-subject factors. If one of them is a within-subject factor please let me know and disregard the rest of the email. The final F-contrast will have 4 rows (factor 1 levels-1)*(factor 2 levels -1)=(3-1)*(3-1)=2*2=4
The following is an outline for creating contrasts: (a) Start simple - difference between levels of 1 factor (b) Define your null hypothesis: AO=AP=AQ (c) Make it equal to 0: AO-AP=0 AND AP-AQ=0 (d) Repeat for the other levels of the factor... BO-BP=0 AND BP-BQ=0 CO-CP=0 AND CP-CQ=0
(e) Now combine them AO-AP=BO-BP=CO-CP AND AP-AQ=BP-BQ=CP-CQ
(f) Make them equal to 0: AO-AP-BO+BP=0 BO-BP-CO+CP=0 AP-AQ-BP+BQ=0 BP-BQ-CP+CQ=0
(g) Expand them to include gender, for example: AO-AP-BO+BP=0 becomes FAO-FAP-FBO+FBP+MAO-MAP-MBO+MBP=0
Since the contrast now has 2 columns per level, you should divide all values by 2. This will produce the correct amplitude and statistics. If you leave the values as 1 and -1, then you will have an incorrect amplitude, but the statistics will still be correct.
(h) Fill in the respective columns of your design matrix.
(3) The degrees of freedom are defined based on the rows of the F-matrix and the number of rows in the design matrix. The F-test has a numerator and denominator degrees of freedom. F(n,d).
Best Regards, Donald McLaren
D.G. McLaren, Ph.D. Research Fellow, Department of Neurology, Massachusetts General Hospital and Harvard Medical School Postdoctoral Research Fellow, GRECC, Bedford VA Website: http://www.martinos.org/~mclaren Office: (773) 406-2464 ===================== This e-mail contains CONFIDENTIAL INFORMATION which may contain PROTECTED HEALTHCARE INFORMATION and may also be LEGALLY PRIVILEGED and which is intended only for the use of the individual or entity named above. If the reader of the e-mail is not the intended recipient or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that you are in possession of confidential and privileged information. Any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited and may be unlawful. If you have received this e-mail unintentionally, please immediately notify the sender via telephone at (773) 406-2464 or email.
On Tue, Nov 20, 2012 at 8:17 AM, xiangbo_2010<xiangbo_2010@126.com mailto:xiangbo_2010@126.com> wrote:
Dear doug Thank you for your reply! +AOM -BOM -APM -BPM 0 0 0 0 0 +AOM -BOM 0 0 -AQM +BQM 0 0 0 +AOM 0 -APM 0 0 0 -COM +CPM 0 +AOM 0 0 0 -AQM -COM 0 +CQM there should be use 1 -1 or 0.5 -0.5? whether the -BPM should be change BPM? Thanks
Bo Xiang
At 2012-11-19 07:23:31,"Douglas Greve"<greve@nmr.mgh.harvard.edu mailto:greve@nmr.mgh.harvard.edu> wrote:
Hi Bo, you can think of the Ftest as a logical 'OR' between the t-test contrasts indicated in each row. Each row is a difference of differences, so
- (A-B)om - (A-B)pm --> Does the difference between A and B differ
between groups O and P for Males? 2. (A-B)om - (A-B)qm 3. (A-C)om - (A-C)pm 4. (A-C)om - (A-C)qm 5. (A-B)of - (A-B)pf --> Does the difference between A and B differ between groups O and P for Females? 6. (A-B)of - (A-B)qf 7. (A-C)of - (A-C)pf 8. (A-C)of - (A-C)pf
I've put together the first 9 columns of the first 4 rows. The last 9 columns are all 0s. For the last for rows, the 0s and below matrix are swapped to give you the same for the females
doug
AOM BOM APM BPM AQM BQM COM CPM CQM
+AOM -BOM -APM -BPM 0 0 0 0 0 +AOM -BOM 0 0 -AQM +BQM 0 0 0 +AOM 0 -APM 0 0 0 -COM +CPM 0&! nbsp;&nb sp;
+AOM 0 0 0 -AQM -COM 0 +CQM
On 11/17/12 9:21 PM, xiangbo_2010 wrote:
Hi Freesurfer experts,
I'm very sorry to bother you, but I am very confused with the following questions:
My experimental design includes three discrete factors: factor 1 with three levels (A,B,C ); factor 2 with three levels (O,P,Q); gender (F, M), and one covariate.
So I can get 18 classes: FAO, FAP,FAQ,FBO,FBP,FBQ,FCO,FCP,FCQ,MAO, MAP,MAQ,MBO,MBP,MBQ,MCO,MCP,MCQ. I want to perform the interaction between factor 1 and factor 2 regressing out the effect of gender and one covariate, but I don't know the rules for setting the contrasts for the F-test. The contrast matrix I used is:
1 1 1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 -1 0 1 -1 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 1 1 0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 -1 1 0 -1 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 1 1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 -1 0 1 -1 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 0 -1 1 0 -1 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
is it correct?
Any help will be very appreciated.
Best wishes,
Bo Xiang
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu mailto:Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu mailto:Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
-- Douglas N. Greve, Ph.D. MGH-NMR Center greve@nmr.mgh.harvard.edu mailto:greve@nmr.mgh.harvard.edu Phone Number: 617-724-2358 Fax: 617-726-7422
Bugs: surfer.nmr.mgh.harvard.edu/fswiki/BugReporting FileDrop: www.nmr.mgh.harvard.edu/facility/filedrop/index.html Outgoing: ftp://surfer.nmr.mgh.harvard.edu/transfer/outgoing/flat/greve/
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu mailto:Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
No, I want to compute the interaction between factor 1 and factor 2 , gender and age as covariates. thanks
Bo Xiang
在 2012-11-22 04:22:06,"Douglas N Greve" greve@nmr.mgh.harvard.edu 写道:
Hi Bo, I don't understand the contrast you are trying to make. Are you really trying to compute the interaction between four variables (factor 1, factor 2, gender, and age)? doug
On 11/21/2012 10:49 AM, xiangbo_2010 wrote:
Dear Donald McLaren Thank you for your reply! I make the contrast according to your method is following,but I want to make interaction between factor 1 (A,B)and factor 2(C,D,E), gender (M,F) and one continuous variable (age) as covariates, the following contrast: 2 -2 0 -2 2 0 2 -2 0 -2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 -2 0 -2 2 0 2 -2 0 -2 2 0 0 0 0 0 0 0 0 0 0 0 0
is correct? Thanks! Bo Xiang
At 2012-11-21 04:07:37,"MCLAREN, Donald"<mclaren.donald@gmail.com mailto:mclaren.donald@gmail.com> wrote:
On Tue, Nov 20, 2012 at 12:56 PM, Douglas N Greve <greve@nmr.mgh.harvard.edu mailto:greve@nmr.mgh.harvard.edu> wrote:
Thanks Donald. Is this the standard way to do this? I had used 8 rows instead of 4 with the difference being that 8 rows gives you an opportunity to look for an effect in males OR females.
Yes. Having 8 rows would tell you if you have an interaction between factor 1 and 2 in either males or females. My 4 rows only tell you if the interaction exists. Technically speaking, one would run the three-way interaction first. If nothing existed then you do the two-way interaction as I suggested. If there is a three-way interaction, then you would use Doug's approach of the interaction in either males or females.
If there is an effect in both
males and females but the effects go in opposite directions, then the 4 row implementation will resolve to 0 (no effect). Or am I misunderstanding something (again:)?
Nope. You are right. If the male and female effects are different, then they could cancel each other out. If you suspect this to be the case, then you should be able to demonstrate a three-way interaction.
thanks! doug
On 11/20/2012 01:50 PM, MCLAREN, Donald wrote:
Bo,
Doug asked me to chime in on your issue. Here are some points that you (and others) will hopefully find useful.
(1) Inferences are two-step process. First, you create and estimate the design matrix. Every column in the design matrix accounts can account for some of the variance in the data. Second, you have contrasts that allow you to infer specific effects. Because the model contains your covariates, you are always controlling for the covariates and by extension any factor/covariate not in the contrast.
(2) Forming contrasts is often the most difficult thing to do. I assume that your three factors (1, 2, and gender) are all between-subject factors. If one of them is a within-subject factor please let me know and disregard the rest of the email. The final F-contrast will have 4 rows (factor 1 levels-1)*(factor 2 levels -1)=(3-1)*(3-1)=2*2=4
The following is an outline for creating contrasts: (a) Start simple - difference between levels of 1 factor (b) Define your null hypothesis: AO=AP=AQ (c) Make it equal to 0: AO-AP=0 AND AP-AQ=0 (d) Repeat for the other levels of the factor... BO-BP=0 AND BP-BQ=0 CO-CP=0 AND CP-CQ=0
(e) Now combine them AO-AP=BO-BP=CO-CP AND AP-AQ=BP-BQ=CP-CQ
(f) Make them equal to 0: AO-AP-BO+BP=0 BO-BP-CO+CP=0 AP-AQ-BP+BQ=0 BP-BQ-CP+CQ=0
(g) Expand them to include gender, for example: AO-AP-BO+BP=0 becomes FAO-FAP-FBO+FBP+MAO-MAP-MBO+MBP=0
Since the contrast now has 2 columns per level, you should divide all values by 2. This will produce the correct amplitude and statistics. If you leave the values as 1 and -1, then you will have an incorrect amplitude, but the statistics will still be correct.
(h) Fill in the respective columns of your design matrix.
(3) The degrees of freedom are defined based on the rows of the F-matrix and the number of rows in the design matrix. The F-test has a numerator and denominator degrees of freedom. F(n,d).
Best Regards, Donald McLaren
D.G. McLaren, Ph.D. Research Fellow, Department of Neurology, Massachusetts General Hospital and Harvard Medical School Postdoctoral Research Fellow, GRECC, Bedford VA Website: http://www.martinos.org/~mclaren Office: (773) 406-2464 ===================== This e-mail contains CONFIDENTIAL INFORMATION which may contain PROTECTED HEALTHCARE INFORMATION and may also be LEGALLY PRIVILEGED and which is intended only for the use of the individual or entity named above. If the reader of the e-mail is not the intended recipient or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that you are in possession of confidential and privileged information. Any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited and may be unlawful. If you have received this e-mail unintentionally, please immediately notify the sender via telephone at (773) 406-2464 or email.
On Tue, Nov 20, 2012 at 8:17 AM, xiangbo_2010<xiangbo_2010@126.com mailto:xiangbo_2010@126.com> wrote:
Dear doug Thank you for your reply! +AOM -BOM -APM -BPM 0 0 0 0 0 +AOM -BOM 0 0 -AQM +BQM 0 0 0 +AOM 0 -APM 0 0 0 -COM +CPM 0 +AOM 0 0 0 -AQM -COM 0 +CQM there should be use 1 -1 or 0.5 -0.5? whether the -BPM should be change BPM? Thanks
Bo Xiang
At 2012-11-19 07:23:31,"Douglas Greve"<greve@nmr.mgh.harvard.edu mailto:greve@nmr.mgh.harvard.edu> wrote:
Hi Bo, you can think of the Ftest as a logical 'OR' between the t-test contrasts indicated in each row. Each row is a difference of differences, so
- (A-B)om - (A-B)pm --> Does the difference between A and B differ
between groups O and P for Males? 2. (A-B)om - (A-B)qm 3. (A-C)om - (A-C)pm 4. (A-C)om - (A-C)qm 5. (A-B)of - (A-B)pf --> Does the difference between A and B differ between groups O and P for Females? 6. (A-B)of - (A-B)qf 7. (A-C)of - (A-C)pf 8. (A-C)of - (A-C)pf
I've put together the first 9 columns of the first 4 rows. The last 9 columns are all 0s. For the last for rows, the 0s and below matrix are swapped to give you the same for the females
doug
AOM BOM APM BPM AQM BQM COM CPM CQM
+AOM -BOM -APM -BPM 0 0 0 0 0 +AOM -BOM 0 0 -AQM +BQM 0 0 0 +AOM 0 -APM 0 0 0 -COM +CPM 0&! nbsp;&nb sp;
+AOM 0 0 0 -AQM -COM 0 +CQM
On 11/17/12 9:21 PM, xiangbo_2010 wrote:
Hi Freesurfer experts,
I'm very sorry to bother you, but I am very confused with the following questions:
My experimental design includes three discrete factors: factor 1 with three levels (A,B,C ); factor 2 with three levels (O,P,Q); gender (F, M), and one covariate.
So I can get 18 classes: FAO, FAP,FAQ,FBO,FBP,FBQ,FCO,FCP,FCQ,MAO, MAP,MAQ,MBO,MBP,MBQ,MCO,MCP,MCQ. I want to perform the interaction between factor 1 and factor 2 regressing out the effect of gender and one covariate, but I don't know the rules for setting the contrasts for the F-test. The contrast matrix I used is:
1 1 1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 -1 0 1 -1 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 1 1 0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 -1 1 0 -1 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 1 1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 -1 0 1 -1 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 0 -1 1 0 -1 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
is it correct?
Any help will be very appreciated.
Best wishes,
Bo Xiang
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu mailto:Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu mailto:Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
-- Douglas N. Greve, Ph.D. MGH-NMR Center greve@nmr.mgh.harvard.edu mailto:greve@nmr.mgh.harvard.edu Phone Number: 617-724-2358 Fax: 617-726-7422
Bugs: surfer.nmr.mgh.harvard.edu/fswiki/BugReporting FileDrop: www.nmr.mgh.harvard.edu/facility/filedrop/index.html Outgoing: ftp://surfer.nmr.mgh.harvard.edu/transfer/outgoing/flat/greve/
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu mailto:Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
-- Douglas N. Greve, Ph.D. MGH-NMR Center greve@nmr.mgh.harvard.edu Phone Number: 617-724-2358 Fax: 617-726-7422
Bugs: surfer.nmr.mgh.harvard.edu/fswiki/BugReporting FileDrop: www.nmr.mgh.harvard.edu/facility/filedrop/index.html Outgoing: ftp://surfer.nmr.mgh.harvard.edu/transfer/outgoing/flat/greve/
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Please explain what are the columns represent.
Best Regards, Donald McLaren ================= D.G. McLaren, Ph.D. Research Fellow, Department of Neurology, Massachusetts General Hospital and Harvard Medical School Postdoctoral Research Fellow, GRECC, Bedford VA Website: http://www.martinos.org/~mclaren Office: (773) 406-2464 ===================== This e-mail contains CONFIDENTIAL INFORMATION which may contain PROTECTED HEALTHCARE INFORMATION and may also be LEGALLY PRIVILEGED and which is intended only for the use of the individual or entity named above. If the reader of the e-mail is not the intended recipient or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that you are in possession of confidential and privileged information. Any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited and may be unlawful. If you have received this e-mail unintentionally, please immediately notify the sender via telephone at (773) 406-2464 or email.
On Wed, Nov 21, 2012 at 2:50 PM, xiangbo_2010@126.com wrote:
No, I want to compute the interaction between factor 1 and factor 2 , gender and age as covariates. thanks
Bo Xiang
在 2012-11-22 04:22:06,"Douglas N Greve" greve@nmr.mgh.harvard.edu 写道:
Hi Bo, I don't understand the contrast you are trying to make. Are you really trying to compute the interaction between four variables (factor 1, factor 2, gender, and age)? doug
On 11/21/2012 10:49 AM, xiangbo_2010 wrote:
Dear Donald McLaren Thank you for your reply! I make the contrast according to your method is following,but I want to make interaction between factor 1 (A,B)and factor 2(C,D,E), gender (M,F) and one continuous variable (age) as covariates, the following contrast: 2 -2 0 -2 2 0 2 -2 0 -2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 -2 0 -2 2 0 2 -2 0 -2 2 0 0 0 0 0 0 0 0 0 0 0 0
is correct? Thanks! Bo Xiang
At 2012-11-21 04:07:37,"MCLAREN, Donald"<mclaren.donald@gmail.com mailto:mclaren.donald@gmail.com> wrote:
On Tue, Nov 20, 2012 at 12:56 PM, Douglas N Greve <greve@nmr.mgh.harvard.edu mailto:greve@nmr.mgh.harvard.edu> wrote:
Thanks Donald. Is this the standard way to do this? I had used 8 rows instead of 4 with the difference being that 8 rows gives you an opportunity to look for an effect in males OR females.
Yes. Having 8 rows would tell you if you have an interaction between factor 1 and 2 in either males or females. My 4 rows only tell you if the interaction exists. Technically speaking, one would run the three-way interaction first. If nothing existed then you do the two-way interaction as I suggested. If there is a three-way interaction, then you would use Doug's approach of the interaction in either males or females.
If there is an effect in both
males and females but the effects go in opposite directions, then the 4 row implementation will resolve to 0 (no effect). Or am I misunderstanding something (again:)?
Nope. You are right. If the male and female effects are different, then they could cancel each other out. If you suspect this to be the case, then you should be able to demonstrate a three-way interaction.
thanks! doug
On 11/20/2012 01:50 PM, MCLAREN, Donald wrote:
Bo,
Doug asked me to chime in on your issue. Here are some points that you (and others) will hopefully find useful.
(1) Inferences are two-step process. First, you create and estimate the design matrix. Every column in the design matrix accounts can account for some of the variance in the data. Second, you have contrasts that allow you to infer specific effects. Because the model contains your covariates, you are always controlling for the covariates and by extension any factor/covariate not in the contrast.
(2) Forming contrasts is often the most difficult thing to do. I assume that your three factors (1, 2, and gender) are all between-subject factors. If one of them is a within-subject factor please let me know and disregard the rest of the email. The final F-contrast will have 4 rows (factor 1 levels-1)*(factor 2 levels -1)=(3-1)*(3-1)=2*2=4
The following is an outline for creating contrasts: (a) Start simple - difference between levels of 1 factor (b) Define your null hypothesis: AO=AP=AQ (c) Make it equal to 0: AO-AP=0 AND AP-AQ=0 (d) Repeat for the other levels of the factor... BO-BP=0 AND BP-BQ=0 CO-CP=0 AND CP-CQ=0
(e) Now combine them AO-AP=BO-BP=CO-CP AND AP-AQ=BP-BQ=CP-CQ
(f) Make them equal to 0: AO-AP-BO+BP=0 BO-BP-CO+CP=0 AP-AQ-BP+BQ=0 BP-BQ-CP+CQ=0
(g) Expand them to include gender, for example: AO-AP-BO+BP=0 becomes FAO-FAP-FBO+FBP+MAO-MAP-MBO+MBP=0
Since the contrast now has 2 columns per level, you should divide all values by 2. This will produce the correct amplitude and statistics. If you leave the values as 1 and -1, then you will have an incorrect amplitude, but the statistics will still be correct.
(h) Fill in the respective columns of your design matrix.
(3) The degrees of freedom are defined based on the rows of the F-matrix and the number of rows in the design matrix. The F-test has a numerator and denominator degrees of freedom. F(n,d).
Best Regards, Donald McLaren
D.G. McLaren, Ph.D. Research Fellow, Department of Neurology, Massachusetts General Hospital and Harvard Medical School Postdoctoral Research Fellow, GRECC, Bedford VA Website: http://www.martinos.org/~mclaren Office: (773) 406-2464 ===================== This e-mail contains CONFIDENTIAL INFORMATION which may contain PROTECTED HEALTHCARE INFORMATION and may also be LEGALLY PRIVILEGED and which is intended only for the use of the individual or entity named above. If the reader of the e-mail is not the intended recipient or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that you are in possession of confidential and privileged information. Any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited and may be unlawful. If you have received this e-mail unintentionally, please immediately notify the sender via telephone at (773) 406-2464 or email.
On Tue, Nov 20, 2012 at 8:17 AM, xiangbo_2010<xiangbo_2010@126.com mailto:xiangbo_2010@126.com> wrote: > > Dear doug > Thank you for your reply! > +AOM -BOM -APM -BPM 0 0 0 0 0 > +AOM -BOM 0 0 -AQM +BQM 0 0 0 > +AOM 0 -APM 0 0 0 -COM +CPM 0 > +AOM 0 0 0 -AQM -COM 0 +CQM > there should be use 1 -1 or 0.5 -0.5? whether the -BPM should be change > BPM? > Thanks > > Bo Xiang > > > > > > > At 2012-11-19 07:23:31,"Douglas Greve"<greve@nmr.mgh.harvard.edu mailto:greve@nmr.mgh.harvard.edu> wrote: > > > Hi Bo, you can think of the Ftest as a logical 'OR' between the t-test > contrasts indicated in each row. Each row is a difference of differences, > so > > 1. (A-B)om - (A-B)pm --> Does the difference between A and B differ > between > groups O and P for Males? > 2. (A-B)om - (A-B)qm > 3. (A-C)om - (A-C)pm > 4. (A-C)om - (A-C)qm > 5. (A-B)of - (A-B)pf --> Does the difference between A and B differ > between > groups O and P for Females? > 6. (A-B)of - (A-B)qf > 7. (A-C)of - (A-C)pf > 8. (A-C)of - (A-C)pf > > I've put together the first 9 columns of the first 4 rows. The last 9 > columns are all 0s. For the last for rows, the 0s and below matrix are > swapped to give you the same for the females > > doug > > AOM BOM APM BPM AQM BQM COM CPM CQM > > -------------------------------------------------------------------------- > +AOM -BOM -APM -BPM 0 0 0 0 0 > +AOM -BOM 0 0 -AQM +BQM 0 0 0 > +AOM 0 -APM 0 0 0 -COM +CPM 0&! nbsp;&nb sp; > > +AOM 0 0 0 -AQM -COM 0 +CQM > > > > On 11/17/12 9:21 PM, xiangbo_2010 wrote: > > Hi Freesurfer experts, > > I'm very sorry to bother you, but I am very confused with the following > questions: > > My experimental design includes three discrete factors: factor 1 with > three > levels (A,B,C ); factor 2 with three levels (O,P,Q); gender (F, M), and > one > covariate. > > So I can get 18 classes: FAO, FAP,FAQ,FBO,FBP,FBQ,FCO,FCP,FCQ,MAO, > MAP,MAQ,MBO,MBP,MBQ,MCO,MCP,MCQ. I want to perform the interaction > between > factor 1 and factor 2 regressing out the effect of gender and one > covariate, > but I don't know the rules for setting the contrasts for the F-test. The > contrast matrix I used is: > > 1 1 1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 > > 1 -1 0 1 -1 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 > > 1 1 1 0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 > > 1 0 -1 1 0 -1 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 > > 0 0 0 0 0 0 0 0 0 1 1 1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 > > 0 0 0 0 0 0 0 0 0 1 -1 0 1 -1 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 > > 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 > > 0 0 0 0 0 0 0 0 0 1 0 -1 1 0 -1 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 > > is it correct? > > > > Any help will be very appreciated. > > > > Best wishes, > > > > Bo Xiang > > > > > > > > > > > > _______________________________________________ > Freesurfer mailing list > Freesurfer@nmr.mgh.harvard.edu mailto:Freesurfer@nmr.mgh.harvard.edu > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer > > > > > > _______________________________________________ > Freesurfer mailing list > Freesurfer@nmr.mgh.harvard.edu mailto:Freesurfer@nmr.mgh.harvard.edu > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer > > > The information in this e-mail is intended only for the person to whom it > is > addressed. If you believe this e-mail was sent to you in error and the > e-mail > contains patient information, please contact the Partners Compliance > HelpLine at > http://www.partners.org/complianceline . If the e-mail was sent to you in > error > but does not contain patient information, please contact the sender and > properly > dispose of the e-mail. >
-- Douglas N. Greve, Ph.D. MGH-NMR Center greve@nmr.mgh.harvard.edu mailto:greve@nmr.mgh.harvard.edu Phone Number: 617-724-2358 Fax: 617-726-7422
Bugs: surfer.nmr.mgh.harvard.edu/fswiki/BugReporting FileDrop: www.nmr.mgh.harvard.edu/facility/filedrop/index.html Outgoing: ftp://surfer.nmr.mgh.harvard.edu/transfer/outgoing/flat/greve/
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu mailto:Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
-- Douglas N. Greve, Ph.D. MGH-NMR Center greve@nmr.mgh.harvard.edu Phone Number: 617-724-2358 Fax: 617-726-7422
Bugs: surfer.nmr.mgh.harvard.edu/fswiki/BugReporting FileDrop: www.nmr.mgh.harvard.edu/facility/filedrop/index.html Outgoing: ftp://surfer.nmr.mgh.harvard.edu/transfer/outgoing/flat/greve/
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Dear Donald McLaren
I want to make interaction between factor 1 (A,B)and factor 2(C,D,E). age and gender (M,F) as covariates, I can get 12 classes: ACM ADM AEM BCM BDM BEM ACF ADF AEF BCF BDF BEF and make the contrast:
+ACM -ADM 0 -BCM +BDM 0 +ACF -ADF 0 -BCF +BDF 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +ADM -AEM 0 -BDM +BEM 0 +ADF -AEF 0 -BDF +BEF 0 0 0 0 0 0 0 0 0 0 0 0 0
is correct? thanks!
Bo Xiang
At 2012-11-22 08:55:29,"MCLAREN, Donald" mclaren.donald@gmail.com wrote:
Please explain what are the columns represent.
Best Regards, Donald McLaren
D.G. McLaren, Ph.D. Research Fellow, Department of Neurology, Massachusetts General Hospital and Harvard Medical School Postdoctoral Research Fellow, GRECC, Bedford VA Website: http://www.martinos.org/~mclaren Office: (773) 406-2464 ===================== This e-mail contains CONFIDENTIAL INFORMATION which may contain PROTECTED HEALTHCARE INFORMATION and may also be LEGALLY PRIVILEGED and which is intended only for the use of the individual or entity named above. If the reader of the e-mail is not the intended recipient or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that you are in possession of confidential and privileged information. Any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited and may be unlawful. If you have received this e-mail unintentionally, please immediately notify the sender via telephone at (773) 406-2464 or email.
On Wed, Nov 21, 2012 at 2:50 PM, xiangbo_2010@126.com wrote:
No, I want to compute the interaction between factor 1 and factor 2 , gender and age as covariates. thanks
Bo Xiang
在 2012-11-22 04:22:06,"Douglas N Greve" greve@nmr.mgh.harvard.edu 写道:
Hi Bo, I don't understand the contrast you are trying to make. Are you really trying to compute the interaction between four variables (factor 1, factor 2, gender, and age)? doug
On 11/21/2012 10:49 AM, xiangbo_2010 wrote:
Dear Donald McLaren Thank you for your reply! I make the contrast according to your method is following,but I want to make interaction between factor 1 (A,B)and factor 2(C,D,E), gender (M,F) and one continuous variable (age) as covariates, the following contrast: 2 -2 0 -2 2 0 2 -2 0 -2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 -2 0 -2 2 0 2 -2 0 -2 2 0 0 0 0 0 0 0 0 0 0 0 0
is correct? Thanks! Bo Xiang
At 2012-11-21 04:07:37,"MCLAREN, Donald"<mclaren.donald@gmail.com mailto:mclaren.donald@gmail.com> wrote:
On Tue, Nov 20, 2012 at 12:56 PM, Douglas N Greve <greve@nmr.mgh.harvard.edu mailto:greve@nmr.mgh.harvard.edu> wrote:
Thanks Donald. Is this the standard way to do this? I had used 8 rows instead of 4 with the difference being that 8 rows gives you an opportunity to look for an effect in males OR females.
Yes. Having 8 rows would tell you if you have an interaction between factor 1 and 2 in either males or females. My 4 rows only tell you if the interaction exists. Technically speaking, one would run the three-way interaction first. If nothing existed then you do the two-way interaction as I suggested. If there is a three-way interaction, then you would use Doug's approach of the interaction in either males or females.
If there is an effect in both
males and females but the effects go in opposite directions, then the 4 row implementation will resolve to 0 (no effect). Or am I misunderstanding something (again:)?
Nope. You are right. If the male and female effects are different, then they could cancel each other out. If you suspect this to be the case, then you should be able to demonstrate a three-way interaction.
thanks! doug
On 11/20/2012 01:50 PM, MCLAREN, Donald wrote: > > Bo, > > Doug asked me to chime in on your issue. Here are some points that you > (and others) will hopefully find useful. > > (1) Inferences are two-step process. First, you create and estimate > the design matrix. Every column in the design matrix accounts can > account for some of the variance in the data. Second, you have > contrasts that allow you to infer specific effects. Because the model > contains your covariates, you are always controlling for the > covariates and by extension any factor/covariate not in the contrast. > > (2) Forming contrasts is often the most difficult thing to do. I > assume that your three factors (1, 2, and gender) are all > between-subject factors. If one of them is a within-subject factor > please let me know and disregard the rest of the email. The final > F-contrast will have 4 rows (factor 1 levels-1)*(factor 2 levels > -1)=(3-1)*(3-1)=2*2=4 > > The following is an outline for creating contrasts: > (a) Start simple - difference between levels of 1 factor > (b) Define your null hypothesis: AO=AP=AQ > (c) Make it equal to 0: AO-AP=0 AND AP-AQ=0 > (d) Repeat for the other levels of the factor... > BO-BP=0 AND BP-BQ=0 > CO-CP=0 AND CP-CQ=0 > > (e) Now combine them AO-AP=BO-BP=CO-CP AND AP-AQ=BP-BQ=CP-CQ > > (f) Make them equal to 0: > AO-AP-BO+BP=0 > BO-BP-CO+CP=0 > AP-AQ-BP+BQ=0 > BP-BQ-CP+CQ=0 > > (g) Expand them to include gender, for example: > AO-AP-BO+BP=0 becomes FAO-FAP-FBO+FBP+MAO-MAP-MBO+MBP=0 > > Since the contrast now has 2 columns per level, you should divide all > values by 2. This will produce the correct amplitude and statistics. > If you leave the values as 1 and -1, then you will have an incorrect > amplitude, but the statistics will still be correct. > > (h) Fill in the respective columns of your design matrix. > > (3) The degrees of freedom are defined based on the rows of the > F-matrix and the number of rows in the design matrix. The F-test has a > numerator and denominator degrees of freedom. F(n,d). > > Best Regards, Donald McLaren > ================= > D.G. McLaren, Ph.D. > Research Fellow, Department of Neurology, Massachusetts General Hospital > and > Harvard Medical School > Postdoctoral Research Fellow, GRECC, Bedford VA > Website: http://www.martinos.org/~mclaren > Office: (773) 406-2464 > ===================== > This e-mail contains CONFIDENTIAL INFORMATION which may contain PROTECTED > HEALTHCARE INFORMATION and may also be LEGALLY PRIVILEGED and which is > intended only for the use of the individual or entity named above. If the > reader of the e-mail is not the intended recipient or the employee or > agent > responsible for delivering it to the intended recipient, you are hereby > notified that you are in possession of confidential and privileged > information. Any unauthorized use, disclosure, copying or the taking of > any > action in reliance on the contents of this information is strictly > prohibited and may be unlawful. If you have received this e-mail > unintentionally, please immediately notify the sender via telephone at > (773) > 406-2464 or email. > > > On Tue, Nov 20, 2012 at 8:17 AM, xiangbo_2010<xiangbo_2010@126.com mailto:xiangbo_2010@126.com> > wrote: >> >> Dear doug >> Thank you for your reply! >> +AOM -BOM -APM -BPM 0 0 0 0 0 >> +AOM -BOM 0 0 -AQM +BQM 0 0 0 >> +AOM 0 -APM 0 0 0 -COM +CPM 0 >> +AOM 0 0 0 -AQM -COM 0 +CQM >> there should be use 1 -1 or 0.5 -0.5? whether the -BPM should be change >> BPM? >> Thanks >> >> Bo Xiang >> >> >> >> >> >> >> At 2012-11-19 07:23:31,"Douglas Greve"<greve@nmr.mgh.harvard.edu mailto:greve@nmr.mgh.harvard.edu> wrote: >> >> >> Hi Bo, you can think of the Ftest as a logical 'OR' between the t-test >> contrasts indicated in each row. Each row is a difference of differences, >> so >> >> 1. (A-B)om - (A-B)pm --> Does the difference between A and B differ >> between >> groups O and P for Males? >> 2. (A-B)om - (A-B)qm >> 3. (A-C)om - (A-C)pm >> 4. (A-C)om - (A-C)qm >> 5. (A-B)of - (A-B)pf --> Does the difference between A and B differ >> between >> groups O and P for Females? >> 6. (A-B)of - (A-B)qf >> 7. (A-C)of - (A-C)pf >> 8. (A-C)of - (A-C)pf >> >> I've put together the first 9 columns of the first 4 rows. The last 9 >> columns are all 0s. For the last for rows, the 0s and below matrix are >> swapped to give you the same for the females >> >> doug >> >> AOM BOM APM BPM AQM BQM COM CPM CQM >> >> -------------------------------------------------------------------------- >> +AOM -BOM -APM -BPM 0 0 0 0 0 >> +AOM -BOM 0 0 -AQM +BQM 0 0 0 >> +AOM 0 -APM 0 0 0 -COM +CPM 0&! nbsp;&nb sp; >> >> +AOM 0 0 0 -AQM -COM 0 +CQM >> >> >> >> On 11/17/12 9:21 PM, xiangbo_2010 wrote: >> >> Hi Freesurfer experts, >> >> I'm very sorry to bother you, but I am very confused with the following >> questions: >> >> My experimental design includes three discrete factors: factor 1 with >> three >> levels (A,B,C ); factor 2 with three levels (O,P,Q); gender (F, M), and >> one >> covariate. >> >> So I can get 18 classes: FAO, FAP,FAQ,FBO,FBP,FBQ,FCO,FCP,FCQ,MAO, >> MAP,MAQ,MBO,MBP,MBQ,MCO,MCP,MCQ. I want to perform the interaction >> between >> factor 1 and factor 2 regressing out the effect of gender and one >> covariate, >> but I don't know the rules for setting the contrasts for the F-test. The >> contrast matrix I used is: >> >> 1 1 1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 >> 0 >> >> 1 -1 0 1 -1 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 >> 0 >> >> 1 1 1 0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 >> 0 >> >> 1 0 -1 1 0 -1 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 >> 0 >> >> 0 0 0 0 0 0 0 0 0 1 1 1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 >> 0 >> >> 0 0 0 0 0 0 0 0 0 1 -1 0 1 -1 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 >> 0 >> >> 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 >> 0 >> >> 0 0 0 0 0 0 0 0 0 1 0 -1 1 0 -1 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 >> 0 >> >> is it correct? >> >> >> >> Any help will be very appreciated. >> >> >> >> Best wishes, >> >> >> >> Bo Xiang >> >> >> >> >> >> >> >> >> >> >> >> _______________________________________________ >> Freesurfer mailing list >> Freesurfer@nmr.mgh.harvard.edu mailto:Freesurfer@nmr.mgh.harvard.edu >> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer >> >> >> >> >> >> _______________________________________________ >> Freesurfer mailing list >> Freesurfer@nmr.mgh.harvard.edu mailto:Freesurfer@nmr.mgh.harvard.edu >> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer >> >> >> The information in this e-mail is intended only for the person to whom it >> is >> addressed. If you believe this e-mail was sent to you in error and the >> e-mail >> contains patient information, please contact the Partners Compliance >> HelpLine at >> http://www.partners.org/complianceline . If the e-mail was sent to you in >> error >> but does not contain patient information, please contact the sender and >> properly >> dispose of the e-mail. >> >
-- Douglas N. Greve, Ph.D. MGH-NMR Center greve@nmr.mgh.harvard.edu mailto:greve@nmr.mgh.harvard.edu Phone Number: 617-724-2358 Fax: 617-726-7422
Bugs: surfer.nmr.mgh.harvard.edu/fswiki/BugReporting FileDrop: www.nmr.mgh.harvard.edu/facility/filedrop/index.html Outgoing: ftp://surfer.nmr.mgh.harvard.edu/transfer/outgoing/flat/greve/
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu mailto:Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
-- Douglas N. Greve, Ph.D. MGH-NMR Center greve@nmr.mgh.harvard.edu Phone Number: 617-724-2358 Fax: 617-726-7422
Bugs: surfer.nmr.mgh.harvard.edu/fswiki/BugReporting FileDrop: www.nmr.mgh.harvard.edu/facility/filedrop/index.html Outgoing: ftp://surfer.nmr.mgh.harvard.edu/transfer/outgoing/flat/greve/
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Dear Prof Donald McLaren
I am sorry to disturb you! I have four discrete variables {factor 1(A,B), factor 2(C,D), factor 3(E,F), and gender(M,F)} and a continuous variable (age), I want to use the GLM to analysis the result of the interaction among factor 1(A,B), factor 2(C,D) and factor 3(E,F) regressing out the effect of gender and age, and how to make the contrast? thank you very much!
look forward your reply!
Bo Xiang
At 2012-11-21 04:07:37,"MCLAREN, Donald" mclaren.donald@gmail.com wrote:
On Tue, Nov 20, 2012 at 12:56 PM, Douglas N Greve greve@nmr.mgh.harvard.edu wrote:
Thanks Donald. Is this the standard way to do this? I had used 8 rows instead of 4 with the difference being that 8 rows gives you an opportunity to look for an effect in males OR females.
Yes. Having 8 rows would tell you if you have an interaction between factor 1 and 2 in either males or females. My 4 rows only tell you if the interaction exists. Technically speaking, one would run the three-way interaction first. If nothing existed then you do the two-way interaction as I suggested. If there is a three-way interaction, then you would use Doug's approach of the interaction in either males or females.
If there is an effect in both
males and females but the effects go in opposite directions, then the 4 row implementation will resolve to 0 (no effect). Or am I misunderstanding something (again:)?
Nope. You are right. If the male and female effects are different, then they could cancel each other out. If you suspect this to be the case, then you should be able to demonstrate a three-way interaction.
thanks! doug
On 11/20/2012 01:50 PM, MCLAREN, Donald wrote:
Bo,
Doug asked me to chime in on your issue. Here are some points that you (and others) will hopefully find useful.
(1) Inferences are two-step process. First, you create and estimate the design matrix. Every column in the design matrix accounts can account for some of the variance in the data. Second, you have contrasts that allow you to infer specific effects. Because the model contains your covariates, you are always controlling for the covariates and by extension any factor/covariate not in the contrast.
(2) Forming contrasts is often the most difficult thing to do. I assume that your three factors (1, 2, and gender) are all between-subject factors. If one of them is a within-subject factor please let me know and disregard the rest of the email. The final F-contrast will have 4 rows (factor 1 levels-1)*(factor 2 levels -1)=(3-1)*(3-1)=2*2=4
The following is an outline for creating contrasts: (a) Start simple - difference between levels of 1 factor (b) Define your null hypothesis: AO=AP=AQ (c) Make it equal to 0: AO-AP=0 AND AP-AQ=0 (d) Repeat for the other levels of the factor... BO-BP=0 AND BP-BQ=0 CO-CP=0 AND CP-CQ=0
(e) Now combine them AO-AP=BO-BP=CO-CP AND AP-AQ=BP-BQ=CP-CQ
(f) Make them equal to 0: AO-AP-BO+BP=0 BO-BP-CO+CP=0 AP-AQ-BP+BQ=0 BP-BQ-CP+CQ=0
(g) Expand them to include gender, for example: AO-AP-BO+BP=0 becomes FAO-FAP-FBO+FBP+MAO-MAP-MBO+MBP=0
Since the contrast now has 2 columns per level, you should divide all values by 2. This will produce the correct amplitude and statistics. If you leave the values as 1 and -1, then you will have an incorrect amplitude, but the statistics will still be correct.
(h) Fill in the respective columns of your design matrix.
(3) The degrees of freedom are defined based on the rows of the F-matrix and the number of rows in the design matrix. The F-test has a numerator and denominator degrees of freedom. F(n,d).
Best Regards, Donald McLaren
D.G. McLaren, Ph.D. Research Fellow, Department of Neurology, Massachusetts General Hospital and Harvard Medical School Postdoctoral Research Fellow, GRECC, Bedford VA Website: http://www.martinos.org/~mclaren Office: (773) 406-2464 ===================== This e-mail contains CONFIDENTIAL INFORMATION which may contain PROTECTED HEALTHCARE INFORMATION and may also be LEGALLY PRIVILEGED and which is intended only for the use of the individual or entity named above. If the reader of the e-mail is not the intended recipient or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that you are in possession of confidential and privileged information. Any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited and may be unlawful. If you have received this e-mail unintentionally, please immediately notify the sender via telephone at (773) 406-2464 or email.
On Tue, Nov 20, 2012 at 8:17 AM, xiangbo_2010xiangbo_2010@126.com wrote:
Dear doug Thank you for your reply! +AOM -BOM -APM -BPM 0 0 0 0 0 +AOM -BOM 0 0 -AQM +BQM 0 0 0 +AOM 0 -APM 0 0 0 -COM +CPM 0 +AOM 0 0 0 -AQM -COM 0 +CQM there should be use 1 -1 or 0.5 -0.5? whether the -BPM should be change BPM? Thanks
Bo Xiang
At 2012-11-19 07:23:31,"Douglas Greve"greve@nmr.mgh.harvard.edu wrote:
Hi Bo, you can think of the Ftest as a logical 'OR' between the t-test contrasts indicated in each row. Each row is a difference of differences, so
- (A-B)om - (A-B)pm --> Does the difference between A and B differ
between groups O and P for Males? 2. (A-B)om - (A-B)qm 3. (A-C)om - (A-C)pm 4. (A-C)om - (A-C)qm 5. (A-B)of - (A-B)pf --> Does the difference between A and B differ between groups O and P for Females? 6. (A-B)of - (A-B)qf 7. (A-C)of - (A-C)pf 8. (A-C)of - (A-C)pf
I've put together the first 9 columns of the first 4 rows. The last 9 columns are all 0s. For the last for rows, the 0s and below matrix are swapped to give you the same for the females
doug
AOM BOM APM BPM AQM BQM COM CPM CQM
+AOM -BOM -APM -BPM 0 0 0 0 0 +AOM -BOM 0 0 -AQM +BQM 0 0 0 +AOM 0 -APM 0 0 0 -COM +CPM 0&! nbsp;&nb sp;
+AOM 0 0 0 -AQM -COM 0 +CQM
On 11/17/12 9:21 PM, xiangbo_2010 wrote:
Hi Freesurfer experts,
I'm very sorry to bother you, but I am very confused with the following questions:
My experimental design includes three discrete factors: factor 1 with three levels (A,B,C ); factor 2 with three levels (O,P,Q); gender (F, M), and one covariate.
So I can get 18 classes: FAO, FAP,FAQ,FBO,FBP,FBQ,FCO,FCP,FCQ,MAO, MAP,MAQ,MBO,MBP,MBQ,MCO,MCP,MCQ. I want to perform the interaction between factor 1 and factor 2 regressing out the effect of gender and one covariate, but I don't know the rules for setting the contrasts for the F-test. The contrast matrix I used is:
1 1 1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 -1 0 1 -1 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 1 1 0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 -1 1 0 -1 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 1 1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 -1 0 1 -1 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 0 -1 1 0 -1 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
is it correct?
Any help will be very appreciated.
Best wishes,
Bo Xiang
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
-- Douglas N. Greve, Ph.D. MGH-NMR Center greve@nmr.mgh.harvard.edu Phone Number: 617-724-2358 Fax: 617-726-7422
Bugs: surfer.nmr.mgh.harvard.edu/fswiki/BugReporting FileDrop: www.nmr.mgh.harvard.edu/facility/filedrop/index.html Outgoing: ftp://surfer.nmr.mgh.harvard.edu/transfer/outgoing/flat/greve/
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Dear Prof Donald McLaren
I am sorry to disturb you! I have four discrete variables {factor 1(A,B), factor 2(C,D), factor 3(G,H), and gender(M,F)} and a continuous variable (age), I want to use the GLM to analysis the result of the interaction among factor 1(A,B), factor 2(C,D) and factor 3(E,F) regressing out the effect of gender and age, and I have 16 classes: MACG,MACH, MADG, MADH, MBCG, MBCH, MBDG, MBDH, FACG,FACH, FADG, FADH, FBCG, FBCH, FBDG, FBDH, so I design the contrast is following: 1 -1 -1 1 -1 1 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 -1 -1 1 -1 1 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
is correct? thank you very much!
look forward for your reply!
Bo Xiang
At 2012-11-21 04:07:37,"MCLAREN, Donald" mclaren.donald@gmail.com wrote:
On Tue, Nov 20, 2012 at 12:56 PM, Douglas N Greve greve@nmr.mgh.harvard.edu wrote:
Thanks Donald. Is this the standard way to do this? I had used 8 rows instead of 4 with the difference being that 8 rows gives you an opportunity to look for an effect in males OR females.
Yes. Having 8 rows would tell you if you have an interaction between factor 1 and 2 in either males or females. My 4 rows only tell you if the interaction exists. Technically speaking, one would run the three-way interaction first. If nothing existed then you do the two-way interaction as I suggested. If there is a three-way interaction, then you would use Doug's approach of the interaction in either males or females.
If there is an effect in both
males and females but the effects go in opposite directions, then the 4 row implementation will resolve to 0 (no effect). Or am I misunderstanding something (again:)?
Nope. You are right. If the male and female effects are different, then they could cancel each other out. If you suspect this to be the case, then you should be able to demonstrate a three-way interaction.
thanks! doug
On 11/20/2012 01:50 PM, MCLAREN, Donald wrote:
Bo,
Doug asked me to chime in on your issue. Here are some points that you (and others) will hopefully find useful.
(1) Inferences are two-step process. First, you create and estimate the design matrix. Every column in the design matrix accounts can account for some of the variance in the data. Second, you have contrasts that allow you to infer specific effects. Because the model contains your covariates, you are always controlling for the covariates and by extension any factor/covariate not in the contrast.
(2) Forming contrasts is often the most difficult thing to do. I assume that your three factors (1, 2, and gender) are all between-subject factors. If one of them is a within-subject factor please let me know and disregard the rest of the email. The final F-contrast will have 4 rows (factor 1 levels-1)*(factor 2 levels -1)=(3-1)*(3-1)=2*2=4
The following is an outline for creating contrasts: (a) Start simple - difference between levels of 1 factor (b) Define your null hypothesis: AO=AP=AQ (c) Make it equal to 0: AO-AP=0 AND AP-AQ=0 (d) Repeat for the other levels of the factor... BO-BP=0 AND BP-BQ=0 CO-CP=0 AND CP-CQ=0
(e) Now combine them AO-AP=BO-BP=CO-CP AND AP-AQ=BP-BQ=CP-CQ
(f) Make them equal to 0: AO-AP-BO+BP=0 BO-BP-CO+CP=0 AP-AQ-BP+BQ=0 BP-BQ-CP+CQ=0
(g) Expand them to include gender, for example: AO-AP-BO+BP=0 becomes FAO-FAP-FBO+FBP+MAO-MAP-MBO+MBP=0
Since the contrast now has 2 columns per level, you should divide all values by 2. This will produce the correct amplitude and statistics. If you leave the values as 1 and -1, then you will have an incorrect amplitude, but the statistics will still be correct.
(h) Fill in the respective columns of your design matrix.
(3) The degrees of freedom are defined based on the rows of the F-matrix and the number of rows in the design matrix. The F-test has a numerator and denominator degrees of freedom. F(n,d).
Best Regards, Donald McLaren
D.G. McLaren, Ph.D. Research Fellow, Department of Neurology, Massachusetts General Hospital and Harvard Medical School Postdoctoral Research Fellow, GRECC, Bedford VA Website: http://www.martinos.org/~mclaren Office: (773) 406-2464 ===================== This e-mail contains CONFIDENTIAL INFORMATION which may contain PROTECTED HEALTHCARE INFORMATION and may also be LEGALLY PRIVILEGED and which is intended only for the use of the individual or entity named above. If the reader of the e-mail is not the intended recipient or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that you are in possession of confidential and privileged information. Any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited and may be unlawful. If you have received this e-mail unintentionally, please immediately notify the sender via telephone at (773) 406-2464 or email.
On Tue, Nov 20, 2012 at 8:17 AM, xiangbo_2010xiangbo_2010@126.com wrote:
Dear doug Thank you for your reply! +AOM -BOM -APM -BPM 0 0 0 0 0 +AOM -BOM 0 0 -AQM +BQM 0 0 0 +AOM 0 -APM 0 0 0 -COM +CPM 0 +AOM 0 0 0 -AQM -COM 0 +CQM there should be use 1 -1 or 0.5 -0.5? whether the -BPM should be change BPM? Thanks
Bo Xiang
At 2012-11-19 07:23:31,"Douglas Greve"greve@nmr.mgh.harvard.edu wrote:
Hi Bo, you can think of the Ftest as a logical 'OR' between the t-test contrasts indicated in each row. Each row is a difference of differences, so
- (A-B)om - (A-B)pm --> Does the difference between A and B differ
between groups O and P for Males? 2. (A-B)om - (A-B)qm 3. (A-C)om - (A-C)pm 4. (A-C)om - (A-C)qm 5. (A-B)of - (A-B)pf --> Does the difference between A and B differ between groups O and P for Females? 6. (A-B)of - (A-B)qf 7. (A-C)of - (A-C)pf 8. (A-C)of - (A-C)pf
I've put together the first 9 columns of the first 4 rows. The last 9 columns are all 0s. For the last for rows, the 0s and below matrix are swapped to give you the same for the females
doug
AOM BOM APM BPM AQM BQM COM CPM CQM
+AOM -BOM -APM -BPM 0 0 0 0 0 +AOM -BOM 0 0 -AQM +BQM 0 0 0 +AOM 0 -APM 0 0 0 -COM +CPM 0&! nbsp;&nb sp;
+AOM 0 0 0 -AQM -COM 0 +CQM
On 11/17/12 9:21 PM, xiangbo_2010 wrote:
Hi Freesurfer experts,
I'm very sorry to bother you, but I am very confused with the following questions:
My experimental design includes three discrete factors: factor 1 with three levels (A,B,C ); factor 2 with three levels (O,P,Q); gender (F, M), and one covariate.
So I can get 18 classes: FAO, FAP,FAQ,FBO,FBP,FBQ,FCO,FCP,FCQ,MAO, MAP,MAQ,MBO,MBP,MBQ,MCO,MCP,MCQ. I want to perform the interaction between factor 1 and factor 2 regressing out the effect of gender and one covariate, but I don't know the rules for setting the contrasts for the F-test. The contrast matrix I used is:
1 1 1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 -1 0 1 -1 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 1 1 0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 -1 1 0 -1 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 1 1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 -1 0 1 -1 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 0 -1 1 0 -1 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
is it correct?
Any help will be very appreciated.
Best wishes,
Bo Xiang
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
-- Douglas N. Greve, Ph.D. MGH-NMR Center greve@nmr.mgh.harvard.edu Phone Number: 617-724-2358 Fax: 617-726-7422
Bugs: surfer.nmr.mgh.harvard.edu/fswiki/BugReporting FileDrop: www.nmr.mgh.harvard.edu/facility/filedrop/index.html Outgoing: ftp://surfer.nmr.mgh.harvard.edu/transfer/outgoing/flat/greve/
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
On Wed, Mar 27, 2013 at 2:53 AM, xiangbo_2010 xiangbo_2010@126.com wrote:
Dear Prof Donald McLaren
I am sorry to disturb you! I have four discrete variables {factor 1(A,B), factor 2(C,D), factor 3(G,H), and gender(M,F)} and a continuous variable (age), I want to use the GLM to analysis the result of the interaction among factor 1(A,B), factor 2(C,D) and factor 3(E,F) regressing out the effect of gender and age, and I have 16 classes: MACG,MACH, MADG, MADH, MBCG, MBCH, MBDG, MBDH, FACG,FACH, FADG, FADH, FBCG, FBCH, FBDG, FBDH, so I design the contrast is following: 1 -1 -1 1 -1 1 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 -1 -1 1 -1 1 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
IF - and this is a big if -- the columns are as you have described in this order, then the contrast should be: 1 -1 -1 1 -1 1 1 -1 1 -1 -1 1 -1 1 1 -1
To create any contrast, you need to start with the null hypothesis and then you can build up the contrast from its smaller elements: This is for a design with 18 subjects in group 1, 9 subjects in group 2, 2 group terms and 7 conditions: Start with the simpliest element, single subject in a single condition, build its contrast, repeat for all subjects and conditions, and then combine the ones you want.
S1G1C1=[1 zeros(1,26) 1 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0] S1G1C2=[1 zeros(1,26) 1 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0] .... Now average your G1C1 and by summing and dividing by the number of subjects, you'd get G1C1=[ones(1,18)/18 zeros(1,9) 1 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0] and G1C2=[ones(1,18)/18 zeros(1,9) 1 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0] and G2C1=[zeros(1,18) ones(1,9)/9 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0] and G2C2=[zeros(1,18) ones(1,9)/9 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0]
Now subtract G1C1-G1C2 AND G2C2-G2C1 G1C1-G1C2=[zeros(1,27) 0 0 1 -1 0 0 0 0 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0] and G2C1-G2C2=[zeros(1,27) 0 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 1 -1 0 0 0 0 0]
Now subtract these two: Interaction contrast=[zeros(1,27) 0 0 0 0 0 0 0 0 0 1 -1 0 0 0 0 0 -1 1 0 0 0 0 0]
In your case, if you start with G-H for Males in group A/C: 1 -1 0 0 0 0...
Then Males in group A/D: 0 0 1 -1 0 0....
Subtracting these gives you the interaction of factor 2 and 3 for A males.
1 -1 -1 1 0 0 0 0 0...
You can repeat for A females.
0 0 0 0 0 0 0 0 1 -1 -1 1 0 0 0 0
Now you can do the same for B males and B females: 0 0 0 0 1 -1 -1 1 0 0 0 0 0 0 0 0 and 0 0 0 0 0 0 0 0 0 0 0 0 1 -1 -1 1
Now subtract A from B after adding males and females: 1 -1 -1 1 -1 1 1 -1 1 -1 -1 1 -1 1 1 -1
This will work for any contrast that you ever want to make.
is correct? thank you very much!
look forward for your reply!
Bo Xiang
At 2012-11-21 04:07:37,"MCLAREN, Donald" <mclaren.donald@gmail.com
wrote: On Tue, Nov 20, 2012 at 12:56 PM, Douglas N Greve greve@nmr.mgh.harvard.edu wrote:
Thanks Donald. Is this the standard way to do this? I had used 8 rows instead of 4 with the difference being that 8 rows gives you an opportunity to look for an effect in males OR females.
Yes. Having 8 rows would tell you if you have an interaction between factor 1 and 2 in either males or females. My 4 rows only tell you if the interaction exists. Technically speaking, one would run the three-way interaction first. If nothing existed then you do the two-way interaction as I suggested. If there is a three-way interaction, then you would use Doug's approach of the interaction in either males or females.
If there is an effect in both
males and females but the effects go in opposite directions, then the 4 row implementation will resolve to 0 (no effect). Or am I misunderstanding something (again:)?
Nope. You are right. If the male and female effects are different, then they could cancel each other out. If you suspect this to be the case, then you should be able to demonstrate a three-way interaction.
thanks! doug
On 11/20/2012 01:50 PM, MCLAREN, Donald wrote:
Bo,
Doug asked me to chime in on your issue. Here are some points that you (and others) will hopefully find useful.
(1) Inferences are two-step process. First, you create and estimate the design matrix. Every column in the design matrix accounts can account for some of the variance in the data. Second, you have contrasts that allow you to infer specific effects. Because the model contains your covariates, you are always controlling for the covariates and by extension any factor/covariate not in the contrast.
(2) Forming contrasts is often the most difficult thing to do. I assume that your three factors (1, 2, and gender) are all between-subject factors. If one of them is a within-subject factor please let me know and disregard the rest of the email. The final F-contrast will have 4 rows (factor 1 levels-1)*(factor 2 levels -1)=(3-1)*(3-1)=2*2=4
The following is an outline for creating contrasts: (a) Start simple - difference between levels of 1 factor (b) Define your null hypothesis: AO=AP=AQ (c) Make it equal to 0: AO-AP=0 AND AP-AQ=0 (d) Repeat for the other levels of the factor... BO-BP=0 AND BP-BQ=0 CO-CP=0 AND CP-CQ=0
(e) Now combine them AO-AP=BO-BP=CO-CP AND AP-AQ=BP-BQ=CP-CQ
(f) Make them equal to 0: AO-AP-BO+BP=0 BO-BP-CO+CP=0 AP-AQ-BP+BQ=0 BP-BQ-CP+CQ=0
(g) Expand them to include gender, for example: AO-AP-BO+BP=0 becomes FAO-FAP-FBO+FBP+MAO-MAP-MBO+MBP=0
Since the contrast now has 2 columns per level, you should divide all values by 2. This will produce the correct amplitude and statistics. If you leave the values as 1 and -1, then you will have an incorrect amplitude, but the statistics will still be correct.
(h) Fill in the respective columns of your design matrix.
(3) The degrees of freedom are defined based on the rows of the F-matrix and the number of rows in the design matrix. The F-test has a numerator and denominator degrees of freedom. F(n,d).
Best Regards, Donald McLaren
D.G. McLaren, Ph.D. Research Fellow, Department of Neurology, Massachusetts General Hospital and Harvard Medical School Postdoctoral Research Fellow, GRECC, Bedford VA Website: http://www.martinos.org/~mclaren
Office: (773) 406-2464
This e-mail contains CONFIDENTIAL INFORMATION which may contain PROTECTED HEALTHCARE INFORMATION and may also be LEGALLY PRIVILEGED and which is intended only for the use of the individual or entity named above. If the reader of the e-mail is not the intended recipient or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that you are in possession of confidential and privileged information. Any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited and may be unlawful. If you have received this e-mail unintentionally, please immediately notify the sender via telephone at (773) 406-2464 or email.
On Tue, Nov 20, 2012 at 8:17 AM, xiangbo_2010xiangbo_2010@126.com wrote:
Dear doug Thank you for your reply! +AOM -BOM -APM -BPM 0 0 0 0 0 +AOM -BOM 0 0 -AQM +BQM 0 0 0 +AOM 0 -APM 0 0 0 -COM +CPM 0 +AOM 0 0 0 -AQM -COM 0 +CQM there should be use 1 -1 or 0.5 -0.5? whether the -BPM should be change BPM? Thanks
Bo Xiang
At 2012-11-19 07:23:31,"Douglas Greve"greve@nmr.mgh.harvard.edu wrote:
Hi Bo, you can think of the Ftest as a logical 'OR' between the t-test contrasts indicated in each row. Each row is a difference of differences, so
- (A-B)om - (A-B)pm --> Does the difference between A and B differ
between groups O and P for Males? 2. (A-B)om - (A-B)qm 3. (A-C)om - (A-C)pm 4. (A-C)om - (A-C)qm 5. (A-B)of - (A-B)pf --> Does the difference between A and B differ between groups O and P for Females? 6. (A-B)of - (A-B)qf 7. (A-C)of - (A-C)pf 8. (A-C)of - (A-C)pf
I've put together the first 9 columns of the first 4 rows. The last 9 columns are all 0s. For the last for rows, the 0s and below matrix are swapped to give you the same for the females
doug
AOM BOM APM BPM AQM BQM COM CPM CQM
+AOM -BOM -APM -BPM 0 0 0 0 0 +AOM -BOM 0 0 -AQM +BQM 0 0 0 +AOM 0 -APM 0 0 0 -COM +CPM 0&! nbsp;&nb sp;
+AOM 0 0 0 -AQM -COM 0 +CQM
On 11/17/12 9:21 PM, xiangbo_2010 wrote:
Hi Freesurfer experts,
I'm very sorry to bother you, but I am very confused with the following questions:
My experimental design includes three discrete factors: factor 1 with three levels (A,B,C ); factor 2 with three levels (O,P,Q); gender (F, M), and one covariate.
So I can get 18 classes: FAO, FAP,FAQ,FBO,FBP,FBQ,FCO,FCP,FCQ,MAO, MAP,MAQ,MBO,MBP,MBQ,MCO,MCP,MCQ. I want to perform the interaction between factor 1 and factor 2 regressing out the effect of gender and one covariate, but I don't know the rules for setting the contrasts for the F-test. The contrast matrix I used is:
1 1 1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 -1 0 1 -1 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 1 1 0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 -1 1 0 -1 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 1 1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 -1 0 1 -1 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 0 -1 1 0 -1 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
is it correct?
Any help will be very appreciated.
Best wishes,
Bo Xiang
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
-- Douglas N. Greve, Ph.D. MGH-NMR Center greve@nmr.mgh.harvard.edu Phone Number: 617-724-2358 Fax: 617-726-7422
Bugs: surfer.nmr.mgh.harvard.edu/fswiki/BugReporting FileDrop: www.nmr.mgh.harvard.edu/facility/filedrop/index.html Outgoing: ftp://surfer.nmr.mgh.harvard.edu/transfer/outgoing/flat/greve/
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Yes, that -BPM should be +BPM, sorry about that. It will not change the p-values if you multiply by 0.5 or not. It will change the size of the contrast. Most people don't report this number, especially for an F-test, so I would not worry about it. doug
On 11/20/2012 09:17 AM, xiangbo_2010 wrote:
Dear doug Thank you for your reply! +AOM -BOM -APM -BPM 0 0 0 0 0 +AOM -BOM 0 0 -AQM +BQM 0 0 0 +AOM 0 -APM 0 0 0 -COM +CPM 0 +AOM 0 0 0 -AQM -COM 0 +CQM there should be use 1 -1 or 0.5 -0.5? whether the -BPM should be change BPM? Thanks Bo Xiang
At 2012-11-19 07:23:31,"Douglas Greve" <greve@nmr.mgh.harvard.edu mailto:greve@nmr.mgh.harvard.edu> wrote:
Hi Bo, you can think of the Ftest as a logical 'OR' between the t-test contrasts indicated in each row. Each row is a difference of differences, so 1. (A-B)om - (A-B)pm --> Does the difference between A and B differ between groups O and P for Males? 2. (A-B)om - (A-B)qm 3. (A-C)om - (A-C)pm 4. (A-C)om - (A-C)qm 5. (A-B)of - (A-B)pf --> Does the difference between A and B differ between groups O and P for Females? 6. (A-B)of - (A-B)qf 7. (A-C)of - (A-C)pf 8. (A-C)of - (A-C)pf I've put together the first 9 columns of the first 4 rows. The last 9 columns are all 0s. For the last for rows, the 0s and below matrix are swapped to give you the same for the females doug AOM BOM APM BPM AQM BQM COM CPM CQM -------------------------------------------------------------------------- +AOM -BOM -APM -BPM 0 0 0 0 0 +AOM -BOM 0 0 -AQM +BQM 0 0 0 +AOM 0 -APM 0 0 0 -COM +CPM 0 &nb sp; +AOM 0 0 0 -AQM -COM 0 +CQM On 11/17/12 9:21 PM, xiangbo_2010 wrote:Hi Freesurfer experts, I'm very sorry to bother you, but I am very confused with the following questions: My experimental design includes three discrete factors: factor 1 with three levels (A,B,C ); factor 2 with three levels (O,P,Q); gender (F, M), and one covariate. So I can get 18 classes: FAO, FAP,FAQ,FBO,FBP,FBQ,FCO,FCP,FCQ,MAO, MAP,MAQ,MBO,MBP,MBQ,MCO,MCP,MCQ.I want to perform the interaction between factor 1 and factor 2 regressing out the effect of gender and one covariate, but I don't know the rules for setting the contrasts for the F-test. The contrast matrix I used is: 1 1 1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 -1 0 1 -1 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 -1 1 0 -1 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 -1 0 1 -1 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 -1 1 0 -1 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 is it correct? Any help will be very appreciated. Best wishes, Bo Xiang _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
freesurfer@nmr.mgh.harvard.edu