Hello,
I really want to try NBS as it is such a great tool. But, I am not sure why my analysis is not working. I would appreciate some guidance to help me troubleshoot.
I keep getting the same error, "Stop: Design Matrix not found or inconsistent."
I set the path in Matlab for the NBS1.2 directory. Path to directory: D:/MATLAB/NBS1.2
The directory with my data (matrices..design matrix..) is NBS. Path to directory: D:/MATLAB/NBS
In Matlab I am working in the D:/MATLAB Directory. I even tried working directly in the NBS directory where my data is stored.
I am able to run the schnizophrenia example analysis with the data provided in the NBS1.2 folder, but nothing seems to work for my situation. I am using the Matlab version 2022a.
I tried looking at examples of design matrix txt files in this forum.
The 1st column is intercept, 2nd is patient (1) and then control (-1), 3rd is behavioural measure, and the 4th column is the interaction. As an aside, I have 14 patients and 14 controls. Here is the snippet of 3 patients, then 3 controls.
1 1 91 91
1 1 89 89
1 1 90 90
1 -1 111 -111
1 -1 111 -111
1 -1 98 -98
For the contrast, I tried [0,0,0,1]. T-test. I even tried removing commas.
The second design matrix I tried to run was:
1 91 91
1 89 89
1 90 90
0 111 0
0 111 0
0 98 0
The 1st column is patient (1) and then control (0), 2nd is behavioural measure, and the 3rd column is the interaction.
I used the contrast [0,0,1] and again I selected T-test.
I still got the same error. I went back and looked at my matrices and even removed the NaN and replaced it with a value of 1. (I attached one of my matrices). I have 28 in total. I also made sure the path to the data was clearly written in NBS.
Am I missing something? I want to see how functional connectivity relates to behavioural measures of visual perception, and does this relationship differ between patient and control groups?
I look forward to any suggestions or if you can let me know why I keep getting the same error message that would be very much appreciated. I spent a lot of time alone trying to troubleshoot this issue with no sucess as of yet...
Thank you again.
Hello, from your description, I would say that this should all be correct. The error "Stop Design Matrix not Found" is called if the number of matrices for the subjects does not correspond to the number of entries in the design matrix. Or if it does not recognize the entries as numbers.
In order to better localize the error, the file from the design would be useful.
regards Max
Originally posted by derya:
Hello,
I really want to try NBS as it is such a great tool. But, I am not sure why my analysis is not working. I would appreciate some guidance to help me troubleshoot.
I keep getting the same error, "Stop: Design Matrix not found or inconsistent."
I set the path in Matlab for the NBS1.2 directory. Path to directory: D:/MATLAB/NBS1.2
The directory with my data (matrices..design matrix..) is NBS. Path to directory: D:/MATLAB/NBS
In Matlab I am working in the D:/MATLAB Directory. I even tried working directly in the NBS directory where my data is stored.
I am able to run the schnizophrenia example analysis with the data provided in the NBS1.2 folder, but nothing seems to work for my situation. I am using the Matlab version 2022a.
I tried looking at examples of design matrix txt files in this forum.
The 1st column is intercept, 2nd is patient (1) and then control (-1), 3rd is behavioural measure, and the 4th column is the interaction. As an aside, I have 14 patients and 14 controls. Here is the snippet of 3 patients, then 3 controls.
1 1 91 91
1 1 89 89
1 1 90 90
1 -1 111 -111
1 -1 111 -111
1 -1 98 -98
For the contrast, I tried [0,0,0,1]. T-test. I even tried removing commas.
The second design matrix I tried to run was:
1 91 91
1 89 89
1 90 90
0 111 0
0 111 0
0 98 0
The 1st column is patient (1) and then control (0), 2nd is behavioural measure, and the 3rd column is the interaction.
I used the contrast [0,0,1] and again I selected T-test.
I still got the same error. I went back and looked at my matrices and even removed the NaN and replaced it with a value of 1. (I attached one of my matrices). I have 28 in total. I also made sure the path to the data was clearly written in NBS.
Am I missing something? I want to see how functional connectivity relates to behavioural measures of visual perception, and does this relationship differ between patient and control groups?
I look forward to any suggestions or if you can let me know why I keep getting the same error message that would be very much appreciated. I spent a lot of time alone trying to troubleshoot this issue with no sucess as of yet...
Thank you again.
I tr
I tried once to use your *.mat files and I get the same error because it can't read the files correctly because of the variable definition. The easiest way is to convert the mat files to txt. files.
Code*****
files = dir('*.mat') ; % you are in the folder of
files
N = length(files) ;
% loop for each file
for i = 1:N
thisfile = files(i).name ;
Data = load(thisfile);
DataField = fieldnames(Data);
thisfile=strcat(thisfile(1:end-4) , '.txt')
dlmwrite(thisfile,
Data.(DataField{1}),'delimiter','\t');
end
Thanks for troubleshooting with me! I could not for the life of me figure out what was going on.. I will try and convert them into text files. In the mean time, is there any regulations with spacing in between ROI Z scores? (Do they all need to be uniform or have specific spacing?)
Here is one design matrix (attached).
And this one other one which is this one would be more of an interaction approach?
1 91 91
1 89 89
1 90 90
1 67 67
1 84 84
1 103 103
1 86 86
1 59 59
1 113 113
1 86 86
1 90 90
1 56 56
1 94 94
1 80 80
0 111 0
0 111 0
0 98 0
0 90 0
0 110 0
0 98 0
0 106 0
0 99 0
0 97 0
0 117 0
0 109 0
0 132 0
0 97 0
0 110 0
I am still trying to figure out which way to design the matrix. Whether looking at the difference between patients and controls or rather an interaction?
Originally posted by deryaadil:
Thanks for troubleshooting with me! I could not for the life of me figure out what was going on.. I will try and convert them into text files. In the mean time, is there any regulations with spacing in between ROI Z scores? (Do they all need to be uniform or have specific spacing?)
I converted the mat file into text (attached to this message). But I am not sure if the format is ok?
Thanks again!!