[Eeglablist] Using a basline from different dataset

ET Muluh etmuluh at gmail.com
Thu Dec 12 22:42:46 PST 2013


Dear Aleksandra,

I am not sure your problem has been solved. Bellow is a code at the Matlab
command that uses a different data set for baseline.

Kind regards,
Muluh


[ALLEEG EEG CURRENTSET ALLCOM] = eeglab; %open EEGLAB

EEG = pop_readegi(Baseline data, [],[],'auto'); % Load your baseline data

[ALLEEG EEG CURRENTSET] = pop_newset(ALLEEG, EEG, 0,'setname','Baseline',
'gui','off');

%

EEG = pop_epoch( EEG, {  'Baseline Condition'  }, [-0.5           0],
'newname', 'Baseline epoch', 'epochinfo', 'yes'); % Extract the required
epoch length for baseline, 500 ms in this case - you can change to what
suites you



[ALLEEG EEG CURRENTSET] = pop_newset(ALLEEG, EEG, 1,'overwrite','on','gui',
'off');

EEG = eeg_checkset( EEG );



%Get the mean of each channel from the baseline data set above



EEG.data = mean(EEG.data,2); % This give a vector of number of channels x 1
sample point - which is the mean for the channel

EEG.pnts = 1; % Reset the number of sample points to 1 so as to maintain
consistency of data structure in EEGLAB

EEG.times = EEG.times(1); % Reset the times to 1 so as to maintain
consistency of data structure in EEGLAB

EEG = eeg_checkset( EEG );

eeglab redraw



% Load and epoch your data

EEG = pop_readegi('Data, [],[],'auto'); %Load your main data

EEG = pop_epoch( EEG, {  }, [0  1], 'newname', 'EGI file epochs',
'epochinfo', 'yes'); % epoch your main data

[ALLEEG EEG CURRENTSET] = pop_newset(ALLEEG, EEG, 2,'gui','off');

EEG = eeg_checkset( EEG );



% Baseline correct your data – ALLEEG(1) is your baseline data set and
ALLEEG(2) your epoched main data set

for i = 1:size(ALLEEG(2).data,3) % number of epochs

    for j = 1:size(ALLEEG(2).data,2) % number of samples in each epoch

        ALLEEG(2).data(:,j,i) = ALLEEG(2).data(:,j,i)- ALLEEG(1).data;

    end

end

%

EEG = eeg_checkset( EEG );% this is THE BASELINE CORRECTED DATA

eeglab redraw



On Sun, Nov 17, 2013 at 12:51 AM, Makoto Miyakoshi <mmiyakoshi at ucsd.edu>wrote:

> Dear Aleksandra,
>
> It's unfortunate but I have to say that volunteers didn’t really relax and
> you plot their data as if they were 'relaxed' is not correct. In other
> words analysis does not help design deficit.
>
> Try to find another way to view the data. There could be other
> possibilities! Did you try common baseline option by the way (see recent
> post about it; Arno gave it a detailed explanation).
>
> Makoto
>
>
> 2013/11/15 Stephen Politzer-Ahles <politzerahless at gmail.com>
>
>> Hi Aleksandra,
>>
>> I don't think there are any built-in functions for EEGLAB for this, but
>> it should be easy to do with some MATLAB scripting. But you would need to
>> provide more information about specifically what you need done (i.e., how
>> are the trials in your experiment organized, are you wanting for each trial
>> of condition A to be baseline-corrected to the previous trial of condition
>> B, or baseline-correct the average of one condition to the average of
>> another, or what?). I am not sure if this is common practice, though.
>>
>> Best,
>> Steve
>>
>>
>>
>> Stephen Politzer-Ahles
>> New York University, Abu Dhabi
>> Neuroscience of Language Lab
>> http://www.nyu.edu/projects/politzer-ahles/
>>
>>
>> On Thu, Nov 14, 2013 at 1:37 PM, Aleksandra Vuckovic <
>> Aleksandra.Vuckovic at glasgow.ac.uk> wrote:
>>
>>> HI
>>>
>>> We are analysing two conditions recorded during the same session on the
>>> same group of volunteers,  and would like to calculate ERSP for each
>>> condition. It seems however that volunteers didn’t really relax in between
>>> trials in one of the experimental condition (many of them continued with
>>> the experimental task)  so we’d like to use the baseline of one condition
>>> on both conditions. Can anyone advise is how to do it?
>>>
>>> Many thanks,
>>>
>>> Aleksandra
>>>
>>> _______________________________________________
>>> 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
>>>
>>
>>
>> _______________________________________________
>> 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
>>
>
>
>
> --
> Makoto Miyakoshi
> Swartz Center for Computational Neuroscience
> Institute for Neural Computation, University of California San Diego
>
> _______________________________________________
> 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/20131213/494140bc/attachment.html>


More information about the eeglablist mailing list