-------------------------------------------------------------------------------
help for circmedian
-------------------------------------------------------------------------------

Median and mean deviation for circular variables

circmedian varlist [if exp] [in range]

circmedian varname [if exp] [in range] [, by(byvar)]

Description

circmedian calculates the circular median and mean deviation from the median for circular variables with scales between 0 and 360 degrees.

Circular data have no natural origin; whatever origin is used is a matter of convention. There is thus no natural ordering of circular data from smallest to largest. This is a blow to the idea of a circular median, but by no means a fatal one. We could measure the difference between two angles clockwise or counterclockwise (anticlockwise); measure both, treating both differences as positive, and record the smaller. Thus the difference between 45 and 55 degrees is min(10,350) = 10; the difference between 350 and 10 degrees is min(20, 340) = 20; or more generally d(theta, phi) = min(|theta - phi|, 360 - |theta - phi|). Then define the circular median by the fact that it minimises

SUM d(value, median)

or, equivalently,

MEAN d(value, median),

the latter being called here the mean deviation (from the median). In the event of ties in these measures the median is defined as the vector mean of all angles minimising either. See help on circsummarize.

Remarks

Batschelet (1981, p.242) uses the notation |theta, phi| for d(theta, phi) and points out that it is also arccos(cos(theta - phi)). Another scale on which to measure difference is thus 1 - cos(theta - phi).

Options

by() specifies that results are to be shown for each group defined by values of byvar. This option is only available if a single varname is specified.

Examples

. circmedian axisasp wallasp

. circmedian axisasp, by(geology)

Author

Nicholas J. Cox, University of Durham, U.K. n.j.cox@durham.ac.uk

References

Batschelet, E. 1981. Circular statistics in biology. London: Academic Press.

Also see

On-line: help for circsummarize, circdiff