[FieldTrip] Using clusterstat.m straight giving her specific statobs and statrnd
Constantino Méndez Bértolo
constantino.mendezbertolo at ctb.upm.es
Fri Aug 29 18:36:14 CEST 2014
Dear Fieldtrippers
We have a 3x3 design and MEG data, say only mag channels (n102) to simplify.
We want to perform a cluster-based permutation approach but
timelockstatistics (cfg.method = 'montecarlo', cfg.correctm = 'cluster',
etc) cannot deal with interactions when you have more than three levels
(true?)
So we built our 'statobs' and 'statrnd' doing a GLM in -R Statistical
Package- and feed 'clusterstat.m' with them
We have done this with one channel over time with success. However, I am
clueless now about how to solve the problem when dealing with the whole
channel set.
I wonder what is the nature of the cfg.dim that we need to feed
'clusterstat.m' with.
Up to now, we use, (cioming out of -R-):
size(statobs) = nchan*ntime % (102*500) % twin = [0 .5] % seconds
size(statrnd) = nchan*ntime*nrandomizations % (102*500*1000)
and the following presets:
cfg=[];
cfg.clustercritval = Fcritmain; % We genereate this before hand
cfg.tail = 1; cfg.clustertail = 1; cfg.clusterthreshold = 'parametric';
cfg.dim = [1 size(statobs,1) size(statobs,2) ] % <<< The key may be here
load('neuromag306mag_neighb.mat');
cfg.neighbours = neighbours;
cfg.feedback = 'yes';
cfg.numrandomization = 1000;
cfg.clusterstatistic = 'maxsum';
cfg.layout = 'neuromag306mag.lay';
for i = 1:length(cfg.neighbours)
cfg.channel{i} = cfg.neighbours(i).label;
end
stat = clusterstat(cfg,statrnd, statobs)
Which lead us to an error within findcluster
Error using findcluster (line 59)
invalid dimension of spatdimneighbstructmat
Error in clusterstat (line 197)
posclusobs = findcluster(reshape(postailobs,
[cfg.dim,1]),channeighbstructmat,cfg.minnbchan);
If anybody has got some insigth it would be greatly appreciated. Or any
hints. Are the size of my statobs and starnd correct? I can share more
information and firstly apologize if I was not able to describe the
problem accurately, I am confused regarding that 'reshape' and the addition
of one dimension at "...reshape(postailobs,[cfg.dim,1])...", but the
problem arises first when findcluster.m tries to calculate the size of
spatdimneighbstructmat
First line of findcluster.m calcualtes 'spatdimlength' by : " spatdimlength
= size(onoff, 1);" which in our case is "1", which is obviously wrong?.
manythanks&peace2all
--
Constantino Méndez-Bértolo
Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB)
Parque Científico y Tecnológico de la UPM, Campus de Montegancedo
28223 Pozuelo de Alarcón, Madrid, SPAIN
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140829/7425264b/attachment-0001.html>
More information about the fieldtrip
mailing list