.-
help for ^circcomp^
.-

Comparative statistics for circular data
----------------------------------------

    ^circcomp^ varname [weight] [^if^ exp] [^in^ range]
    [ ^, by(^byvar^) ci lev^el^(^#^) r^ayleigh ^k^uiper ^d^etail ]

    ^circcomp^ varlist [weight] [^if^ exp] [^in^ range]
    [ ^, ci lev^el^(^#^) r^ayleigh ^k^uiper ^d^etail ]

Description
-----------

^circcomp^ produces comparative summary statistics for circular
variables with scales between 0 and 360 degrees. These are by default
    the mean direction (in degrees)
    the vector strength or mean resultant length
        (length of resultant / number of observations)
    the circular range (length of smallest arc including all
        observations) (in degrees)


Remarks
-------

^circsumm^ is an alternative to ^circsumm^ designed to allow focus on the
comparison of several variables or groups.

Suppose we have n measurements of a circular variable y. Then calculate

    C = SUM cos y

    S = SUM sin y

    arctan(S / C), the mean direction

    R = SQRT(C * C + S * S), the length of the resultant vector

    R / n, the vector strength or mean resultant length.


Options
-------

^by(^byvar^)^ 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.

^ci^ produces a confidence interval for the vector mean suitable for
    large samples (at least 25 values, say). This is based on an
    assumption that sampling variation follows a normal distribution.
    If we calculate further

    m_2 = (1 / n) SUM cos 2(y - vector mean of y)

    then the circular standard error CSE is estimated by

    SQRT[ n * (1 - m_2) / (2 * R * R) ]

    and the confidence interval is estimated as from

    vector mean - arcsin(z * CSE)

    to

    vector mean + arcsin(z * CSE)

    where z is the appropriate percentage point, given ^level( )^, from
    the Normal distribution with mean 0 and standard deviation 1.

^level(^#^)^ specifies the confidence level in percent for the
    confidence interval. The default is 95, meaning that z is
    approximately 1.96.  See help for ^ci^.

^rayleigh^ produces the Rayleigh test, which tests a null hypothesis of
    uniformity against an alternative hypothesis of unimodality (P-value
    shown).

^kuiper^ produces the Kuiper test, which tests a null hypothesis of
    uniformity against any alternative (P-value shown).
    A numerical approximation due to Stephens (1970, p.118) is used that
    gives accuracy to 3 decimal places for P < 0.447.

^detail^ is a synonym for ^ci rayleigh kuiper^.


Note on weights
---------------

aweights, fweights and iweights are allowed.

If weights are specified, they are used in calculating the mean
direction, the resultant vector length and the vector strength (and
hence the Rayleigh test and confidence limits if produced, although this
may not be justifiable). Weights are not used in calculating the
circular range or the Kuiper test.


Examples
--------

        . ^circcomp axisasp wallasp^
        . ^circcomp wallasp, by(grade) detail^


References
----------

Fisher, N.I. 1993. Statistical analysis of circular data. Cambridge:
Cambridge University Press.

Stephens, M.A. 1970. Use of the Kolmogorov-Smirnov, Cramer-von Mises and
related statistics without extensive tables. Journal of the Royal
Statistical Society Series B 32: 115-22.


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


Also see
--------

On-line:  help for @circsumm@, @ci@
