[FieldTrip] Correction for MCP using ft_statfun_correlationT

Pia Reinfeld pia.reinfeld at outlook.com
Mon Nov 20 11:36:00 CET 2023


Hi Jan-Mathijs,

thank you for your quick response!
I did specify this option, but I forgot to include it in the code-snipped, sorry for that!
So it looks like that:

        cfg = [];
        cfg.channel          = {'all', '-ECG'};
        cfg.statistic        = 'ft_statfun_correlationT';
        cfg.method           = 'montecarlo';
        cfg.computestat      = 'yes';
        cfg.computecritval   = 'yes';
        cfg.computeprob      = 'yes';
        cfg.alpha            = 0.05;
        cfg.tail             = 0;
        cfg.correcttail      = 'alpha';
        cfg.numrandomization = 10000;
        cfg.correctm         = 'cluster';
        cfg.clusterstatistic = 'maxsum';
        cfg.alpha            = 0.025;
        cfg.clustertail      = 0;
        cfg.clusteralpha     = 0.05;
        cfg.neighbours       = neighbours;
        design = [];
        n1 = length(target);    % number of subjects
        design(1,1:n1)       = fraction_ES_N;
        cfg.design           = design;
        cfg.ivar             = 1;

        stat = ft_timelockstatistics(cfg, diff{:});

The complete error is:
Error using ft_statfun_correlationT
P-values can only be calculated if the test statistics are calculated.
Error using ft_statistics_montecarlo could not determine the parametric critical value for clustering
Error in ft_timelockstatistics (line 185) [stat, cfg] = statmethod(cfg, dat, design);

So I found in line 66 of ft_statfun_correlationT.m, where it checks if the test stats are calculated, so that the probability can be calculated:

if strcmp(cfg.computeprob, 'yes') && strcmp(cfg.computestat, 'no')
  ft_error('P-values can only be calculated if the test statistics are calculated.');
end

But this if statement should be false, because as you can see in my configuration I defined both as ‘yes’. So my configuration might be overwritten within in the scripts or am I wrong?

Thank you again and all the best,
Pia

Von: fieldtrip <fieldtrip-bounces at science.ru.nl> Im Auftrag von Schoffelen, J.M. (Jan Mathijs) via fieldtrip
Gesendet: Samstag, 18. November 2023 17:56
An: FieldTrip discussion list <fieldtrip at science.ru.nl>
Cc: Schoffelen, J.M. (Jan Mathijs) <janmathijs.schoffelen at donders.ru.nl>
Betreff: Re: [FieldTrip] Correction for MCP using ft_statfun_correlationT

Hi Pia,


On 17 Nov 2023, at 17:55, Pia Reinfeld via fieldtrip <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>> wrote:

Dear community,

I am currently working on statistically testing the correlation between EEG data (dependent variable) and quantitative data (independent variable).

I'm using the ft_statfun_correlationT function to correlate and test the quantitative independent variable (e.g. reaction time), which is one value per subject, with the subject's averaged ERP data (31channelx500timepoints) (~100 subjects). I used this configuration from the tutorial and it worked well:

% compute statistics with correlationT
cfg = [];
cfg.statistic        = 'ft_statfun_correlationT';
cfg.method           = 'montecarlo';
cfg.numrandomization = 1000;

n1 = 99;
design(1,1:n1)       = qualitative_variable; % e.g. [0.25, 0.22, …]
cfg.design           = design;
cfg.ivar             = 1;

stat = ft_freqstatistics(cfg, data_brain{:});

I saw that the t-values are calculated by using this:
tstat = rho*(sqrt(nrepl-2))./sqrt((1-rho.^2))

I'm afraid I don't know much about statistics. But wouldn't it be appropriate to correct for the multiple comparison problem by using a cluster-based approach?

Yes, that should be possible.


So I tried to add this to my configuration:

cfg.alpha = 0.025;
cfg.correcttail = 'alpha';
cfg.correctm = 'cluster';
cfg.clustertail = 0;
cfg.clusteralpha = 0.05;
cfg.clusterstatistic = 'maxsum';
cfg.neighbours = neighbours;

I get the error:
Error using ft_statistics_montecarlo could not determine the parametric critical value for clustering
Error in ft_timelockstatistics (line 185)
[stat, cfg] = statmethod(cfg, dat, design);

The error is caused by the fact that the function that is used under the hood for the computation of the (t-scored) correlation value - i.e. ft_statfun_correlationT did not properly compute the corresponding parametric p-value. This is due to the fact that most likely, you did not specify cfg.computeprob = ‘yes’, which is needed to overrule the default value for this parameter (which happens to be ’no’).

I hope that this helps.

Best wishes,
Jan-Mathijs


Is there already a correction for MCP and am I thinking wrongly by using a cluster based approach?
How is the cfg.numrandomization implemented in this statistic? I may have missed something, but it didn't look like random permutation was being used at all.

Any help would be highly appreciated.

Thank you very much and all the best,
Pia
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20231120/8ceaac44/attachment.htm>


More information about the fieldtrip mailing list