Skip to main content

StatsCircularMeans

StatsCircularMeans [/ALPH=significance /CI/Q/Z/T=k ] srcWave

The StatsCircularMeans operation calculates the mean of a number of circular means, returning the mean angle (grand mean), the length of the mean vector, and optionally confidence interval around the mean angle. Output is to the history area and to the W_CircularMeans wave in the current data folder.

Flags

/ALPH=valSets the significance level (default 0.05).
/CICalculates the confidence interval (labeled CI_t1 and CI_t2) around the mean angle.
/DEST=sWaveSpecify the destination wave for the circular means results. If you do not use this flag, the operation saves this output in the wave W_CircularMeans in the current data folder.
This flag was added in Igor Pro 10.00.
/FREECreates the user-specified destination wave as a free wave.
/FREE is allowed only in functions, and only if the destination waves are simple names or wave reference structure fields.
See Free Waves for more discussion.
The /FREE flag was added in Igor Pro 10.00.
/NSOAPerforms nonparametric second order analysis according to Moore's version of Rayleigh's test where H0 corresponds to uniform distribution around the circle. Moore's test ranks entries by the lengths of the mean radii (second column of the input) from smallest (rank 1) to largest (rank n) and then computes the statistic:
R=(1ni=0n1(i+1)cos(ai))2+(1ni=0n1(i+1)sin(ai))2n,R^{\prime}=\sqrt{\frac{\displaystyle \left(\frac{1}{n} \sum_{i=0}^{n-1}(i+1) \cos \left(a_{i}\right)\right)^{2}+\left(\frac{1}{n} \sum_{i=0}^{n-1}(i+1) \sin \left(a_{i}\right)\right)^{2}}{n}},
where ai are the mean angle entries (from column 1) corresponding to vector length rank (i+1). The critical value is obtained from Moore's distribution StatsInvMooreCDF.
/PSOAPerform parametric second order analysis where H0 corresponds to no mean population direction. It assumes that the second order quantities are from a bivariate normal distribution. If this is not the case, use /NSOA above. The test statistic is:
F=k(k2)2[Xˉ2Sy22XˉYˉSxy+Yˉ2Sx2Sx2Sy2Sxy2],\displaystyle F=\frac{k(k-2)}{2}\left[\frac{\bar{X}^{2} S_{y^{2}}-2 \bar{X} \bar{Y} S_{x y}+\bar{Y}^{2} S_{x^{2}}}{S_{x^{2}} S_{y^{2}}-S_{x y}^{2}}\right],
where
Xˉ=1ni=0n1Xi=1ni=0n1ricos(ai),Yˉ=1ni=0n1Yi=1ni=0n1risin(ai),Sx2=i=0n1Xi21n(i=0n1Xi)2,Sy2=i=0n1Yi21n(i=0n1Yi)2,Sxy=i=0n1XiYi1ni=0n1Xii=0n1Yi.\begin{array}{l} \bar{X}=\displaystyle\frac{1}{n} \sum_{i=0}^{n-1} X_{i}=\frac{1}{n} \sum_{i=0}^{n-1} r_{i} \cos \left(a_{i}\right), \\ \\ \bar{Y}=\displaystyle\frac{1}{n} \sum_{i=0}^{n-1} Y_{i}=\frac{1}{n} \sum_{i=0}^{n-1} r_{i} \sin \left(a_{i}\right), \\ \\ S_{x^{2}}=\displaystyle\sum_{i=0}^{n-1} X_{i}^{2}-\frac{1}{n}\left(\sum_{i=0}^{n-1} X_{i}\right)^{2}, \\ \\ S_{y^{2}}=\displaystyle\sum_{i=0}^{n-1} Y_{i}^{2}-\frac{1}{n}\left(\sum_{i=0}^{n-1} Y_{i}\right)^{2}, \\ \\ S_{x y}=\displaystyle\sum_{i=0}^{n-1} X_{i} Y_{i}-\frac{1}{n} \sum_{i=0}^{n-1} X_{i} \sum_{i=0}^{n-1} Y_{i} . \end{array}
Here n is the number of means in srcWave and the critical value is computed from the F distribution, equivalent to executing:
Print StatsInvFCDF(1-alpha,2,n-2)
/QNo results printed in the history area.
/T=kDisplays results in a table. k specifies the table behavior when it is closed.
k =0:Normal with dialog (default).
k =1:Kills with no dialog.
k =2:Disables killing.
/ZIgnores errors.

Details

The srcWave input to StatsCircularMeans must be a single or double precision two column wave containing in each row a mean angle (radians) and the length of a mean radius (the first column contains mean angles and the second column contains mean vector lengths). srcWave must not contain any NaNs or INFs. The confidence interval calculation follows the procedure outlined by Batschelet.

V_flag will be set to -1 for any error and to zero otherwise.

References

Zar, J.H., Biostatistical Analysis, 4th ed., 929 pp., Prentice Hall, Englewood Cliffs, New Jersey, 1999.

See Also

Statistical Analysis, StatsCircularMoments, StatsInvMooreCDF, StatsInvFCDF