NBS for two 'mean' graphs

Good Afternoon,

I have a quick question regarding the use of the NBS statistics toolbox within Graphvar. If I have two groups and from each have calculated a mean network for each group, can I use the NBS package to compare the two mean graphs. I worry that this wouldnt be statistically valid in the sense that the sample would effectively be two. 

Instead would I need to run a test like the hamming distance to compare two individual mean networks? If so is this within the scope of the Graphvar program?


What you're attempting to do is somewhat like a t-test. You have the means for two groups (matrices), and want to compare them.
However, to do significance testing/NBS, GraphVar needs to estimate the distribution of each of the groups, either by calculating the variance for a t-test, or by simulating a null distribution through permutation testing. If you only have the mean matrices for each group, then this is not possible. What kind of data are you using? Would it be possible for you to obtain the variance matrix of each group?

Here is some alternative way that I think off of the top of my head right now (of course it also depends on the underlying data if the following approach is valid):

You could use the BCT function “null_model_und_sign” or the fast C++ version implemented in GraphVar (“c_null_model_und_sign”) to create group specific random matrices (i.e., 1000 for group 1 and 1000 for group 2). Subsequently, you compute the difference of all cells between the original matrices (Diff_Orig = mean group 1 – mean group2). Do this also for the group specific random matrices (Diff_rand = random group 1 – random group 2). This generates a null distribution of differences for each cell. Within this distribution (per cell) you must determine the percentage position of Diff_Orig within Diff_rand. If Diff_Orig is in the top 5 %, you may interpret it as significant (1 vs. 0). Eventually, this will result in one binarized matrix, where the entries (1 or 0) denote significant differences based on the randomized group mean matrices and also one p-value matrix (containing the corresponding non parametric p-vals). Now, simply correct for multiple comparisons by computing FDR (or Bonferroni) on the p-value matrix and use the BCT “get_component” function on the corresponding binarized matrix to extract a graph component.

If you perform multiple comparison correction, this procedure allows you also to interpret single links meaningfully (which is not possible with NBS, where only the entire component can be interpreted).

This procedure can be performed with simple matlab programming outside of GraphVar. If you use GraphVar for generating the randomized matrices, the results can be found in the interim results folder.

I hope this helps,

Johann and Lea

Hi Both, 

Thanks for your help, it is much appreciated.

In terms of the data, the graphs are derived from correlations between cortical thickness measurements of brain regions. Therefore, as each pair of regions has only a single measurement in each participant, only a group-level graph can be generated. Therefore, because the edgeweight is the correlation-coefficient itself and not the mean of multiple correlation-coefficients I believe it wouldnt be possible to generate a variance matrix.

In your approach, am I right in thinking it wouldn't be neccesary to run the get_component function if I just wanted to look at the individual links of the graph and their significance?



Hi Dan,
with the described approach you can also just examine specific connections and you would not have to run the get_component code... although it may be interesting. In my experience,  performing a conservative FDR link-based controlling procedure often result in similar/overlapping "graph components" as when identifiying significant graph components with the NBS procedure.


Hi Johann,

Thanks for clearing that up. I'm sorry for my naivity, but you say that the comparison could be written in Matlab easily. I have limited experience with the BCT scripts and am unsure how I would go about this, any pointers?

Sorry to bug you!

Best wishes,