Download this file

41 lines (30 with data), 789 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function pval = circ_symtest(alpha)
%
% [pval, z] = circ_symtest(alpha,w)
% Tests for symmetry about the median.
% H0: the population is symmetrical around the median
% HA: the population is not symmetrical around the median
%
% Input:
% alpha sample of angles in radians
%
% Output:
% pval p-value
%
% PHB 3/19/2009
%
% References:
% Biostatistical Analysis, J. H. Zar, 27.4
%
% Circular Statistics Toolbox for Matlab
% By Philipp Berens, 2009
% berens@tuebingen.mpg.de - www.kyb.mpg.de/~berens/circStat.html
if size(alpha,2) > size(alpha,1)
alpha = alpha';
end
% compute median
md = circ_median(alpha);
% compute deviations from median
d = circ_dist(alpha,md);
% compute wilcoxon sign rank test
pval = signrank(d);