help > Extracting values for further analysis
Showing 1-5 of 5 posts
Display:
Results per page:
Sep 17, 2019  01:09 PM | thomas88
Extracting values for further analysis
Dear Andrew,

I have a question about extracting individual participant connectivity values after running NBS. 

I am running a repeated measures design looking at PRE vs POST effect following an intervention. 

With the aid of your manual I have been able to extract the pairs of nodes (in my case EEG electrodes) with significant connections. 

What I would now like to do is extract the connectivity values for each subject, for each significant connection, so that I have a set of values for each subject that I can use to run further connectivity analyses with behavioral measures etc. 

I have used your example code:

i=1;
j=2; 
global nbs;
nbs = NBS;
N=STATS.N;
ind_upper=find(triu(ones(N,N),1));
cross_ref=zeros(N,N); cross_ref(ind_upper)=1:length(ind_upper);
cross_ref=cross_ref+cross_ref';
ind=cross_ref(i,j);
fprintf('%0.2f\n',GLM.y(:,ind));

I have two questions:

1) As I am using a repeated measures design with 20 subjects in each of the PRE and POST conditions, this code appears to output a list of values for the total number of subjects in my matrix (i.e., 40 (20 pre, 20 post)). Is there a way I can get the difference in connectivity for each connection between the PRE vs POST conditions for the 20 subjects? (I presume this would be the most appropriate measure to use for correlations etc?)

2) when specifying the nodes (i.e., 'i' and 'j' values in the above code) do these just correspond to the row number in the 'node labels' text file I used when running NBS? (e.g., if there was a significant connection between node 7 and node 8 and electrode F7 was the 7th electrode, while F5 was the 8th, then i = 7 and j = 8)? 

Thank you very much for your help.
Sep 18, 2019  01:09 AM | Andrew Zalesky
RE: Extracting values for further analysis
Hi Thomas, 

I response to you 2nd questions, the answer is yes - you are correct in your assumption. 

Regarding your first question, to get the difference, you could simply subtract the 20 pre values from the 20 post values and then use the resulting values to correlate with your behavioural measure. This would require a minimal amount of coding on top of the code that you have already pasted below. Using the difference is appropriate, but you could also set up a GLM in SPSS or some other statistical software, where you list the 40 FC values and 40 behavioural measures, and test for a pre-post effect.

I hope that helps,

Andrew

Originally posted by thomas88:
Dear Andrew,

I have a question about extracting individual participant connectivity values after running NBS. 

I am running a repeated measures design looking at PRE vs POST effect following an intervention. 

With the aid of your manual I have been able to extract the pairs of nodes (in my case EEG electrodes) with significant connections. 

What I would now like to do is extract the connectivity values for each subject, for each significant connection, so that I have a set of values for each subject that I can use to run further connectivity analyses with behavioral measures etc. 

I have used your example code:

i=1;
j=2; 
global nbs;
nbs = NBS;
N=STATS.N;
ind_upper=find(triu(ones(N,N),1));
cross_ref=zeros(N,N); cross_ref(ind_upper)=1:length(ind_upper);
cross_ref=cross_ref+cross_ref';
ind=cross_ref(i,j);
fprintf('%0.2f\n',GLM.y(:,ind));

I have two questions:

1) As I am using a repeated measures design with 20 subjects in each of the PRE and POST conditions, this code appears to output a list of values for the total number of subjects in my matrix (i.e., 40 (20 pre, 20 post)). Is there a way I can get the difference in connectivity for each connection between the PRE vs POST conditions for the 20 subjects? (I presume this would be the most appropriate measure to use for correlations etc?)

2) when specifying the nodes (i.e., 'i' and 'j' values in the above code) do these just correspond to the row number in the 'node labels' text file I used when running NBS? (e.g., if there was a significant connection between node 7 and node 8 and electrode F7 was the 7th electrode, while F5 was the 8th, then i = 7 and j = 8)? 

Thank you very much for your help.
Sep 18, 2019  07:09 PM | thomas88
RE: Extracting values for further analysis
Thank you for clarifying Andrew.
Sep 26, 2025  10:09 AM | liam nestor - University of Cambridge
RE: Extracting values for further analysis

I want to conduct a split-half analysis using unpaired t-tests.


For the first half of the data, I conduct an unpaired t-test and find a network where the two groups are different. I extract the coefficient values from all first half data matrices and save the adj_edge_file.


I don't want to conduct another unpaired t-test on the second half of the data in the same way in NBS, as it is impossible to replicate. 


Instead, I just want to extract the coefficent values from the second half data matrices, but using the adj_edge_file that comes from the first half analysis.


I thought this would just be a simple case of loading the second half data matrices in NBS and then extracting the coefficient values.    


It doesn't do this, and just keeps giving me the coefficient values from all first half data matrices.


Is there a way of doing this in NBS, but that I am not getting right?


All the best, Liam.   

Sep 26, 2025  11:09 PM | Andrew Zalesky
RE: Extracting values for further analysis

Hi Liam, 


You cannot do this in the NBS software. 


But you can save the network from the first half and fit a model to each edge in this network using the second half data as part of a separate function that you would need to write. 


If you load in the second half data into NBS, it will perform statistical testing on this half. It is not possible to just compute coefficients. 


Best, 


Andrew


 


Originally posted by liam nestor:



I want to conduct a split-half analysis using unpaired t-tests.


For the first half of the data, I conduct an unpaired t-test and find a network where the two groups are different. I extract the coefficient values from all first half data matrices and save the adj_edge_file.


I don't want to conduct another unpaired t-test on the second half of the data in the same way in NBS, as it is impossible to replicate. 


Instead, I just want to extract the coefficent values from the second half data matrices, but using the adj_edge_file that comes from the first half analysis.


I thought this would just be a simple case of loading the second half data matrices in NBS and then extracting the coefficient values.    


It doesn't do this, and just keeps giving me the coefficient values from all first half data matrices.


Is there a way of doing this in NBS, but that I am not getting right?


All the best, Liam.