clusterrandanalysis on scalar values + problem with topoplotER
Marco Buiatti
marco.buiatti at GMAIL.COM
Fri Oct 20 19:02:08 CEST 2006
Thank you Robert, now EVERYTHING WORKS!!!
More in detail:
On 10/19/06, Robert Oostenveld <r.oostenveld at fcdonders.ru.nl> wrote:
> > computing statistic 2 from 8
> > Warning: Divide by zero.
> >> In fieldtrip-20061016\private\statfun_depsamplesT at 106
> > In statistics_montecarlo at 278
> > In fieldtrip-20061016\private\statistics_wrapper at 233
> > In timelockstatistics at 50
> >
> > ... same output up to statistic 8 and then
>
> Hmm, to me this seems to indicate that you have samples at which you
> do not have any variance, i.e. the computation of the t-score is
> mean_difference/pooled_variance, and since variance is zero, you have
> someting divided by zero, probably resulting in "Inf", i.e. infinite
> numbers. Could it be that you have baseline corrected data that is
> corrected to only one sample (i.e. the sample at time t=0), and that
> hence one sample in the data is always zero?
You were right, and the reason for this was even more trivial: I had
included the reference channel, which is always zero by definition.
Now data are in average reference.
>
> I don't know how a t-score of Inf will affect the other computations.
> But the actual problem is
>
> > ??? Attempted to access (2); index out of bounds because numel()=1.
> >
> > Error in ==> fieldtrip-20061016\private\clusterstat at 65
> > postailcritval = cfg.clustercritval(2);
> >
> > Error in ==> statistics_montecarlo at 305
> > stat = clusterstat(cfg, statrand, statobs);
> >
> > Error in ==> fieldtrip-20061016\private\statistics_wrapper at 233
> > [stat, cfg] = statmethod(cfg, dat, cfg.design);
> >
> > Error in ==> timelockstatistics at 50
> > [stat] = statistics_wrapper(cfg, varargin{:});
>
> That problem is NOT due to the warning above (i.e. the potential t-
> value of inf), but just a small programming error. The sequence of if-
> statements in that section of code was the wrong way around. Please
> find a corrected version of clusterstat.m attached to this mail.
>
> Actually, looking further into the code, I am surprised that you get
> this error. It means that the low level statfun_depsamplesT is using
> a cfg.tail=1 (that corresponds to cfg.clustertail in
> statistics_montecarlo itself). But from your cfg I do not see that
> you explicitely define a positive-tailed test, and the default set at
> the level of statistics_montecarlo should be two-tailed. Do you have
> any ideas about this yourself?
Everything works now with the new clusterstat.m! Here you are my cfg
at the point where it crashed before:
cfg =
design: [2x6 double]
ivar: 1
uvar: 2
statistic: 'depsamplesT'
numrandomization: 'all'
alpha: 0.0500
clusterstatistics: 'maxsum'
clusterthreshold: 'parametric'
clusteralpha: 0.0500
neighbourdist: 0.8000
neighbours: {1x129 cell}
latency: [0 0.5000]
method: 'montecarlo'
correctm: 'cluster'
channel: {129x1 cell}
frequency: []
avgoverchan: 'no'
avgovertime: 'no'
avgoverfreq: 'no'
channelcmb: []
precision: 'double'
version: [1x1 struct]
previous: {1x6 cell}
dim: [129 1 126]
tail: 0
feedback: 'text'
cvar: []
wvar: []
clusterstatistic: 'maxsum'
clustercritval: 2.9200
clustertail: 0
factor: 1
unitfactor: 2
orderedstats: 'no'
multivariate: 'no'
minnbchan: 0
As you see, cfg.tail=0 but I have only one value of
cfg.clustercritval (while the former clusterstat required two).
I checked that results are totally compatible with the ones I obtained
with clusterrandanalysis, and I easily transformed the spatial data I
have (what I erroneously called scalar in my initial e-mail in this
thread) to perform cluster randomization analysis.
Thank you again for the follow up.
Marco
--
Marco Buiatti - Post Doc
**************************************************************
Cognitive Neuroimaging Unit - INSERM U562
Service Hospitalier Frederic Joliot, CEA/DRM/DSV
4 Place du general Leclerc, 91401 Orsay cedex, France
Telephone: +33 1 69 86 77 65 Fax: +33 1 69 86 78 16
E-mail: marco.buiatti at gmail.com Web: www.unicog.org
***************************************************************
More information about the fieldtrip
mailing list