Mercurial > octave-antonio
comparison scripts/statistics/tests/wilcoxon_test.m @ 11472:1740012184f9
Use uppercase for variable names in error() strings to match Info documentation. Only m-files done.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sun, 09 Jan 2011 21:33:04 -0800 |
parents | be55736a0783 |
children | fd0a3ac60b0e |
comparison
equal
deleted
inserted
replaced
11471:994e2a93a8e2 | 11472:1740012184f9 |
---|---|
48 if (nargin < 2 || nargin > 3) | 48 if (nargin < 2 || nargin > 3) |
49 print_usage (); | 49 print_usage (); |
50 endif | 50 endif |
51 | 51 |
52 if (! (isvector (x) && isvector (y) && (length (x) == length (y)))) | 52 if (! (isvector (x) && isvector (y) && (length (x) == length (y)))) |
53 error ("wilcoxon_test: x and y must be vectors of the same length"); | 53 error ("wilcoxon_test: X and Y must be vectors of the same length"); |
54 endif | 54 endif |
55 | 55 |
56 n = length (x); | 56 n = length (x); |
57 x = reshape (x, 1, n); | 57 x = reshape (x, 1, n); |
58 y = reshape (y, 1, n); | 58 y = reshape (y, 1, n); |
72 if (nargin == 2) | 72 if (nargin == 2) |
73 alt = "!="; | 73 alt = "!="; |
74 endif | 74 endif |
75 | 75 |
76 if (! ischar (alt)) | 76 if (! ischar (alt)) |
77 error("wilcoxon_test: alt must be a string"); | 77 error("wilcoxon_test: ALT must be a string"); |
78 elseif (strcmp (alt, "!=") || strcmp (alt, "<>")) | 78 elseif (strcmp (alt, "!=") || strcmp (alt, "<>")) |
79 pval = 2 * min (cdf, 1 - cdf); | 79 pval = 2 * min (cdf, 1 - cdf); |
80 elseif (strcmp (alt, ">")) | 80 elseif (strcmp (alt, ">")) |
81 pval = 1 - cdf; | 81 pval = 1 - cdf; |
82 elseif (strcmp (alt, "<")) | 82 elseif (strcmp (alt, "<")) |