help > anova repeated measures
Showing 1-6 of 6 posts
Display:
Results per page:
Jul 31, 2017  09:07 PM | Gian Marco Duma
anova repeated measures
Hello everybody, I have just begun to use NBS. 
In my experiment I have a repeated measures experimental paradigm. In my experiment I have a group of 14 participants that are exposed to 2 different conditions, hypnosis and imagination of hypnosis. Each subjects have completed both sections. I don't know exactly how to create the design matrix in this condition, could you give me some suggestions?
thanks for your help
Aug 1, 2017  05:08 AM | Andrew Zalesky
RE: anova repeated measures
Hi Gian,

Let's assume S denotes subject and C denotes condition. Thus, S1C1 denotes subject 1 in condition 1. The design matrix looks as follows for the case of two subjects, where the first column is the between-condition difference and the next two columns model subject means (if you have 14 subjects, your design matrix will have 14+1=15 columns):

S1C1  0  1  0
S1C2  1  1  0
S2C1  0  0  1
S2C2  1  0  1

contrast is [1 0 0] or [-1 0 0]

exchange blocks: [1 1 2 2]

Andrew

Originally posted by Gian Marco Duma:
Hello everybody, I have just begun to use NBS. 
In my experiment I have a repeated measures experimental paradigm. In my experiment I have a group of 14 participants that are exposed to 2 different conditions, hypnosis and imagination of hypnosis. Each subjects have completed both sections. I don't know exactly how to create the design matrix in this condition, could you give me some suggestions?
thanks for your help
Aug 1, 2017  10:08 AM | Gian Marco Duma
RE: anova repeated measures
thank you for your answer! I have created the design matrix 28x15, but now I have a little doubt. Given that I have two different matrix coherence for each subject, hypnosis and imagination in order to run the anova with NBS, I think I should put in the same folder all the matrix coherence, in th isn't it? Moreover considering two subjects, I should put them in the folder with the same order that it is present in matrix, right? for example considering the design matrix you gave me:
S1C1 0 1 0
S1C2 1 1 0
S2C1 0 0 1
S2C2 1 0 1

I should order the coherence matrices files in the folder: S1C1, S1C2, S2C1, S2C2....?
Furthermore, how should I name the files, should they have a progressive number with the same name for example: if S1C1 is the imagination and S1C2 is the hypnosis, I should name them S1 and S2, or could they be named with different name?
thanks
Aug 2, 2017  08:08 AM | Andrew Zalesky
RE: anova repeated measures
Hi Gian,

you must name the files in alphanumeric order. For example:

S1C1 is 01.txt
S1C2 is 02.txt
S2C1 is 03.txt
S2C2 is 04.txt

It is important that you label the files in a way that is consistent with the rows in your design matrix.

Remember that S1.txt will come AFTER S11.txt in alphanumeric ordering.


Another option is to store the connectivity matrices in a 3D Matlab matrix where the 3rd dimension indexes subjects. The order in which subjects are stored in this matrix must be consistent with the rows in your design matrix.

Andrew

Originally posted by Gian Marco Duma:
thank you for your answer! I have created the design matrix 28x15, but now I have a little doubt. Given that I have two different matrix coherence for each subject, hypnosis and imagination in order to run the anova with NBS, I think I should put in the same folder all the matrix coherence, in th isn't it? Moreover considering two subjects, I should put them in the folder with the same order that it is present in matrix, right? for example considering the design matrix you gave me:
S1C1 0 1 0
S1C2 1 1 0
S2C1 0 0 1
S2C2 1 0 1

I should order the coherence matrices files in the folder: S1C1, S1C2, S2C1, S2C2....?
Furthermore, how should I name the files, should they have a progressive number with the same name for example: if S1C1 is the imagination and S1C2 is the hypnosis, I should name them S1 and S2, or could they be named with different name?
thanks
Aug 4, 2017  10:08 AM | Gian Marco Duma
RE: anova repeated measures
Dear Andrew thanks for your help. After generating my design matrix and my data matrix 32x32, I runned my analyses but I get an error message from NBS:

Output argument "y" (and maybe others) not assigned during call to "NBSrun>read_matrices".

Error in NBSrun (line 185)
[nbs.GLM.y,UI.matrices.ok,DIMS]=read_matrices(UI.matrices.ui);
Error in NBS>get_ui (line 174)
NBSrun(UI,S);
Error while evaluating UIControl Callback

Basing on your suggestion this is my design matrix:

0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
1 1 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
1 0 1 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 0 0 0 0 0 0 0 0
1 0 0 1 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0 0 0 0 0 0
1 0 0 0 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 1 0 0 0 0 0 0 0 0 0
1 0 0 0 0 1 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 1 0 0 0 0 0 0 0 0
1 0 0 0 0 0 1 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1 0 0 0 0 0 0 0
1 0 0 0 0 0 0 1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 1 0 0 0 0 0 0
1 0 0 0 0 0 0 0 1 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 0 0 0 0 0
1 0 0 0 0 0 0 0 0 1 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 1 0 0 0 0
1 0 0 0 0 0 0 0 0 0 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
1 0 0 0 0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
1 0 0 0 0 0 0 0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 1 0
1 0 0 0 0 0 0 0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 1

Contrast [-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0], and exchange blocks [1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14]. 
My data matrices are named 01, 02, 03.... arriving to 28.
I did not insert any Node coordinates or Node labels, because I'm working with EEG connectivity measures. Is something that I'm doing in a wrong way that could explain the error message?
Thanks
Aug 4, 2017  11:08 PM | Andrew Zalesky
RE: anova repeated measures
Hi Gian,

all your inputs look correct.

The error message is very likely due to an issue with reading your connectivity matrices. Or a problem in the way your connectivity matrices are stored.

1. Make sure that the connectivity matrices are stored in a separate folder with no other files in that folder apart from the matrices.
2.Check the files containing the data matrices are .txt files and they don't contain extra characters or line breaks. Name the files "01.txt", not "01".
3. If this fails, you can provide the matrices to the NBS as a matlab .mat file where the .mat file contains a single variable, which is a 3-dimensional matrix of dimension N x N x 14. This is often the easiest option. 

Andrew

Originally posted by Gian Marco Duma:
Dear Andrew thanks for your help. After generating my design matrix and my data matrix 32x32, I runned my analyses but I get an error message from NBS:

Output argument "y" (and maybe others) not assigned during call to "NBSrun>read_matrices".

Error in NBSrun (line 185)
[nbs.GLM.y,UI.matrices.ok,DIMS]=read_matrices(UI.matrices.ui);
Error in NBS>get_ui (line 174)
NBSrun(UI,S);
Error while evaluating UIControl Callback

Basing on your suggestion this is my design matrix:

0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
1 1 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
1 0 1 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 0 0 0 0 0 0 0 0
1 0 0 1 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0 0 0 0 0 0
1 0 0 0 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 1 0 0 0 0 0 0 0 0 0
1 0 0 0 0 1 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 1 0 0 0 0 0 0 0 0
1 0 0 0 0 0 1 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1 0 0 0 0 0 0 0
1 0 0 0 0 0 0 1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 1 0 0 0 0 0 0
1 0 0 0 0 0 0 0 1 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 0 0 0 0 0
1 0 0 0 0 0 0 0 0 1 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 1 0 0 0 0
1 0 0 0 0 0 0 0 0 0 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
1 0 0 0 0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
1 0 0 0 0 0 0 0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 1 0
1 0 0 0 0 0 0 0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 1

Contrast [-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0], and exchange blocks [1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14]. 
My data matrices are named 01, 02, 03.... arriving to 28.
I did not insert any Node coordinates or Node labels, because I'm working with EEG connectivity measures. Is something that I'm doing in a wrong way that could explain the error message?
Thanks