# [FieldTrip] Problems with statistics for circular data

Thomas.Baumgarten at med.uni-duesseldorf.de Thomas.Baumgarten at med.uni-duesseldorf.de
Wed Jan 15 16:07:37 CET 2014

```Dear Tobias,
Thank you for the hint! Indeed, this makes the calculation of the circular difference much easier and the resulting values stay between -pi and pi. Sorry that I didn't think of this, since the purpose of the function is rather obvious.

Best regards,
Thomas

Von: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] Im Auftrag von Tobias Staudigl
Gesendet: Mittwoch, 15. Januar 2014 10:19
An: FieldTrip discussion list
Betreff: Re: [FieldTrip] Problems with statistics for circular data

Dear Thomas,

try using circ_dist.m (in the circ_stats toolbox by Berens).
This should solve the circular difference issue.

all the best,
Tobias

Am 15.01.2014 09:35, schrieb Thomas.Baumgarten at med.uni-duesseldorf.de<mailto:Thomas.Baumgarten at med.uni-duesseldorf.de>:
Dear FieldTrip users,
I am working on a set of circular data (phase angles of ongoing oscillations computed via Hilbert transform) and would like to statistically compare two conditions (A,B). For this, I use the circular statistics toolbox for matlab by P. Berens. I worked on this problem from two different angles:
1. First, I tried to directly compare the two conditions via the Watson-Williams two-sample test (function: circ_wwtest). Unfortunately, this didn't work out, since the test requires an average resultant vector length of > 0.45 for n >= 11 entries/ subjects, an assumption which is not met by my data.
2. Second, I tried to calculate the angle of difference between the two conditions (angle(A) - angle(B)) and then used  the one-sample mean angle test (function: circ_mtest) to test if the resulting angle of difference is significantly different from zero. Here, the following problems arise: Since the resulting angles for A and B range from -pi to +pi, there are cases when the subtraction of the two angles results in roughly +2pi or -2pi (e.g. cases where (A = pi) - (B = -pi) = 2pi), resulting in an error from the circ_mtest function. I tried to solve this problem by using a modulus (2pi) operation (i.e. by 'cleaning out' the redundant circumventions while at the same time preserving the angle information), but unfortunately this didn't work out either.
The only other option I can think of would be to generate surrogate data (i.e. a matrix with the same dimensions as the matrix with the angles of difference , only filled with zeros) and to apply a cluster-based permutation test (similar to ft_freqstatitics). Although this would take care of my multiple-comparison problem, I am not quite sure if the cluster correction is still valid in this case and if this test would work for circular data.
Thomas

Thomas Baumgarten, PhD Student
Institute of Clinical Neuroscience and Medical Psychology, Medical Faculty, Heinrich-Heine-University Düsseldorf, Universitätsstraße 1, 40225 Düsseldorf, Germany

_______________________________________________

fieldtrip mailing list

fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>

http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

--

Dr. Tobias Staudigl

Fachbereich Psychologie - ZPR

Postfach ZPR

78457 Konstanz

ZPR, Haus 12

Tel.: +49 (0)7531 / 88 - 5703
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140115/b16c85e8/attachment-0002.html>
```