# [FieldTrip] granger causality

Carina Oehrn nenga at gmx.net
Mon Jul 30 18:29:38 CEST 2012

```Hi there,

I have got an iEEG dataset and would like to look at the directionality of interactions between two channels in two different conditions using granger causality. Hopefully somebody here can help me :-)

1.) I know that I can calculate the appropriate model order and window length with the bsmart toolbox. But from the documentation I somehow do not get the format of data I should use for this calculation.
When I enter the time-frequency data (which I want to use to estimate granger causality) (size: 2 x 2 x freq x time points), it doesn't work.
Any advise? I have a sampling rate of 1000. What sort of time window and maximal model order would make sense do you think?

2)I would like to keep the time domain analyzing my data. What do you think would be an appropriate sliding time window using the 'ft_mvaranalysis' function? And what does it mean exactly? By choosing the model order, I am already determining the maximal time lag between the two functions. Are the values then estimated for the whole time window?

3)What do you think about statistics? Would it makes sense to use the non-parametric cluster approach to shuffle within patients and do a group analysis that way?

Thank you so much in advance!
Best,
Carina

As a summary,I am doing following steps with field trip:

cfg = [];
cfg.dftfilter ='yes'
prep_cond1{subj} = ft_preprocessing(cfg, data);

cfg         = [];
cfg.order   = 5;
cfg.toolbox = 'bsmart';
cfg.t_ftimwin = 0.05
cfg.toi       = -1:0.001:3.5;
mdata_cond1{subj}= ft_mvaranalysis(cfg, prep_cond1{subj});

cfg = [];
cfg.method = 'mvar';
cfg.foi        = 4:100;
cond1_freq{subj}=  ft_freqanalysis_mvar(cfg,mdata_cond1{subj});

cfg           = [];
cfg.method    = 'granger';
cond1_granger{subj}  = ft_connectivityanalysis(cfg, cond1_freq{subj});

```