[Eeglablist] Ploting ONLY stat stignificant ERSP ina study

Arnaud Delorme arno at ucsd.edu
Mon Jan 14 07:26:58 PST 2013


Dear Aleksandra,

then use the EEGLAB function imagesclogy instead of imagesc

imagesclogy(times, freqs, tmpersp); set(gca, 'ydir', 'log'); xlabel('Time (ms)'); ylabel('Frequencies (Hz)'); cbar; % plot ERSP

Best,

Arno

On 14 Jan 2013, at 05:31, Aleksandra Vuckovic wrote:

> Dear Arno,
> Thank you very much for the code, it works but I am getting linear frequencies and logarithmic plot. When I compare ERSP figure with the one from GUI, they look the same (apart that values  for p>0.05 are missing) but frequency scales are different. I tired recalculating log10 but frequencies do no match.
> I also tired replacing ‘nomal’ with ‘log’ in
>  imagesc(times, freqs, tmpersp); set(gca, 'ydir', 'log'); xlabel('Time (ms)'); ylabel('Frequencies (Hz)'); cbar; % plot ERSP
> but it only inverts scale from larger to smaller values
> Could you please help me to get the right scale?
> Many thanks,
> Aleksandra
> From: Arnaud Delorme [mailto:arno at ucsd.edu] 
> Sent: 13 January 2013 15:55
> To: Aleksandra Vuckovic
> Cc: eeglab at sccn.ucsd.edu
> Subject: Re: [Eeglablist] Ploting ONLY stat stignificant ERSP ina study
>  
> Glad to hear that.
> Best regards,
>  
> Arno
>  
> On 13 Jan 2013, at 05:13, Aleksandra Vuckovic wrote:
> 
> 
> Dear Arno
> Thanks a lot I think that is exactly what I was looking for
> Best regards
> Aleksandra
> 
> Sent from my iPhone
> 
> On 13 Jan 2013, at 06:19, "Arnaud Delorme" <arno at ucsd.edu> wrote:
> 
>> Dear Aleksandra,
>>  
>> no that does not change anything. I agree with Makoto that we should find a way to plot difference with baseline in ERSP. It is not too hard from the command line. Afer computing ERSP in the graphic interface for your STUDY, first retrieve ERSP results on one channel.
>>  
>> [STUDY ersp times freqs ] = std_erspplot(STUDY,ALLEEG,'channels',{'T7'});
>>  
>> size(ersp{1})
>>  
>> ans =
>>  
>>     30    40     1     12
>>  
>> 30 frequencies, 40 time points, 1 electrode, 12 subjects.
>> Now to compare the baseline to 0, one simple way is to do this is
>>  
>> % permutation statistics with FDR correction
>> pvals = std_stat({ ersp{1} zeros(size(ersp{1})) }', 'method', 'permutation', 'condstats', 'on', 'correctm', 'fdr');  
>>  
>> Or
>>  
>> % permutation statistics with cluster correction (note: use the latest SVN revision of EEGLAB 12)
>> pvals = std_stat({ ersp{1} zeros(size(ersp{1})) }', mode', 'fieldtrip', 'fieldtripmethod', 'montecarlo', 'condstats', 'on', 'fieldtripmcorrect', 'cluster'); 
>>  
>> Note that only surrogate method is appropriate here (the array containing zeros array has 0 variance so cannot be used in parametric tests).
>> Now plot the ERSP masked for significance.
>>  
>> tmpersp = mean(ersp{1},4); % average ERSP for all subjects
>> tmpersp(pvals{1} > 0.05) = 0; % zero out non-significant values
>> figure; imagesc(times, freqs, tmpersp); set(gca, 'ydir', 'normal'); xlabel('Time (ms)'); ylabel('Frequencies (Hz)'); cbar; % plot ERSP
>>  
>> Best,
>>  
>> Arno
>>  
>> On 11 Jan 2013, at 04:25, Aleksandra Vuckovic wrote:
>> 
>> 
>> Dear Makoto,
>> at the moment I am working simply with EEG data not ICA components (though that will be my next step).
>> Does that change anything?
>> Many thanks,
>> Aleksandra
>>  
>> From: Makoto Miyakoshi [mmiyakoshi at ucsd.edu]
>> Sent: 10 January 2013 23:12
>> To: Aleksandra Vuckovic
>> Cc: eeglablist at sccn.ucsd.edu; Muhammad Hasan; Arnaud Delorme; Scott Makeig
>> Subject: Re: [Eeglablist] Ploting ONLY stat stignificant ERSP ina study
>> 
>> Dear Aleksandra,
>>  
>> So you want to show simple effect of ERSP results after significance masking. Actually it is not possible for the current STUDY scheme (!) which is a shame. You need to write a code to extract those values from STUDY.cluster(1,x).icaersp. Type 'help std_readersp' and read the help for a start.
>> 
>> I strongly believe that this should be doable, so I cc this to Arno and Scott to draw their attention.
>> 
>> Makoto
>> 
>> 2013/1/4 Aleksandra Vuckovic <Aleksandra.Vuckovic at glasgow.ac.uk>
>> Hi,
>> how can I plot only statistically significant ERSP (let's say p<0.05) in a study, in the same way as it can be plotted for a single subject? Currently I can only plot a separate figure with an area of statistically significant difference between two groups rather than statistically significant ERSP of a single group/single condition.
>> Many thanks,
>> Alex
>> 
>> _______________________________________________
>> 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
>> JSPS Postdoctral Fellow for Research Abroad
>> Swartz Center for Computational Neuroscience
>> Institute for Neural Computation, University of California San Diego
>>  
> 
>  

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20130114/17feef5a/attachment.html>


More information about the eeglablist mailing list