# [FieldTrip] source level statistics on one data set.

jan-mathijs schoffelen jan.schoffelen at donders.ru.nl
Sat Jan 19 08:08:32 CET 2013

```Hi Naran,

It seems you're almost there!
What I would do is the following:

Rather than computing the relative differece srcDiff, I'd keep the 2 conditions separate. Then, srcA and srcB (for all subjects) are ready to enter into ft_sourcestatistics. No need to call ft_sourcegrandaverage. Note: that if you call ft_sourcegrandaverage with cfg.keepindividual = 'no', you'll only get an average across subjects, so that's not useful for doing statistics to begin with. Alternatively, you could call ft_sourcegrandaverage with cfg.keepindividual = 'no', but this is a redundant step. Moreover, it is a bit silly, because in that case no 'grandaveraging' is done to begin with.
We don't have tutorial documentation (yet) for doing group statistics on source level data, but you may get some inspiration from the tutorials that deal with sensor-level data. Instead of using ft_timelockanalysis you should use ft_sourcestatistics.
The final step would be something like this:

cfg = [];
cfg ...
stat = ft_sourcestatistics(cfg, srcA1, srcA2, srcA3, ...., srcB1, srcB2, srcB3, ....

where srcA1 etc pertain to the single subject results for condition A and likewise for B. It now boils down to informing ft_sourcestatistics with the appropriate design matrix, e.g.

cfg.design = [1:Nsubj 1:Nsubj;ones(1,Nsubj) ones(1,Nsubj)*2];
cfg.ivar = 2;
cfg.uvar = 1;
cfg.statistic = 'depsamplesT';

In this case you will perform a paired T-test between the 2 conditions.

Best,

Jan-Mathijs

On Jan 19, 2013, at 7:00 AM, Narayanan Kutty wrote:

> Dear All,
>
> I had a question regarding across subject source level statistics using fieldtrip.
>
> For 15 subjects I have two conditions conA and conB. For each subject I then
>
> 1. calculate a DICS  beaformer for conA, conB, based on a common filter. (lets call them srcA and srcB resp.)
>
> 2. calculate normalized srcDiff  by doing (srcA-srcB/srcA)
>
> 3. interpolate and normalize srcDiff  using ft_sourceinterpolate and ft_volumenormalise (lets call the output srcDiffNorm)
>
> After I have done that for each subject  I use ft_sourcegrandaverage with  cfg.keepindividual = 'yes'; to get grandavgAvsB.
>
> What I would like to do is test just grandavgAvsB to see if any voxels are significantly different from zero (zero being conA = conB).
>
> How should I go about doing this using ft_sourcestatistics (or another program). The example scripts seem want two datasets.
>
> sincerely
> Naran
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

Jan-Mathijs Schoffelen, MD PhD

Donders Institute for Brain, Cognition and Behaviour,
Centre for Cognitive Neuroimaging,

Max Planck Institute for Psycholinguistics,
Nijmegen, The Netherlands

J.Schoffelen at donders.ru.nl
Telephone: +31-24-3614793

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130119/c2acc861/attachment-0002.html>
```