Question about 'design matrix' and results of 'fwe_pvalue' when using connectomestats nbse

(1) I am not sure if the design matrix and contrast vector I wrote is correct. And would you like to check them for me.

Your design matrix is not ideal, as it is rank-deficient: the first column can be represented as the sum of the second and third columns, which means that there are an infinite number of solutions to the model fit. You want to either have one column per group, and extract the difference between them:

1  0
1  0
0  1
0  1

1 -1

, or capture the population mean in one column and the group difference in another:

1  1
1  1
1 -1
1 -1

0  1

(2) when the element whose value is lower than 0.05 in “fwe_pvalue.csv” , do it mean the connectivity has significant changes between respective two nodes of two group? and what is it mean when the value is zero?

Beware that the contents of file “fwe_pvalue.csv” in fact contains the values (1-p), where p is the familywise error corrected p-value. So a value of ~1 in that file indicates a p-value of ~0, which would mean that the effect observed in that edge exceeds the vast majority of the null distribution. To apply a p-value threshold of 0.05, you in fact want to look for edges in that file that contain a value of 0.95 or greater.