# [FieldTrip] Calculating single PLI value for a frequency band

Avijit Chowdhury e0046902 at gmail.com
Mon Apr 4 12:27:45 CEST 2022

```Dear Jan-Mathijs,

I am analysing resting state data so I don't have any "trials" as such, but
that I would like to calculate PLI values for successive 2 sec segments in
my data.

What does cfg.keeptrials = 'yes' accomplish in this case? My idea was that
since this calculates the cross-spectral density at the trial level, the
subsequent PLI is also calculated at the trial level.

Coming back to my initial question, how do I get the PLI across a certain
frequency band (example: 8-13 hz, Alpha band) for each 2 sec segments?
Currently with my script I am getting a PLI value with the dimensions :
repetition * channel * channel * frequencies (in steps of 1 hz).

Best,
Avi

On Mon, Apr 4, 2022, 3:49 AM Schoffelen, J.M. (Jan Mathijs) via fieldtrip <
fieldtrip at science.ru.nl> wrote:

> Hi Avi,
>
> PLI, like any other connectivity metric needs to be computed across some
> unit-of-observation in order for it to make sense.
> In FieldTrip, the  UOs for connectivity analysis are always considered to
> be the trial dimension.
>
> In other words, no there is no way to compute a PLI for an individual
> trial (although you could get a ‘proxy’ for the single trial PLI by
> computing a so-called pseudo value, which from the top of my head (but
> please look this up to be sure) is computed as: N*PLI(all) -
> (N-1)*PLI(loo), where PLI(avg) is the PLI computed across all repetitions,
> and PLI(loo) is the PLI computed using a leave-one-out strategy. You may
> also have a look at this paper: https://pubmed.ncbi.nlm.nih.gov/25917516/ or
> this one: https://pubmed.ncbi.nlm.nih.gov/17569862/
>
> Best wishes,
> Jan-Mathijs
>
>
>
>
> On 3 Apr 2022, at 06:42, Avijit Chowdhury via fieldtrip <
> fieldtrip at science.ru.nl> wrote:
>
> Dear all,
>
> I am novice to EEG analysis and I am trying to calculate Phase Lag Index
> for my resting state data.
>
> I have redefined the data as 2 sec trials and then run
> ft_frequencyanalysis with “powandcsd” as cfg.output:
>
> cfg = [];
> cfg.length = 2;
> data_trials = ft_redefinetrial(cfg, data);
>
> cfg              = [];
> cfg.method = 'mtmfft';
> cfg.taper = 'hanning';
> cfg.foilim = [8 13]; % I want to look only at alpha band
> cfg.keeptrials = 'yes';
> cfg.output='powandcsd';
> freq = ft_freqanalysis(cfg, data_trials);
>  cfg = [];
> cfg.method    = 'wpli';
> PLI= ft_connectivityanalysis(cfg, freq);
>
> With the above script, I get an output of PLI with the dimension of trials
> x channel x channel x frequency.
>
> Is there a way I can get one PLI index for each trial, for each channel
> combination, across the frequency band I specified. Essentially, how can I
> get PLI values with dimensions: trials x channel x channel
>
> I am very new to this so any help is appreciated. Also, If I am trying to
> filter my results to only the alpha band (8-13hz), is what I am doing the
> correct way to achieve this?
>
> Thank you,
> Avi
>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
> https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!7TVstS0axYC9hbjX14iENjBzGIjpNqefPnrn2XxYxqKa4UsNFATM6-cKN7mQKqX0uNMNNtAV18Iv9Pb9c00vvjVhVcpjr6GrhSaxeg\$
>
>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20220404/29e310c5/attachment.htm>
```