<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Dear Kris,<div><br></div><div>in EEGLAB try the statcond function. It will perform boostrap, permutation (bootstrap and permutation are two resampling techniques), or compute parametric statistics and return p-values. If you have 2 EEGLAB datasets 1 and 2 (on which you have extracted data epochs of the same length), on the command line, try</div><div><br></div><div><div><i>[t df p] = statcond({ ALLEEG(1).data ALLEEG(2).data }, 'mode', 'bootstrap', 'naccu', 1000);</i></div></div><div><div><div><div><i>% or [t df p] = statcond({ ALLEEG(1).data ALLEEG(2).data}, 'mode', 'perm');</i></div><div></div><div><i>% or [t df p] = statcond({ ALLEEG(1).data ALLEEG(2).data}, 'mode', 'param');</i></div><div><br></div></div></div></div><div>then use FDR to correct for multiple comparisons</div><div><br></div><div><i>p = fdr(p);</i></div><div><br></div><div>then plot the result with a threshold at 0.05 for a given channel</div><div><i><br></i></div><div><i>chan = 10;</i></div><div><div><i>erp_1 = mean(ALLEEG(1).data(chan,:,:),3);</i></div><div><div><i>erp_2 = mean(ALLEEG(2).data(chan,:,:),3);</i></div><div><i>plotcurve(ALLEEG(1).times, [erp_1; erp_2], 'maskarray', p(chan,:) < 0.05);</i></div><div><i><br></i></div></div></div><div>Hope this helps,</div><div><br></div><div>Arno</div><div><br></div><div>ps: with many channels, time points, and trials, the bootstrap computation may take several minutes</div><div><br></div><div><div><div>On Apr 1, 2010, at 11:10 AM, Bradley Voytek wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Kris:<br><br>One of the best ways of doing this--from a statistical<br>standpoint--would be through resampling statistics. I've attached a<br>quick example script that should be correct.<br><br>Also, here's a quick description.<br><br><a href="http://en.wikipedia.org/wiki/Resampling_%28statistics%29">http://en.wikipedia.org/wiki/Resampling_%28statistics%29</a><br><br>First, calculate the real mean difference between your two datasets,<br>and set this value aside.<br>Next, put all your data into a big pile (for a total of, in your case,<br>1650 data points).<br>Next, randomly grab 150 points and calculate that mean. Grab the<br>remaining 1500 points and calculate that mean. Then calculate the<br>difference of these two means.<br>Repeat a lot (e.g., 10000 times) to get a distribution of possible<br>mean differences.<br><br>This gives you a distribution of possible difference values given the<br>actual data. Because you're taking means of means, this distribution<br>of surrogate values approaches normality (see the central limit<br>theorem), and thus we can calculate a z-score and p-value.<br><br>Conceptually what you're doing is asking whether the real difference<br>you observe between conditions is due to your experimental<br>manipulation or whether it's an artifact of the possible states your<br>data can obtain.<br><br>::bradley voytek<br><br><br>On Wed, Mar 31, 2010 at 08:04, Kris Baetens <Kris.Baetens@vub.ac.be> wrote:<br><blockquote type="cite">Dear colleagues,<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">We employ a paradigm which inherently leads to a different number of trials in both our conditions (oddball-like). We have two conditions, one with an average of about 150 trials, the other with about 1500 (artefact-free).<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">- Does anybody have research to support my concern that comparing both conditions with the total number of trials may lead to artificial effects due to the different number of trials (and associated variance and "cleanliness" of the gavg's)? (I have seen such things published before.)<br></blockquote><blockquote type="cite">- Does anybody know of an easy way to make a random selection of a predetermined number of trials out of the total number in EEGLAB or MATLAB? (Which would allow for selecting an equal number of trials in both conditions.) Obviously, we don't simply want to take the first or last 150 regular trials, since this would possibly lead to erronous conclusions.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Thank you very much in advance,<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Kris Baetens<br></blockquote><blockquote type="cite">Ph.D. fellow of the Research Foundation - Flanders (FWO)<br></blockquote><blockquote type="cite">Dept. Experimental and Applied Psychology<br></blockquote><blockquote type="cite">Faculty of Psychology and Educational Sciences<br></blockquote><blockquote type="cite">Vrije Universiteit Brussel<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">_______________________________________________<br></blockquote><blockquote type="cite">Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html<br></blockquote><blockquote type="cite">To unsubscribe, send an empty email to eeglablist-unsubscribe@sccn.ucsd.edu<br></blockquote><blockquote type="cite">For digest mode, send an email with the subject "set digest mime" to eeglablist-request@sccn.ucsd.edu<br></blockquote><blockquote type="cite"><br></blockquote><span><example_surrogate_stats.m></span><span><ATT00001..txt></span></div></blockquote></div><br></div></body></html>