circ_symtest.m 789 B

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