Hi all,
Hope everyone is doing well!
I am trying to create 3D matrices to run a cluster-based permutation test as in this example and run linear mixed models later to follow suggestions from this article.
I would like to run an F-test for a 2 by 2 design. The challenge is that one of the conditions comes from the metadata of the events which is related to behavioral performance and does not have a specific event id.
I come up with a dirty solution, please see below, but it will be nice to hear your suggestions on how to add participant information into X lists.
Bonus: How one can run CBPT on evoked-level data? Would it be easier?
Thanks in advance!
Bests,
Gözem
event_id = {'Stimulus/S 70': 70,
'Stimulus/S 71': 71}
data.drop_channels(['HEL', 'HER', 'VED', 'ML', 'MR'])
data.equalize_event_counts(event_id)
# %%%%%
epoch701 = data[(data.metadata.condition == "Stimulus/S 70") & (data.metadata.corrResp == 1)]
epoch700 = data[(data.metadata.condition == "Stimulus/S 70") & (data.metadata.corrResp == 0)]
epoch711 = data[(data.metadata.condition == "Stimulus/S 71") & (data.metadata.corrResp == 1)]
epoch710 = data[(data.metadata.condition == "Stimulus/S 71") & (data.metadata.corrResp == 0)]
# %%%%%
event_id1 = {'Stimulus/S 70': 70}
X701 = [epoch701[event_name].get_data() for event_name in event_id1]
X701 = [np.transpose(x, (0, 2, 1)) for x in X701]
X700 = [epoch700[event_name].get_data() for event_name in event_id1]
X700 = [np.transpose(x, (0, 2, 1)) for x in X700]
# %%%%%
event_id2 = {'Stimulus/S 71': 71}
X711 = [epoch711[event_name].get_data() for event_name in event_id2]
X711 = [np.transpose(x, (0, 2, 1)) for x in X711]
X710 = [epoch710[event_name].get_data() for event_name in event_id2]
X710 = [np.transpose(x, (0, 2, 1)) for x in X710]
# %%%%%
X = X701 + X700 + X711 + X710