ppsp-team / HyPyP

The Hyperscanning Python Pipeline
BSD 3-Clause "New" or "Revised" License
75 stars 42 forks source link

Clarification on the statistical cluster analysis in getting_started.py #78

Closed shortmr closed 2 years ago

shortmr commented 2 years ago

Hi, I was trying to follow the getting_started.py tutorial but had a few questions regarding the statscondCluster function. Could someone help to clarify the structure of the dataset that should be used as an input to this function?

In the tutorial, it is suggested to make "two fake groups with twice the 'participant1' and twice the 'participant2'" to compare inter-brain results to a random signal, however, looking at the example code (pasted below), it seems like the intra-brain results from a single participant are actually used for comparison (i.e., result_intra[0]). Not sure if this was a typo in the instructions or if I'm missing something fundamental here.

data = [np.array([values, values]), np.array([result_intra[0], result_intra[0]])]

statscondCluster = stats.statscondCluster(data=data,
                                          freqs_mean=np.arange(7.5, 11),
                                          ch_con_freq=None,
                                          tail=0,
                                          n_permutations=5000,
                                          alpha=0.05)

Also, as a side note, if I wanted to compare inter-brain results between two conditions with statscondCluster, would I construct the data input as the following? (assuming values1 are the inter-brain connectivity values from the first condition and values2 are the values from the second condition)

data = [np.array([values1, values1]), np.array([values2, values2])]

Thanks!

ghazalehran commented 2 years ago

Dear @shortmr, Thanks for the feedback. stats.statscondCluster is a function that computes cluster-level statistical permutation test, corrected with channel connectivity across space and frequencies. First argument data is a python list with values from different conditions or different groups to compare. Please take a look at how _resultintra is defined and compare it with your data. In your case, I assume it would be: [np.array([values1, values2]), np.array(_examplevalues, _examplevalues)] but the _examplevalues should be extracted/computed from your connectivity matrices as it is shown in the tutorial. In the tutorial _resultintra is in fact computed CSD values. I hope this solves the problem.