<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7653.38">
<TITLE>[Fieldtrip] RE: timelockstatistic</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<BR>

<P><FONT SIZE=2>Dear Rodrigo,<BR>
<BR>
I'm wondering if the error is the same for all number-combinations that you used. I agree with Ingrid that cfg.uvar should be 2. When I test this specific part of the scripts, it seems to work for me (I don't get any error).<BR>
<BR>
So next I wonder what the avg1 and avg2 variables look like. The tutorial is written for grandaverage variables which include the field 'individual' (therefore, cfg.parameter='individual', cfg.parameter is the value you want to do statistics on). This field 'individual' contains the data for all subjects.<BR>
<BR>
Since you are looking at one subject only I guess you don't have this field. So the cfg.parameter should be 'trial'.  So check if avg1 and avg2 have the field 'trial' if not  do timelockanalysis again with cfg.keeptrials = 'yes'.<BR>
<BR>
cfg.design should then be dependent on the number of trials and not on number of subjects. If you have 10 trials for both conditions it should look something like this:<BR>
<BR>
Ntrials = 10 ;<BR>
cfg.design(1,1:2*Ntrials)  = [ones(1,Ntrials) 2*ones(1,Ntrials)];<BR>
cfg.design(2,1:2*Ntrials)  = [1:Ntrials 1:trials];<BR>
<BR>
cfg.design then will look like this:<BR>
<BR>
cfg.design<BR>
<BR>
ans =<BR>
<BR>
  Columns 1 through 15<BR>
<BR>
     1     1     1     1     1     1     1     1     1     1     2     2     2     2     2<BR>
     1     2     3     4     5     6     7     8     9    10     1     2     3     4     5<BR>
<BR>
  Columns 16 through 20<BR>
<BR>
     2     2     2     2     2<BR>
     6     7     8     9    10<BR>
<BR>
The first 10 trials belong to condition 1 and the second 10 to condition 2.<BR>
<BR>
This is probably why you get the design error. It doesn't fit with the parameter you want to do statistics on.<BR>
<BR>
I hope this was a correct hypothesis and my reply will help you!<BR>
<BR>
Best Regards,<BR>
<BR>
Hanneke<BR>
</FONT>
</P>

</BODY>
</HTML>
<p>----------------------------------</p>
<p>The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis.</p>
<p>  http://listserv.surfnet.nl/archives/fieldtrip.html</p>
<p>  http://www.ru.nl/fcdonders/fieldtrip/</p>