[FieldTrip] Inconsistency between stat.mask and p-values in ft_freqstatistics

mikkelcv at drcmr.dk mikkelcv at drcmr.dk
Wed Mar 20 10:32:11 CET 2024


Dear Guillermo

If I remember correctly, the mask for the two-tailed test is based on cfg.alpha / 2.

Best regards
Mikkel

Fra: fieldtrip <fieldtrip-bounces at science.ru.nl> på vegne af Guillermo Sanchez-Garrido Campos via fieldtrip <fieldtrip at science.ru.nl>
Dato: onsdag, 20. marts 2024 kl. 10.25
Til: fieldtrip at science.ru.nl <fieldtrip at science.ru.nl>
Cc: Guillermo Sanchez-Garrido Campos <gsancam at upo.es>
Emne: [FieldTrip] Inconsistency between stat.mask and p-values in ft_freqstatistics

Hello FieldTrip team,

I've been using the ft_freqstatistics function to perform statistical analysis on my LFP data (recorded with Neuropixels system). I've noticed a discrepancy between the values in stat.mask and the p-values in stat.prob, which has caused confusion in interpreting the results.

Detailed Description:

I have configured my analysis as follows:

  1.  Calculation of Power Spectrum:

cfg = [];

cfg.method       = 'mtmfft';

cfg.output       = 'pow';

cfg.taper        = 'hanning';

cfg.foilim       = [1 100]; % Frequency range

cfg.polyremoval  = -1;

cfg.pad          = 'nextpow2';

datafftpre = ft_freqanalysis(cfg, datapre); % Same for post


  1.  Statistical Analysis:

cfg = [];

cfg.method           = 'montecarlo';

cfg.statistic        = 'ft_statfun_depsamplesT';

cfg.correctm         = 'no';

cfg.alpha            = 0.05;

cfg.tail             = 0;

cfg.correcttail      = 'prob';

cfg.computestat      = 'yes';

cfg.computeprob      = 'yes';

cfg.computecritval   = 'yes';





% Design configuration for dependent groups

nsubj = size(data, 1);

design = zeros(2, 2 * nsubj);

design(1, 1:nsubj)         = 1;

design(1, nsubj+1:2*nsubj) = 2;

design(2, :) = repmat(1:nsubj, 1, 2);



cfg.design = design;

cfg.ivar   = 1;

cfg.uvar   = 2;



stat = ft_freqstatistics(cfg, datafftpre, data);


However, upon inspecting the results, I noticed that stat.mask did not match the p-values in stat.prob. I expected the values in stat.mask to reflect the p-values lower than cfg.alpha, but this was not the case.

Input Data:

My data is organized into two 3D matrices, datafftpre and datafftpost, each with 3 subjects (1st dimension), 310 rows (recording channels), and 649 columns (frequencies). Each cell contains the value of the power spectrum for each subject, channel, and frequency.

I appreciate any guidance or suggestions on how to correctly interpret the results of my analysis.

Thank you for your attention and support.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20240320/1a462209/attachment.htm>


More information about the fieldtrip mailing list