How to convert data around a circle for circular statistics?
Show older comments
I have generated 36 values at equidistant distances at an interval of 10. I want to convert it to circular data. Is there a way?
18 Comments
KSSV
on 10 Aug 2018
What do you mean by a circular data?
Ajay Goyal
on 10 Aug 2018
Edited: Image Analyst
on 10 Aug 2018
Image Analyst
on 10 Aug 2018
Do you have (x,y) cartesian coordinates, and you're wanting to convert them into polar coordinates with cart2pol()?
Ajay, some clarification is needed. In your data you have 3 columns, the first (position) is in degrees. What are the 2nd and 3rd columns?
The test you'd like to do is the Watson-Williams test for significance (one-factor ANOVA) [1]?
What do you mean, "input data unit is total number of cells"?
[1] Watson GS, Williams EJ (1956). On the Construction of Significance Tests on the Circle and the Sphere." Biometrika, 43, 344{352
Ajay Goyal
on 10 Aug 2018
Ajay Goyal
on 10 Aug 2018
Adam Danz
on 10 Aug 2018
Ajay, it would be easy to convert your 'position' data from degrees to radians. However, after briefly looking at the distribution of your data, are you sure they fulfill the von Mises distribution criteria for the Watson-William test? If not, you could consider some non-parametric tests. I found this reference helpful . Were you planning on using circ_wwtest() from the circular statistics toolbox?
Ajay Goyal
on 11 Aug 2018
Adam Danz
on 12 Aug 2018
Hi Ajay, You're right that the inputs must be in radians. Columns 2 and 3 of your data are cell counts so you can't, and don't want to, convert them to radians.
You'll probably want to use first and second inputs of the circ_wwtest() as follows. The first one is a vector of your radian values in column 1 and the second is a grouping variable that groups the first input into the different groups (your two columns). So, if row 1 is [pi, 4, 2], you'll replicate Pi 6 times and your grouping vector will have four ones and two twos which represents Group 1 and 2, your columns 2 and 3. you'll repeat that for all of the rows of your data which will end up with two large vectors. See the first link below, starting at the bottom of page 12 for a description of this function.
The second link is an example of this function but in a different software. I couldn't find a Matlab example.
I'm posting this on my smartphone and I do not have Matlab available right now so if you get stuck let me know and I can help more another time.
https://www.wavemetrics.com/products/igorpro/dataanalysis/statistics/tests/statistics_pxp32
Ajay Goyal
on 13 Aug 2018
Adam Danz
on 13 Aug 2018
You mentioned that columns 2 and 3 were cell counts and your example data in those columns are integers. I'm not familiar enough with your data to recommend how to apply it to a statistic. Hopefully the jstatsoft journal article (starting ph 12) will be enough to understand who the circ_wwtest() works.
Ajay Goyal
on 14 Aug 2018
Adam Danz
on 14 Aug 2018
No offense taken! :) it's my pleasure to help but without being familiar with your data, I can't specify how to set it up for a circular ANOVA test. If you get stuck and can explain what you're doing with your data I'd be glad to chip in.
Ajay Goyal
on 15 Aug 2018
Adam Danz
on 15 Aug 2018
Previously you mentioned that your data were cell counts (integers) which could be used to produce populations with units of degrees or radians which is why I suggested the Watson test but this is different.
I understand that you want to determine whether or not the two distributions are significantly different and that those measurements are taken around a circular object (bone, I suppose). Your measurements are in millimeters (thickness) and are sampled at intervals in degrees (surface). While it is easy to convert between degrees and mm when measuring distance[1], that's not what you're doing. Correct me if I'm wrong but you're measuring thickness of bone at various location around a circular object and in that context, thickness isn't related to anything circular. Example: my book is 50mm thick - there's no way to convert that to degrees or radians. So, even though your data were collected around a circular object, your data itself isn't circular.
In neuroscience (my field) we often measure the spike rates of neurons as we move the subject in different directions around a circle in order to understand the neuron's heading tuning. While the independent variable is circular, the dependent variable (spike rate) is not. And we don't use circular statistics in that case.
I plotted out your data (below) and the two distributions look different. I don't know whether or not your data from column 2 and 3 are independent or not but a simple paired t-test concludes that the distributions are significantly different (p < 0.5, tstat = -2.33). However your data aren't normally distributed so perhaps a Wilcoxon’s matched-pairs test would be more appropriate.
Take my suggestions with a grain of salt since I only partially understand the context of your data.

Ajay Goyal
on 15 Aug 2018
Edited: Ajay Goyal
on 15 Aug 2018
Adam Danz
on 15 Aug 2018
Great! I'll create an "answer" to this question below so that it is tagged as answered and no longer in the list of unanswered questions.
Ajay Goyal
on 15 Aug 2018
Accepted Answer
More Answers (0)
Categories
Find more on Language Support in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!