<div dir="ltr">Dear Eelke,<div><br></div><div>Thank you for help regarding cluster-based permutation analysis of two or more conditions.</div><div><br></div><div>I am using time-frequency data (not time-lock structures). My first problem seems to be getting my 12 subjects into the 4D powspectrum.</div><div><br></div><div>My code below loads 12 subjects from the first group, but I end up with a 1 x 12 struct where each struct's .powspctrm is 1 subject x 11 electrodes x 3 frequencies x 2049 time points, rather than one struct with a 4D powspctrm with 12 subjects as rows x electrodes x freqs x time points.</div><div> </div><div><div><font face="courier new, monospace">for k = 1:Nmt, % states</font></div><div><font face="courier new, monospace">    for i = 1%:Ng, % groups</font></div><div><font face="courier new, monospace">        for j = 1:Ns, % subjects</font></div><div><font face="courier new, monospace">            </font></div><div><font face="courier new, monospace">            % load files</font></div><div><font face="courier new, monospace">            p(j) = eeg3.eeg.load(fullfile(fpath,fname2));</font></div><div><font face="courier new, monospace">                </font></div><div><font face="courier new, monospace">            % convert to eeglab to get channel locations</font></div><div><font face="courier new, monospace">            EEG(j) = eeg2eeglab( p(j));</font></div><div><font face="courier new, monospace">            EEG(j) = pop_chanedit( EEG(j), 'lookup', chanlocfile);</font></div><div><font face="courier new, monospace">                </font></div><div><font face="courier new, monospace">            % preprocessing in fieldtrip</font></div><div><font face="courier new, monospace">            d(j) = eeglab2fieldtrip( EEG(j), 'preprocessing');</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">            % specify length of time to use in config</font></div><div><font face="courier new, monospace">            time = EEG(j).xmax-EEG(j).xmin;</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">            % setup configuration for freqanalysis</font></div><div><font face="courier new, monospace">            cfg = [];      % clear cfg</font></div><div><font face="courier new, monospace">            cfg.output     = 'pow';</font></div><div><font face="courier new, monospace">            cfg.channel    = 'EEG';</font></div><div><font face="courier new, monospace">            cfg.method     = 'mtmconvol';</font></div><div><font face="courier new, monospace">            cfg.taper      = 'hanning';</font></div><div><span style="font-family:'courier new',monospace">            cfg.foi        = 0.5:3; % delta</span><br></div><div><font face="courier new, monospace">            cfg.toi        = 1:0.05:time; % length of each state</font></div><div><font face="courier new, monospace">            cfg.t_ftimwin  = 7./cfg.foi; % 7 cycles</font></div><div><font face="courier new, monospace">            cfg.keeptrials = 'yes';</font></div><div><font face="courier new, monospace">            </font></div><div><font face="courier new, monospace">            % do freqanalysis</font></div><div><span style="font-family:'courier new',monospace">            freqdata(j) = ft_freqanalysis( cfg, d(j));</span></div><div><font face="courier new, monospace">        end</font></div><div><font face="courier new, monospace">    end</font></div><div><font face="courier new, monospace">end</font></div></div><div><br></div><div>My second problem is loading in the second group of 12 subjects and what that will look like when I run ft_freqstatistics.</div><div><br></div><div>Lastly, I just want to confirm what you said in your previous email, that I should be using <span style="font-family:arial,sans-serif;font-size:13px">indepsamplesF for more than two conditions (I have 11), and therefore my design should </span>look like this;</div><div><div>1     2     1     2     1     2     1     2     1     2     1     2     1     2      1     2     1     2     1     2      1      2     (two groups)</div><div>1     1     2     2     3     3     4     4     5     5     6     6     7     7      8     8     9     9    10    10    11    11     (11 conditions)</div><div><br></div><div>Any help would be appreciated.</div><div><br></div><div>Kind regards,</div><div>Dylan</div><div><br></div></div><div><br></div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 24, 2014 at 3:29 PM, Eelke Spaak <span dir="ltr"><<a href="mailto:eelke.spaak@donders.ru.nl" target="_blank">eelke.spaak@donders.ru.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hello Dylan,<br>
<br>
You can analyse a between-subjects design exactly as you would a<br>
between-trials design (at least as far as the statistics step is<br>
concerned), in both cases the two conditions correspond to two groups<br>
of observations, and not to the same group of observations measured in<br>
two separate conditions (which would be a within-UO design). In<br>
FieldTrip, you would typically compute averages per subject, then use<br>
an "indepsamplesT" (or indepsamplesF with >2 conditions) statistic<br>
(not depsamples). indepsamplesT only requires one row in the design<br>
matrix, indicating the condition.<br>
<br>
Note that if you have e.g. timelock structures in two (or more) cell<br>
arrays, corresponding to the conditions, you can input them into the<br>
statistics function as follows:<br>
<br>
stat = ft_timelockstatistics(cfg, tlCondA{:}, tlCondB{:});<br>
<br>
without having to call ft_timelockgrandaverage. In fact, the above is<br>
the preferred way to do statistics now. (The same holds for<br>
ft_freqstatistics.)<br>
<br>
Hope that helps,<br>
Best,<br>
Eelke<br>
<br>
On 24 September 2014 02:32, Dylan DeLosAngeles<br>
<div><div class="h5"><<a href="mailto:dylan.delosangeles@gmail.com">dylan.delosangeles@gmail.com</a>> wrote:<br>
> Hello,<br>
><br>
> So far, the tutorial on "Cluster-based permutation tests on time-frequency<br>
> data" has been very helpful.<br>
><br>
> Out of the four combinations from the two UO-types (subjects and trials) and<br>
> the two experimental designs (between- and within-UO), the tutorial covers<br>
> statistics on data in two conditions in a between-trials, in a within-trials<br>
> and in a within-subjects design. However, I am wondering if there is any<br>
> information about the fourth type of experiment design: between-subjects.<br>
><br>
> I have data for 2 groups with 12 subjects in each group. Both groups are<br>
> measured during 11 conditions.<br>
> Can I approach this in a similar fashion to within-subjects design (multiple<br>
> subjects in multiple experimental conditions), such that my design is<br>
> multiple groups in multiple experimental conditions. Is it a case of first<br>
> averaging over all trials belonging to each of the experimental conditions<br>
> for each subject (as instructed in tutorial), and then averaging over all<br>
> subjects in each group?<br>
><br>
> Configuration code for setting up the design currently looks like this;<br>
> grp = 2;<br>
> subj = 11;<br>
> design = zeros(2, subj*grp);<br>
><br>
> for i = 1:grp<br>
>     design(1,i:2:end) = i;<br>
> end<br>
><br>
> idx = 1;<br>
> for i = 1:subj<br>
>     design(2,idx:idx+1) = i;<br>
>     idx = idx+2;<br>
> end<br>
><br>
> Is there anything else I need to take into consideration when doing these<br>
> statistics?<br>
><br>
> Thank you,<br>
> Dr Dylan DeLosAngeles<br>
> Research Fellow<br>
> Brain Signal Laboratory<br>
> Flinders University<br>
><br>
</div></div>> _______________________________________________<br>
> fieldtrip mailing list<br>
> <a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
> <a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
</blockquote></div><br></div></div>