About Generating Difference Decoding Plots & Matrices #19
Unanswered
batiyilmaz
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Hello Bati, You can generate these graphs using the MVPAlab built-in functions. First, you need to subtract the results obtained from two different decoding analyses. Keep in mind that you should subtract both the curves/matrices and the permuted results. Once you have the difference between both analyses, you just need to run the permutation analysis by passing the new results as arguments. This code should generate the difference decoding plots: %% Initialize the configuration files:
cfg = mvpalab_init();
run cfg_file
% Here you shoud modify the configuration files to compute different
% decoding analyses.
cfg_a = cfg;
cfg_b = cfg;
%% Load data, generate conditions and feature extraction:
[cfg_a,data_a,fv_a] = mvpalab_import(cfg_a);
[cfg_b,data_b,fv_b] = mvpalab_import(cfg_b);
%% Compute MVPA analyses:
[result_a,cfg_a] = mvpalab_mvpa(cfg_a,fv_a);
[result_b,cfg_b] = mvpalab_mvpa(cfg_b,fv_b);
%% Compute permutation maps:
[permaps_a,cfg_a] = mvpalab_permaps(cfg_a,fv_a);
[permaps_b,cfg_b] = mvpalab_permaps(cfg_b,fv_b);
%% Calculate the difference:
result.acc = result_a.acc - result_b.acc;
permaps.acc = permaps_a.acc - permaps_b.acc;
%% Compute the statistical analysis:
stats = mvpalab_permtest(cfg_a,result,permaps);
%% Plot the results:
graph = mvpalab_plotinit();
% Plot significant clusters (above and below chance):
graph.stats.above = true;
graph.stats.below = true;
% Significant indicator:
graph.sigh = .4;
% Axis limits:
graph.xlim = [-200 1500];
graph.ylim = [-.3 .3];
% Axes labels and titles:
graph.xlabel = 'Time (ms)';
graph.ylabel = 'Classifier performance';
graph.title = 'Demo plot (statistical significance)';
% Smooth results:
graph.smoothdata = 5;
% Plot results:
figure;
hold on
mvpalab_plotdecoding(graph,cfg_a,result.acc,stats.acc); Note: Please note the you should modify both cfg variables in order to compute two different decoding analyses. Best, |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi David,
I just wanted to form this Q&A thread to kindly ask you about the possibility of generating difference decoding plots & matrices using the toolbox. This is a common application in many publications that researchers substract one decoding result from another to yield a difference decoding curve/matrix. My question is that when I substract the signals, how could I run the Stelzer permutation test on these difference curves/TGM matrices using the toolbox and how it would be possible to plot these difference curves/matrices using the built-in functions of the toolbox?
Thank you so much for your time and help in advance.
Best,
Bati
Beta Was this translation helpful? Give feedback.
All reactions