[FieldTrip] calculating grand mean while ignoring channels with NaN values ("ft_freqgrandaverage")

Lei, A. (Anqi) anqi.lei at ru.nl
Mon Feb 6 09:12:08 CET 2023


Dear FieldTrip list,

I have a quick question about using “ft_freqgrandaverage” to calculate a group average of powerspectrum while ignoring missing channels across subjects.

Some subjects in my dataset have bad channels so I dropped these channels and replaced their values with NaNs instead of doing interpolation. However, “ft_freqgrandaverage” doesn’t seem to ignore these NaNs while calculating the grand mean so I ended up with a lot of missing channels in my group average – is there a way for the function to ignore channels with NaNs? (I tried to use cfg.nanmean = 'yes' but it didn’t work).

Thank you!

Best,
Anqi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20230206/c8e8aaba/attachment.htm>


More information about the fieldtrip mailing list