Within-subject coherence statististics for virtual sources

Robert Oostenveld r.oostenveld at FCDONDERS.RU.NL
Mon Nov 27 16:37:17 CET 2006


Hi Lornia,

On 20 Nov 2006, at 19:32, Lorina Naci wrote:
> Thank you for sending me the modified script. I’ve defined the  
> cfg.neighbours{j}.label by entering one of my data structures.  
> Also, I’ve loaded all my subjects’ data structures which are saved  
> in the file ‘allsubjects.m’
>
> I ran it but again it crashes, giving the same error pointing to  
> the statistics_wrapper, saying that the input data could not be  
> determined. I am attaching here my scrip and ‘allsubjects.m’
> Sorry to keep bothering you with this.

I found one small bug in your attached script

for j = 1:length(data1257Vis.label);
   cfg.neighbours{j}.label = data1257Vis.label{j};
   cgf.neighbours{j}.neighblabel = {};       <========== TYPO cgf->cfg
end

Furthermore, I do not understand why your attached script is a  
mixture of fieldtrip code and your own code. You should put your own  
code in a script (which does NOT start with "function"), and call  
that script from the command line. The script should call the  
freqstatistics function.

If I do the following using your data, it seems to work for me.

best regards,
Robert

%-------------------- script starts here --------------------

load allsubjects

cfg = [];
cfg.method = 'montecarlo';
cfg.statistic = 'diff';
% cfg.parameter = 'cohspctrm';   <==== it will always use powspctrm,  
regardless of this parameter
cfg.numrandomization = 500;
cfg.design = [1 1 2 2 3 3 4 4 5 5 6 6; 1 2 1 2 1 2 1 2 1 2 1 2];
cfg.ivar = 2;
cfg.uvar = 1;
cfg.correctm = 'yes';
for j = 1:length(data1257Vis.label);
   cfg.neighbours{j}.label = data1257Vis.label{j};
   cfg.neighbours{j}.neighblabel = {};
end

stat = freqstatistics(cfg, data1257XM, data1257Vis, data1299XM,  
data1299Vis, data349XM, data349Vis, data449XM, data449Vis, data732XM,  
data732Vis, data868XM, data868Vis);



More information about the fieldtrip mailing list