Mercurial > octave-nkf
diff scripts/statistics/tests/welch_test.m @ 3456:434790acb067
[project @ 2000-01-19 06:58:51 by jwe]
author | jwe |
---|---|
date | Wed, 19 Jan 2000 06:59:23 +0000 |
parents | d8b731d3f7a3 |
children | e031284eea27 |
line wrap: on
line diff
--- a/scripts/statistics/tests/welch_test.m Tue Jan 18 19:57:13 2000 +0000 +++ b/scripts/statistics/tests/welch_test.m Wed Jan 19 06:59:23 2000 +0000 @@ -34,17 +34,17 @@ ## If no output argument is given, the p-value of the test is displayed. ## @end deftypefn -## Author: KH <Kurt.Hornik@ci.tuwien.ac.at> -## Description: Welch two-sample t test +## Author: KH <Kurt.Hornik@ci.tuwien.ac.at> +## Description: Welch two-sample t test function [pval, t, df] = welch_test (x, y, alt) if ((nargin < 2) || (nargin > 3)) - usage ("[pval, t, df] = welch_test (x, y [, alt])"); + usage ("[pval, t, df] = welch_test (x, y, alt)"); endif if (! (is_vector (x) && is_vector (y))) - error ("welch_test: both x and y must be vectors"); + error ("welch_test: both x and y must be vectors"); endif n_x = length (x); @@ -63,7 +63,7 @@ endif if (! isstr (alt)) - error ("welch_test: alt must be a string"); + error ("welch_test: alt must be a string"); endif if (strcmp (alt, "!=") || strcmp (alt, "<>")) pval = 2 * min (cdf, 1 - cdf); @@ -72,11 +72,11 @@ elseif (strcmp (alt, "<")) pval = cdf; else - error (sprintf ("welch_test: option %s not recognized", alt)); + error ("welch_test: option %s not recognized", alt); endif if (nargout == 0) - printf (" pval: %g\n", pval); + printf (" pval: %g\n", pval); endif endfunction