[Eeglablist] Random selection of trials

Matt Mollison matthew.mollison at colorado.edu
Thu Apr 1 11:36:26 PDT 2010

As you imply, there are issues to be aware of when comparing conditions with
vastly different numbers of trials, but I couldn't do the topic justice.

To your second point, you could use the Matlab function randperm to make a
random index. The following code may not be optimal, but it works, so just
as an example:

ind = randperm(max([size(cond1,1),size(cond2,1)]));
ind = ind(1:min([size(cond1,1),size(cond2,1)]));

Don't forget to set the state of the rand function before using randperm;
e.g., rand('state',sum(100*clock)).

-Matt Mollison

Univ. of Colorado at Boulder
Dept. of Psychology and Neuroscience
matthew.mollison at colorado.edu

On Wed, Mar 31, 2010 at 9:04 AM, Kris Baetens <Kris.Baetens at vub.ac.be>wrote:

> Dear colleagues,
> 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).
> - 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.)
> - 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.
> Thank you very much in advance,
> Kris Baetens
> Ph.D. fellow of the Research Foundation - Flanders (FWO)
> Dept. Experimental and Applied Psychology
> Faculty of Psychology and Educational Sciences
> Vrije Universiteit Brussel
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to
> eeglablist-unsubscribe at sccn.ucsd.edu
> For digest mode, send an email with the subject "set digest mime" to
> eeglablist-request at sccn.ucsd.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20100401/c266f5bb/attachment.html 

More information about the eeglablist mailing list