<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=NL link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Dear Dylan,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I replied to your question on the Fieldtrip faq page that you refer to. Although the problem can be solved, it is not implemented yet, because it requires the implementation of three new statfuns: Hotelling’s T-square for dependent samples, Hotelling’s T-square for independent samples, and Wilk’s lambda. A good statistics book (e.g., Johnson & Wichern) will show you how to do this yourself. Otherwise, you have to be patient.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Although your statistical problem can be solved, with neurobiological data, it is almost never wise to statistically test interaction effects in designs more complicated than the 2-by-2 factorial design. In these more complicated designs, you always end up with F-tests, which do not inform you about the pattern in the data that is responsible for the interaction effect.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Best,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Eric<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Dylan DeLosAngeles [mailto:dylan.delosangeles@gmail.com] <br><b>Sent:</b> dinsdag 28 oktober 2014 13:22<br><b>To:</b> FieldTrip discussion list<br><b>Subject:</b> Re: [FieldTrip] Cluster-based permutation tests for between-subject design<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>Thank you, Eelke. <br>I'm sorry I am not picking this up more quickly. <o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Your examples of passing either multiple structs or cell arrays to ft_freqstatistics deals with one group of subjects in multiple conditions, or two groups in one condition, respectively. I have two groups, both doing multiple (11) conditions and I would like to know how to handle that in ft_freqstatistics. What I require seems to be similar to what Eric Maris wrote about here:<o:p></o:p></p></div><div><p class=MsoNormal><a href="http://fieldtrip.fcdonders.nl/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_tests"><span style='color:black'>http://fieldtrip.fcdonders.nl/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_tests</span></a><o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>but instead of a 2-by-2 factorial design, I am using a 2-by-11 factorial design. As such, I am not sure how this translates when making difference data structures. I hope I am not missing something obvious.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Thanks again,<o:p></o:p></p></div><div><p class=MsoNormal>Dylan<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><p class=MsoNormal><br>On Tuesday, 28 October 2014, Eelke Spaak <<a href="mailto:eelke.spaak@donders.ru.nl">eelke.spaak@donders.ru.nl</a>> wrote:<o:p></o:p></p><p class=MsoNormal>Dear Dylan,<br><br>You don't want (or need) a single struct with a subj X chan X freq X<br>time powspctrm. Instead, it is often convenient to collect each<br>individual subject's struct in a *cell* array (rather than a struct<br>array). See, for example, here:<br><a href="http://www.mathworks.nl/help/matlab/cell-arrays.html" target="_blank">http://www.mathworks.nl/help/matlab/cell-arrays.html</a> and here:<br><a href="http://blogs.mathworks.com/loren/2006/06/21/cell-arrays-and-their-contents/" target="_blank">http://blogs.mathworks.com/loren/2006/06/21/cell-arrays-and-their-contents/</a><br>.<br><br>At the statistics step you should pass in multiple structs, each one<br>corresponding to one unit-of-observation, to ft_freqstatistics. This<br>can be done like so:<br><br>stat = ft_freqstatistics(cfg, struct11, struct12,<br>struct13,...struct21, struct22, ...);<br><br>or, using the cell arrays, like so:<br><br>stat = ft_freqstatistics(cfg, groupA{:}, groupB{:});<br><br>Make sure that each column in your design matrix describes one<br>unit-of-observation, in the order in which the structs are passed into<br>ft_freqstatistics.<br><br>Best,<br>Eelke<br><br>On 21 October 2014 03:41, Dylan DeLosAngeles<br><<a href="javascript:;">dylan.delosangeles@gmail.com</a>> wrote:<br>> Dear Eelke,<br>><br>> Thank you for help regarding cluster-based permutation analysis of two or more conditions.<br>><br>> I am using time-frequency data (not time-lock structures). My first problem seems to be getting my 12 subjects into the 4D powspectrum.<br>><br>> 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.<br>><br>> for k = 1:Nmt, % states<br>>     for i = 1%:Ng, % groups<br>>         for j = 1:Ns, % subjects<br>><br>>             % load files<br>>             p(j) = eeg3.eeg.load(fullfile(fpath,fname2));<br>><br>>             % convert to eeglab to get channel locations<br>>             EEG(j) = eeg2eeglab( p(j));<br>>             EEG(j) = pop_chanedit( EEG(j), 'lookup', chanlocfile);<br>><br>>             % preprocessing in fieldtrip<br>>             d(j) = eeglab2fieldtrip( EEG(j), 'preprocessing');<br>><br>>             % specify length of time to use in config<br>>             time = EEG(j).xmax-EEG(j).xmin;<br>><br>>             % setup configuration for freqanalysis<br>>             cfg = [];      % clear cfg<br>>             cfg.output     = 'pow';<br>>             cfg.channel    = 'EEG';<br>>             cfg.method     = 'mtmconvol';<br>>             cfg.taper      = 'hanning';<br>>             cfg.foi        = 0.5:3; % delta<br>>             cfg.toi        = 1:0.05:time; % length of each state<br>>             cfg.t_ftimwin  = 7./cfg.foi; % 7 cycles<br>>             cfg.keeptrials = 'yes';<br>><br>>             % do freqanalysis<br>>             freqdata(j) = ft_freqanalysis( cfg, d(j));<br>>         end<br>>     end<br>> end<br>><br>> My second problem is loading in the second group of 12 subjects and what that will look like when I run ft_freqstatistics.<br>><br>> Lastly, I just want to confirm what you said in your previous email, that I should be using indepsamplesF for more than two conditions (I have 11), and therefore my design should look like this;<br>> 1     2     1     2     1     2     1     2     1     2     1     2     1     2      1     2     1     2     1     2      1      2     (two groups)<br>> 1     1     2     2     3     3     4     4     5     5     6     6     7     7      8     8     9     9    10    10    11    11     (11 conditions)<br>><br>> Any help would be appreciated.<br>><br>> Kind regards,<br>> Dylan<br>><br>><br>><br>><br>> On Wed, Sep 24, 2014 at 3:29 PM, Eelke Spaak <<a href="javascript:;">eelke.spaak@donders.ru.nl</a><mailto:<a href="javascript:;">eelke.spaak@donders.ru.nl</a>>> wrote:<br>> 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>> <<a href="javascript:;">dylan.delosangeles@gmail.com</a><mailto:<a href="javascript:;">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>>> _______________________________________________<br>>> fieldtrip mailing list<br>>> <a href="javascript:;">fieldtrip@donders.ru.nl</a><mailto:<a href="javascript:;">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="javascript:;">fieldtrip@donders.ru.nl</a><mailto:<a href="javascript:;">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><br>_______________________________________________<br>fieldtrip mailing list<br><a href="javascript:;">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><o:p></o:p></p></div></div></body></html>