[Eeglablist] statcond/statcondfieldtrip cluster correction
Arnaud Delorme
arno at ucsd.edu
Mon Apr 29 17:55:46 PDT 2019
Dear Tailor,
statcondfieldtrip is a support function for EEGLAB and so the dimension for channel is usually fixed (I am not sure of the position, maybe try channels X samples X subjects instead of samples X channels X subjects). You would need to edit the function and change the dimord field before the call to ft_freqstatistics, something like ’time_chan_rpt’.
Note that this is in theory as well as Fieldtrip was not compatible (in the past, I am not sure now) with random arrangement of dimensions for dimord. If you are using the function on custom array on the command line, you might as well directly call the ft_freqstatistics function.
Best wishes,
Arno
> On Apr 24, 2019, at 11:55 AM, Taylor Hearn <thearn at asu.edu> wrote:
>
> Hi Arno,
>
> Thank you for this clarification! I still seem to be having some issues with statcondfieldtrip though. Perhaps you could look at my syntax and provide some feedback? Here is what I'm in inputting to statcondfieldtrip:
>
> cfg.method = 'template';
> cfg.template = 'C:\Users\thearn\Documents\MATLAB\fieldtrip-20180423\template\neighbours\elec1020_neighb.mat';
> cfg.channel = chan;
> cfg.correctm = 'cluster';
> [neighbours, cfg] = ft_prepare_neighbours(cfg);
> [mmn_stats, ~, ~] = statcondfieldtrip(...
> data,...
> 'paired', 'on',...
> 'method', 'permutation',...
> 'naccu', 1000,...
> 'alpha', 0.05,...
> 'neighbours', neighbours,...
> 'structoutput', 'on');
>
> "data" is a 2x1 cell array, each cell containing a matrix with dimensions: samples X channels X subjects
>
> This yields the following output:
>
> Trying to load sensor neighbours from a template
> Successfully loaded neighbour structure from C:\Users\thearn\Documents\MATLAB\fieldtrip-20180423\template\neighbours\elec1020_neighb.mat
> there are on average 7.6 neighbours per channel
> the call to "ft_prepare_neighbours" took 0 seconds
> 1 x 2, paired data, computing T values
> Warning: could not determine dimord of "freq" in:
>
> dimord: 'rpt_chan_freq_time'
> powspctrm: [8×151×9 double]
> label: {9×1 cell}
> freq: 1
> time: 1
>
>
> Warning: could not determine dimord of "powspctrm" in:
>
> dimord: 'rpt_chan_freq_time'
> powspctrm: [8×151×9 double]
> label: {9×1 cell}
> freq: 1
> time: 1
>
>
> the call to "ft_selectdata" took 0 seconds
> Warning: could not determine dimord of "powspctrm" in:
>
> powspctrm: [8×151×9 double]
> label: {9×1 cell}
> freq: 1
> time: 1
> dimord: 'rpt_chan_freq_time'
> cfg: {[] []}
>
>
> using "ft_statistics_montecarlo" for the statistical testing
> Warning: The field cfg.neighbours is unused, it will be removed from your configuration
>
> using "ft_statfun_depsamplesT" for the single-sample statistics
> constructing randomized design
> total number of measurements = 2
> total number of variables = 16
> number of independent variables = 1
> number of unit variables = 1
> number of within-cell variables = 0
> number of control variables = 0
> using a permutation resampling approach
> repeated measurement in variable 2 over 2 levels
> number of repeated measurements in each level is 1 1
> Error using ft_statfun_depsamplesT (line 79)
> Invalid specification of the design array.
>
> Error in ft_statistics_montecarlo (line 272)
> [statobs, cfg] = statfun(cfg, dat, design);
>
> Error in ft_freqstatistics (line 190)
> [stat, cfg] = statmethod(cfg, dat, design);
>
> I've tried to trace the source of the error in the code, but I can't seem to find the source of the "Invalid specification of the design array". Any thoughts?
>
> Thanks again,
> Taylor
>
>
> Taylor Hearn
> Biomedical Engineering PhD Candidate
> APAcT-IGERT Fellow
> Arizona State University
>
>
> On Wed, Apr 24, 2019 at 1:04 AM Arnaud Delorme <arno at ucsd.edu> wrote:
> Hi Taylor,
>
> It is better to use statcondfieldtrip, which calls uses the original cluster method. The ‘cluster’ option of statcond is an equivalent implementation although it cannot take channel neighbors into account. It only works for time or time x frequency decompositions. It was added because of frustration with the speed of the Fieldtrip original cluster method (although it is not much faster).
>
> Best wishes,
>
> Arno
>
> > On Apr 17, 2019, at 8:14 AM, Taylor Hearn <thearn at asu.edu> wrote:
> >
> > Hi,
> >
> > I would like to perform a cluster correction for multiple comparisons, but
> > I am a little confused by the syntax of these two functions. Given my
> > within group comparison for my data (samples X channels X subjects), is it
> > correct to assume that this should be set up as a 2x1 cell? Also, I know I
> > want to use the following options:
> >
> > paired = on
> > method = permuation
> > naccu = 1000
> > alpha = 0.05
> >
> > but from here I am not sure if I should use the "cluster" option for
> > "statcond" or the "neighbours" option for "statcondfieldtrip". If I use
> > "neighbours" could you also detail the input to the "ft_prepare_neighbours"
> > functions?
> >
> > Thanks in advance,
> > Taylor
> >
> > Taylor Hearn
> > Biomedical Engineering PhD Candidate
> > APAcT-IGERT Fellow
> > Arizona State University
> > _______________________________________________
> > Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> > To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.ucsd.edu
> > For digest mode, send an email with the subject "set digest mime" to eeglablist-request at sccn.ucsd.edu
>
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.ucsd.edu
> For digest mode, send an email with the subject "set digest mime" to eeglablist-request at sccn.ucsd.edu
More information about the eeglablist
mailing list