Dear Rodrigo,<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><font size="2">
<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><font color="#888888">
<br>
Hanneke </font></font><br><div><div></div><div class="h5"><br><div class="gmail_quote">On Wed, Jun 3, 2009 at 10:30 PM, Rodrigo A. Montefusco Siegmund <span dir="ltr"><<a href="mailto:rmontefusco@med.uchile.cl" target="_blank">rmontefusco@med.uchile.cl</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Dear Ingrid<br>
<br>
I tried with many numbers combinations...but nothing happens.<br>
<br>
:(<br>
<br>
Rodrigo<br>
<br>
> Dear Rodrigo,<br>
><br>
> I think you have a typo in your design specification cfg.ivar and cfg.uvar<br>
> is both 1, but in your comment you correctly state that uvar should be 2.<br>
><br>
> Hope this helps,<br>
> Ingrid<br>
><br>
>> -----Original Message-----<br>
>> From: FieldTrip discussion list [mailto:<a href="mailto:FIELDTRIP@NIC.SURFNET.NL" target="_blank">FIELDTRIP@NIC.SURFNET.NL</a>] On<br>
>> Behalf Of Rodrigo A. Montefusco Siegmund<br>
>> Sent: Wednesday, June 03, 2009 10:20 PM<br>
>> To: <a href="mailto:FIELDTRIP@NIC.SURFNET.NL" target="_blank">FIELDTRIP@NIC.SURFNET.NL</a><br>
>> Subject: Re: [FIELDTRIP] Difference between tfr and wltconvol<br>
>><br>
>> Dear FTers<br>
>><br>
>> I have (still) problems with my timelock statistic script. I tried to<br>
>> develop a very simple analysis to prove all the posibilities, inclusive<br>
>> doing all manually. But it continues with error messages. I'll copy my<br>
>> code and de erros that apear when I ran it. I'm trying to compare one<br>
>> subject in two diferent conditions.<br>
>><br>
>> %------------------------------------------<br>
>> cfg.channel     = 'all';<br>
>> cfg.latency     = 'all';<br>
>> cfg.avgoverchan = 'no';<br>
>> cfg.avgovertime = 'yes';<br>
>> cfg.parameter   = 'individual';<br>
>> cfg.method      = 'analytic';<br>
>> cfg.statistic   = 'depsamplesT';<br>
>> cfg.alpha       = 0.05;<br>
>> cfg.correctm    = 'bonferoni';<br>
>><br>
>> Nsub = 1;<br>
>> cfg.design(1,1:2*Nsub)  = [ones(1,Nsub) 2*ones(1,Nsub)];<br>
>> cfg.design(2,1:2*Nsub)  = [1:Nsub 1:Nsub];<br>
>> cfg.ivar                = 1; % the 1st row in cfg.design contains the<br>
>> independent variable<br>
>> cfg.uvar                = 1; % the 2nd row in cfg.design contains the<br>
>> subject number<br>
>><br>
>> [stat] = timelockstatistics(cfg, avg1, avg2);<br>
>> %----------------------------------------------------------<br>
>><br>
>> actually is almost the same as in the tutorial.<br>
>><br>
>> the errors are...<br>
>><br>
>> -----------------------------------------------------------<br>
>> ??? Error using ==> statfun_depsamplesT at 81<br>
>> Invalid specification of the design array.<br>
>><br>
>> Error in ==> statistics_analytic at 92<br>
>>   [stat, cfg] = statfun(cfg, dat, design);<br>
>><br>
>> Error in ==> statistics_wrapper at 381<br>
>>   [stat, cfg] = statmethod(cfg, dat, cfg.design);<br>
>><br>
>> Error in ==> timelockstatistics at 112<br>
>> [stat] = statistics_wrapper(cfg, varargin{:});<br>
>><br>
>> Error in ==> ERPStatistics at 19<br>
>> [stat] = timelockstatistics(cfg, avg1, avg2);<br>
>> -----------------------------------------------------------<br>
>><br>
>> please help!<br>
>><br>
>> warm regards for all!<br>
>><br>
>> Rodrigo<br>
>><br>
>><br>
>><br>
>> ===================================<br>
>> Rodrigo A. Montefusco Siegmund<br>
>> Doctorado en Ciencias Biomédicas<br>
>> Programa de Fisiología y Biofí­sica<br>
>> I. C. B. M. Facultad de Medicina<br>
>> Universidad de Chile<br>
>> Fono: 56 09 82793847<br>
>> email:  <a href="mailto:rmontefusco@med.uchile.cl" target="_blank">rmontefusco@med.uchile.cl</a><br>
>> ===================================<br>
>><br>
>> ----------------------------------<br>
>> The aim of this list is to facilitate the discussion between users of<br>
>> the<br>
>> FieldTrip  toolbox, to share experiences and to discuss new ideas for<br>
>> MEG<br>
>> and EEG analysis. See also<br>
>> <a href="http://listserv.surfnet.nl/archives/fieldtrip.html" target="_blank">http://listserv.surfnet.nl/archives/fieldtrip.html</a> and<br>
>> <a href="http://www.ru.nl/neuroimaging/fieldtrip" target="_blank">http://www.ru.nl/neuroimaging/fieldtrip</a>.<br>
><br>
> ----------------------------------<br>
> The aim of this list is to facilitate the discussion between users of the<br>
> FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG<br>
> and EEG analysis. See also<br>
> <a href="http://listserv.surfnet.nl/archives/fieldtrip.html" target="_blank">http://listserv.surfnet.nl/archives/fieldtrip.html</a> and<br>
> <a href="http://www.ru.nl/neuroimaging/fieldtrip" target="_blank">http://www.ru.nl/neuroimaging/fieldtrip</a>.<br>
><br>
<br>
<br>
===================================<br>
Rodrigo A. Montefusco Siegmund<br>
Doctorado en Ciencias Biomédicas<br>
Programa de Fisiología y Biofí­sica<br>
I. C. B. M. Facultad de Medicina<br>
Universidad de Chile<br>
Fono: 56 09 82793847<br>
email:  <a href="mailto:rmontefusco@med.uchile.cl" target="_blank">rmontefusco@med.uchile.cl</a><br>
===================================<br>
<br>
----------------------------------<br>
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. See also <a href="http://listserv.surfnet.nl/archives/fieldtrip.html" target="_blank">http://listserv.surfnet.nl/archives/fieldtrip.html</a> and <a href="http://www.ru.nl/neuroimaging/fieldtrip" target="_blank">http://www.ru.nl/neuroimaging/fieldtrip</a>.<br>


<br>
</blockquote></div><br>
</div></div></blockquote></div><br>
<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>