<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hi Hweeling, <br>
      <br>
      I'm sorry, I don't understand exactly what you mean by
      "within-trial" analysis. <br>
      <br>
      If you mean comparing trials within the same participant, then
      there are two things you should change in your code:<br>
        cfg.statistic = 'indepsamplesT';  %% this should be
      indepsamplesT rather than depsamplesT<br>
        cfg.uvar = 1; %%% Remove this line from your configuration<br>
      <div>    cfg.ivar = 1;  %% the indep. var here should be 1, rather
        than 2<br>
        <br>
        Maybe your design will also need some adjustment, I'm not so
        sure (I don't use indepsamplesT that much). In any case, it
        could help to have a look at:
<a class="moz-txt-link-freetext" href="http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_timelock?s">http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_timelock?s</a>[]=indepsamplest<br>
        <br>
        If you want a cleaner code, you can also remove all these lines
        (they should be default):<br>
        cfg.channel = 'all';
        <div>    cfg.latency = 'all';</div>
        <div>    cfg.trials = 'all';</div>
        <div>    cfg.frequency = 'all';<br>
          <br>
          I hope this works, otherwise email the list again.<br>
          Good luck, Vitória<br>
        </div>
        <div>    <br>
        </div>
      </div>
      <br>
      <br>
      On 3/23/2014 3:19 PM, Hwee Ling Lee wrote:<br>
    </div>
    <blockquote
cite="mid:CABG7z0RwYO9e0gDk2JWsP6jDhiEQGnad+3BpyyUs5dGrJ3x1Zg@mail.gmail.com"
      type="cite">
      <div dir="ltr">Dear Vitoria,
        <div><br>
        </div>
        <div>Thanks for the tip.</div>
        <div><br>
        </div>
        <div>I'm trying to perform a within-trial analysis.</div>
        <div><br>
        </div>
        <div>I've got two sets of data, before and after resting state
          EEG activity. First set has 54 trials and second set has 51
          trials. Hence, my cfg.design = [ones(1, 105); ones(1,54),
          ones(1,51)*2].</div>
        <div><br>
        </div>
        <div>I've set up the statistical analysis like this:</div>
        <div><br>
        </div>
        <div>
          <div>    cfg = [];</div>
          <div>    cfg.layout = lay;</div>
          <div>    cfg.channel = 'all';</div>
          <div>    cfg.latency = 'all';</div>
          <div>    cfg.trials = 'all';</div>
          <div>    cfg.frequency = 'all';</div>
          <div>    cfg.avgovertime = 'no';</div>
          <div>    cfg.avgoverfreq = 'no';</div>
          <div>    cfg.avgoverchan = 'no';</div>
          <div>    cfg.parameter = 'powspctrm';</div>
          <div>    cfg.method = 'montecarlo';</div>
          <div>    cfg.statistic = 'depsamplesT';</div>
          <div>    cfg.numrandomization = 1000;</div>
          <div>    cfg.design = design;</div>
          <div>    cfg.uvar = 1;</div>
          <div>    cfg.ivar = 2;</div>
          <div>    </div>
          <div>    [stat] = ft_freqstatistics(cfg, post_c200freq,
            pre_c200freq);</div>
        </div>
        <div><br>
        </div>
        <div>However, I got an error message:</div>
        <div><br>
        </div>
        <div>
          <div>Error using ft_statfun_depsamplesT (line 84)</div>
          <div>Invalid specification of the design array.</div>
          <div><br>
          </div>
          <div>Error in ft_statistics_montecarlo (line 285)</div>
          <div>  [statobs, cfg] = statfun(cfg, dat, design);</div>
          <div><br>
          </div>
          <div>Error in ft_freqstatistics (line 323)</div>
          <div>  [stat, cfg] = statmethod(cfg, dat, cfg.design);</div>
        </div>
        <div><br>
        </div>
        <div>Can someone please tell me what parameters did I specify
          wrongly? Thanks.</div>
        <div><br>
        </div>
        <div>Best wishes,</div>
        <div>Hweeling</div>
        <div><br>
        </div>
        <div><br>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">On 21 March 2014 20:10, Vitória Piai <span
            dir="ltr"><<a moz-do-not-send="true"
              href="mailto:v.piai.research@gmail.com" target="_blank">v.piai.research@gmail.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000"> Dear Hweeling, <br>
              <br>
              There is nothing inherent to the ft_freqstatistics
              function that makes it special for MEG, rather than for
              EEG data. If you've been using other FieldTrip functions,
              you probably have used cfg.channel before. These are the
              channels present in your EEG data. <br>
              How you should set some of the other parameters depends
              only on your design, not on whether the data are from MEG
              or EEG.<br>
              Maybe you can specify what is unclear to you when calling
              the function so that you can get appropriate help!<br>
              <br>
              Good luck, Vitoria
              <div>
                <div class="h5"><br>
                  <br>
                  <div>On 3/21/2014 3:36 PM, Hwee Ling Lee wrote:<br>
                  </div>
                </div>
              </div>
              <blockquote type="cite">
                <div>
                  <div class="h5">
                    <div dir="ltr"><br clear="all">
                      <div>Dear all,</div>
                      <div><br>
                      </div>
                      <div>I've got EEG datasets for 64 channels, and I
                        would like to perform permutation statistics on
                        the power frequency analyses to compare the two
                        conditions (before and after resting state
                        periods).</div>
                      <div><br>
                      </div>
                      <div>However, I'm not sure how to operationalise
                        the statistical analyses since most of the
                        examples on the website are for MEG datasets.</div>
                      <div><br>
                      </div>
                      <div>I would appreciate very much if someone could
                        help me on this! Thanks!</div>
                      <div><br>
                      </div>
                      <div>Cheers,</div>
                      <div>Hweeling</div>
                      <div><br>
                      </div>
                    </div>
                    <br>
                    <fieldset></fieldset>
                    <br>
                  </div>
                </div>
                <pre>_______________________________________________
fieldtrip mailing list
<a moz-do-not-send="true" href="mailto:fieldtrip@donders.ru.nl" target="_blank">fieldtrip@donders.ru.nl</a>
<a moz-do-not-send="true" href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></pre>
              </blockquote>
              <br>
            </div>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <div><br>
        </div>
        -- <br>
        <div dir="ltr">=================================================<br>
          Dr. rer. nat. Lee, Hwee Ling<br>
          Postdoc<br>
          German Center for Neurodegenerative Diseases (DZNE) Bonn<br>
          <br>
          Email 1: hwee-ling.lee<at><a moz-do-not-send="true"
            href="http://dzne.de" target="_blank">dzne.de</a><br>
          Email 2: hweeling.lee<at><a moz-do-not-send="true"
            href="http://gmail.com" target="_blank">gmail.com</a>
          <div><br>
          </div>
          <div><a moz-do-not-send="true"
              href="https://sites.google.com/site/hweelinglee/home"
              target="_blank">https://sites.google.com/site/hweelinglee/home</a><br>
            <br>
            Correspondence Address:<br>
            Ernst-Robert-Curtius Strasse 12, 53117, Bonn, Germany<br>
            =================================================<br>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>