help > Design matrix tips
Showing 1-8 of 8 posts
Display:
Results per page:
Feb 13, 2013  02:02 PM | Matthew Hoptman
Design matrix tips
Hi,
I really like the NBS tool, but I had a question about design matrices.  I have two groups (24 and 26 per group).  I set up this design as a text file with two columns as per the example in the help and loaded the design matrix.  However, I get the error message:

Stop: Design Matrix not found or inconsistent

I'm really not sure what I could be doing wrong because I had gotten this to work in the past.  My design matrix is attached.

Thanks,
Matt
Attachment: design.txt
Feb 13, 2013  11:02 PM | Andrew Zalesky
RE: Design matrix tips
Hi Matt,

Thanks for your interest. My first suggestion is to check that the number of rows in your design matrix is equal to the number of connectivity matrices in your study (i.e. one connectivity matrix per individual).

Moreover, you may want to delete the two empty new lines appearing after the last row of the design matrix. They may have been interpreted as actual rows of the design matrix.  

It may be that some connectivity matrices were not found or not read correctly. My second suggestion is to check that all the connectivity matrices have been provided and recognized.

If the problem persists, please send me your set of connectivity matrices (assuming you feel comfortable doing that) and I can take a closer look. My email: is azalesky@unimelb.edu.au

Andrew

Originally posted by Matthew Hoptman:
Hi,
I really like the NBS tool, but I had a question about design matrices.  I have two groups (24 and 26 per group).  I set up this design as a text file with two columns as per the example in the help and loaded the design matrix.  However, I get the error message:

Stop: Design Matrix not found or inconsistent

I'm really not sure what I could be doing wrong because I had gotten this to work in the past.  My design matrix is attached.

Thanks,
Matt
Jan 14, 2017  06:01 PM | Christian Clemm
RE: Design matrix tips
 
Dear Andrew,
 
many thanks for this beautiful tool and your help.
 
It seems I have a similar Problem to the one Matt posted in 2013: I get this error message "Design Matrix not found or inconsistent", even though I cannot see any reasons why the design Matrix and correlation Matrix should not fit. I checked the number of lines, and the connecticity matrices appear correct and don't contain NaN.
 
I attach both matrices; any help would be greatly appreciated.
 
Thanks,
Christian
Jan 14, 2017  06:01 PM | Christian Clemm
RE: Design matrix tips
 
Here I also attach the design Matrix.
Jan 14, 2017  10:01 PM | Andrew Zalesky
RE: Design matrix tips
Christian, I suggest renaming the mat file, without using any dots (.) in the file name. Just something simple like: zcormatrix.mat

Matlab can get confused when there are multiple dots (.) in the file name because it cannot determine whether the file extension is .mat or .1.mat, etc

Let me know if this does not solve the problem and I will take a closer look.

Andrew
Jan 16, 2017  12:01 PM | Christian Clemm
RE: Design matrix tips
 
Dear Andrew,
 
many thanks for your fast reply. I tried this, but unfortunately, this did not solve the problem. (It appears inconsistent, sometimes it does work and sometimes not; I'll probably try to install NBS again.)
 
Do you have any other ideas? 
 
Thank you so much,
Christian
Jan 16, 2017  01:01 PM | Christian Clemm
RE: Design matrix tips
 
Dear Andrew,
 
it seems we have found what caused the problem:
 
In NBSrun.m, line 183 reads: 
[nbs.GLM.y,UI.matrices.ok,DIMS]=read_matrices([fileparts(UI.matrices.ui),filesep]);
 
So, it seems that the path excluding the filename is passed down to "read_matrices". This causes long delays or errors (especially if you have lots of other stuff stored in the directory).
 
We have replaced it with:
[nbs.GLM.y,UI.matrices.ok,DIMS]=read_matrices(UI.matrices.ui);
 
This way, the path including the filename is passed down, and it seems to work.
 
Does this make sense to you? We aren't sure we understand the purpose of line 183.
 
Thank you so much!
Christian
 
Jan 16, 2017  11:01 PM | Andrew Zalesky
RE: Design matrix tips
Hi Christian,

I'm glad it is working for you now. However, I hope that the changes you have made do not only allow for one file to be read in within a directory.

The original version should work if you don't have other unnecessary/irrelevant files in the directory that you are reading from.


Andrew
Originally posted by Christian Clemm:
 
Dear Andrew,
 
it seems we have found what caused the problem:
 
In NBSrun.m, line 183 reads: 
[nbs.GLM.y,UI.matrices.ok,DIMS]=read_matrices([fileparts(UI.matrices.ui),filesep]);
 
So, it seems that the path excluding the filename is passed down to "read_matrices". This causes long delays or errors (especially if you have lots of other stuff stored in the directory).
 
We have replaced it with:
[nbs.GLM.y,UI.matrices.ok,DIMS]=read_matrices(UI.matrices.ui);
 
This way, the path including the filename is passed down, and it seems to work.
 
Does this make sense to you? We aren't sure we understand the purpose of line 183.
 
Thank you so much!
Christian