[FieldTrip] Using ft_regressconfound to remove effects of age from group cell array

Eelke Spaak e.spaak at donders.ru.nl
Thu Apr 30 10:45:25 CEST 2020


Dear Paul,

ft_regressconfound is (primarily) designed to regress out variance
explained *across trials*, not across individuals. It should work if
you use it on a single subject, with the important caveat that
ft_timelockanalysis needs to have been run with cfg.keeptrials = 'yes'
(yielding a .trial field in the output, in addition to the .avg).

The rather old (because nowadays rarely needed) function
ft_timelockgrandaverage has an option analogous to keeptrials, namely
.keepindividual = 'yes'. If you specify this, you'll get stacked ERFs
in a .individual field in the output.

ft_regressconfound *might* be able to deal with such a .individual
field automatically, but if I'm honest I doubt it. If this doesn't
work, it's a relatively minor hack to simply rename .individual it to
.trial, though, and then call ft_regressconfound on the hacked data
structure (optionally you'll also have to hack .dimord from
'subj_time' to 'rpt_time' or something).

Hope that helps!
Eelke

On Thu, 30 Apr 2020 at 06:17, Paul Dhami <pdhami06 at gmail.com> wrote:
>
> Dear FieldTrip community,
>
> I would like to use ft_regressconfound to account for the effects of age. However, I am unsure how to use it with a cell array containing the outputs of ft_timelockanalysis with multiple subjects. Even when trying to use ft_regressconfound on a single subject, I get the error that field "trial" not present in data.
>
> Any help would be greatly appreciated.
>
> Thank you,
> Paul
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202



More information about the fieldtrip mailing list