diff scripts/statistics/tests/welch_test.m @ 3457:e031284eea27

[project @ 2000-01-19 08:49:56 by jwe]
author jwe
date Wed, 19 Jan 2000 08:50:14 +0000
parents 434790acb067
children 74c2fc84f0cf
line wrap: on
line diff
--- a/scripts/statistics/tests/welch_test.m	Wed Jan 19 06:59:23 2000 +0000
+++ b/scripts/statistics/tests/welch_test.m	Wed Jan 19 08:50:14 2000 +0000
@@ -26,8 +26,9 @@
 ## interest can be selected.  If @var{alt} is @code{"!="} or
 ## @code{"<>"}, the null is tested against the two-sided alternative
 ## @code{mean (@var{x}) != @var{m}}.  If @var{alt} is @code{">"}, the
-## one-sided alternative mean(x) > m is considered, similarly for
-## @code{"<"}.  The default is the two-sided case.
+## one-sided alternative mean(x) > @var{m} is considered.  Similarly for
+## @code{"<"}, the one-sided alternative mean(x) < @var{m} is
+## considered.  The default is the two-sided case.
 ##
 ## The p-value of the test is returned in @var{pval}.
 ##
@@ -54,7 +55,7 @@
   v_x  = sumsq (x - mu_x) / (n_x * (n_x - 1));
   v_y  = sumsq (x - mu_y) / (n_y * (n_y - 1));
   c    = v_x / (v_x + v_y);
-  df   = 1 / ( c^2 / (n_x - 1) + (1 - c)^2 / (n_y - 1));
+  df   = 1 / (c^2 / (n_x - 1) + (1 - c)^2 / (n_y - 1));
   t    = (mu_x - mu_y) / sqrt (v_x + v_y);
   cdf  = t_cdf (t, df);