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

Guillermo Sanchez-Garrido Campos gsancam at upo.es
Mon Mar 25 17:20:03 CET 2024



Hello FieldTrip team,

I've been utilizing the ft_freqstatistics function to conduct 
statistical analysis on my LFP data, recorded using the Neuropixels 
system. During my analysis, I encountered a discrepancy between the 
values in stat.mask and the p-values in stat.prob, which has led to 
confusion in interpreting the results.

Detailed Description:

Power Spectrum Calculation:

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

Statistical Analysis Configuration:

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);

Observations:

Upon reviewing the results, I observed that stat.mask did not align with 
the p-values in stat.prob as expected. I anticipated that stat.mask 
would indicate values lower than cfg.alpha, but this was not consistent 
with the p-values. Additionally, I noticed that when stat.cirange 
contains values of "0", corresponding values of "1" appear in stat.mask, 
despite the p-value not being lower than cfg.alpha.

Input Data:

My data is structured into two 3D matrices, datafftpre and datafftpost, 
each representing LFP recordings for 3 subjects (1st dimension), across 
310 channels (rows), and 649 frequencies (columns). Each cell contains 
the power spectrum value for the corresponding subject, channel, and 
frequency.

I would greatly appreciate any guidance or suggestions on correctly 
interpreting the results of my analysis.

Thank you for your attention and support.

Warm regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20240325/650572b4/attachment.htm>


More information about the fieldtrip mailing list