help > how to write design matrix for permutation analysis
Showing 1-4 of 4 posts
Display:
Results per page:
May 31, 2019  11:05 AM | xiu ling
how to write design matrix for permutation analysis
Hi Dr. Spielberg,

Thank you for developing this tool!
I'm having some difficulty at the run permutation analysis stage.

If the format of connectivity matrix is n(ROI)*n(ROI)*number of subject*2(condition), how should I write  the design matrix and contrast vector in the stage of run permutation analysis to contrast the graph properties of 2 conditions.

I am looking forward  to hearing from you. Thank you for your help.
xiuling
Jun 3, 2019  01:06 PM | Jeffrey Spielberg
RE: how to write design matrix for permutation analysis
You don't have to account for the repeated measure in the design matrix - the toolbox will recognize that there is a repeated measure because of the dimensions of your input data and automatically set up between, within, and (if needed) between x within interactions.  Therefore, you should just set up your design/contrast matrices as if you did not have a repeated measure and those effects will be automatically computed.
Mar 11, 2020  01:03 PM | li wenlong
RE: how to write design matrix for permutation analysis
Dear Dr. Spielberg,

Forgive my ignorance, I meet the same questions and cannot fully understand what you replied. So, can we give an example：

If the connectivity matrix is 90*90*5*2 , now we set a design matrices:
(5 subjects: sub1/sub2/sub3/sub4/sub5; 2 conditions: A/B )

we plan to compare A > B, should predictors be set like this?

predictors: 1 1 1 1 1
options: Contrasts
contrast: [1 0] (group is 1, intercept is 0)
A < B contrast: [-1 0]

What do these two columns represent? And how should I set the predictors and contrast to find the correction between A > B and scale score?
Best wishes,
Wenlong
Attachment: fig1.png
Mar 12, 2020  01:03 PM | Jeffrey Spielberg
RE: how to write design matrix for permutation analysis
Originally posted by li wenlong:
The program will recognize that you have a repeated measure, because the last dimension of your input matrix is 2 (not 1).  Therefore, you don't have to explicitly do anything beyond setting up your input matrix correctly. In other words, the toolbox will automatically compute between, within, and (if needed) between x within interactions. Therefore, you should just set up your design/contrast matrices as if you did not have a repeated measure and those effects will be automatically computed.

If you just want to compare the repeated measure, just create a variable that is one column of all ones and enter use that as your predictor.  This will setup a within-subjects comparison (equivalent to a paired t-test) that tests whether the mean of one condition differs from the mean of the other.  You don't need a separate 'group' predictor, unless you have different groups.  The contrast would just be 1.  You also don't need to do the -1 contrast, unless you want a 1-tailed test (you will be given the 1-tailed and 2-tailed p-values).

Dear Dr. Spielberg,

Forgive my ignorance, I meet the same questions and cannot fully understand what you replied. So, can we give an example：

If the connectivity matrix is 90*90*5*2 , now we set a design matrices:
(5 subjects: sub1/sub2/sub3/sub4/sub5; 2 conditions: A/B )

we plan to compare A > B, should predictors be set like this?

predictors: 1 1 1 1 1
options: Contrasts
contrast: [1 0] (group is 1, intercept is 0)
A < B contrast: [-1 0]

What do these two columns represent? And how should I set the predictors and contrast to find the correction between A > B and scale score?
Best wishes,
Wenlong