<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
  <title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
Dear Edward,<br>
<br>
there is definitelly no easy answer to your question. The easiest way
to deal with this issue would be to write a small script. If you have
all the epochs for all the channels in EEGLAB and a cell array
containing the epochs labelled as "good" for each channel, for instance<br>
<br>
> goodepochs = { [ 2 5 6 8 9 ... ] [ 3 4 8 9 ... ] ...};<br>
<br>
meaning that epochs 2, 5, 6, 8, 9 etc... are good for the first
channel, and epochs 3,4, 8, 9 are good for the second channel, you may
then compute the ERP for all channels<br>
<br>
> for chan = 1:EEG.nbchan<br>
>     ERP(chan,:) = mean(EEG.data(chan,:,goodepoch{chan});<br>
> end;<br>
<br>
A trick would be then to save the ERP in the EEG dataset<br>
<br>
EEG.data = ERP;<br>
EEG.event = [];<br>
[ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET); % update
EEGLAB memory<br>
eeglab redraw % update EEGLAB GUI<br>
<br>
so you can use the grand average function in the menu once you have
performed this operation for all datasets (all datasets contain then 1
trial which is the ERP).<br>
<br>
Hope this help,<br>
best,<br>
<br>
Arno<br>
<br>
Edward Justin Modestino, M.Phil. wrote:<br>
<blockquote type="cite"
 cite="mid2218.131.91.30.56.1121450810.squirrel@131.91.30.56">
  <pre wrap="">Hello,
I am relatively new to EEGLAB.  I have been doing my data analysis,
writing my own programs, in MATLAB.  I am interested in using the EEGLAB
GUI.  I have my data imported into EEGLAB.

The first problem was that my data was constructed on a channel by channel
basis with artifact removal, i.e. only epochs (trials) within specific
channels which have artifacts are removed.  This leads to a varying amount
of epochs (trials) per channel within the same condition.  Thus, channel
F5 may end up with 250 epochs for one condition and whereas channel P04
may end up with 190 epochs for the very same condition.  Often a channel
may go in and out during an experiment, or an artifact, other than an eye
movement, may be present in in a select group of channels, ie, temporal
channels and muscle artifacts, etc.  So, the only way this data can be
kept is in a cell array. This is the way my advisor instructed me to  do
this.

This causes a problem with the importation into EEGLAB, which requires and
 a matrix, which obviously necessitates equal dimensions or the same
amount of epochs for each channel.

What I have done is find the lowest common number of epochs per channel.
Often this does not leave me with enough data. If some channels have 120
or 130 epochs, I delete all the data for that channel and use a higher cut
off of epochs, like say 192.  So, all channels that have less than 192
epochs, have all their data thrown away, whereas all channels with more
than 192 epochs, say 260, have every epoch over 192 thrown away.  Thus, I
end up with  data which has the same amount of epochs in each channel with
data, i.e. 192.  Those without data are excluded from importation.  I do
not use them in the location file.

In doing this, I have thrown out whole channels completely which had some
data and many epochs for channels with a high amount of intact epochs
(trials) for a condition.

Now, I have this in EEGLAB and can do analysis.  But, if I wish to do a
grand mean ERP or compare different subjects for the same condition, I
will run into a problem.  Some subjects may have a specific channel while
others do not.  How can I perform a group analysis on a number of subjects
when they have varying numbers of channels? One subject may have 75
channels and another may have 82 channels.  How can I do a group analysis
(grand mean ERP) of the data when channel F5 is only present for 2 of the
4 subjects? How do I compare subjects for multiple conditions when each
subject and each condition for each subject has a different electrode
location file and a varying number of electrodes?  How will I be able to
compare ERPs between subjects for say channel F5, if F5 is electrode
number 5 for subject number 1 whereas F5 is electrode number 7 for subject
number 2?

Please let me know if you have any advice on how to make the most of my
data and conduct various analyses using EEGLAB.
Thank you,
Ed Modestino

  </pre>
</blockquote>
<br>
<br>
<div class="moz-signature">-- <br>
<br>
<b><font face="Arial,Helvetica"><font size="+1">Arnaud Delorme, Ph.D.</font></font></b>
<br>
<font face="Arial,Helvetica"><font size="+1"><font color="#3333ff">Swartz
Center for Computational Neuroscience,</font> <font color="#3333ff">INC,
University of San Diego California</font></font></font>
<br>
La Jolla, CA92093-0961, USA
<p><font face="Arial,Helvetica"><b>Tel</b> :<i>(+1)-858-458-1927 ext 15</i></font>
<br>
<font face="Arial,Helvetica"><b>Fax</b> :<i>(+1)-858-458-1847</i></font>
<br>
<font face="Arial,Helvetica"><b>Web page</b>: <a
 href="http://www.sccn.ucsd.edu/%7Earno">sccn.ucsd.edu/~arno</a></font>
<br>
<font face="Arial,Helvetica"><b>To think upon</b>:</font></p>
<blockquote><dt><font face="Arial,Helvetica"> Life is not a problem to
be solved but a reality to be experienced.
    <font size="-5"><br>
    <br>
    </font></font></dt>
  <dd><font face="Arial,Helvetica"><i>Siren Kierkegaard</i></font></dd>
</blockquote>
</div>
</body>
</html>