* Trigonometry:: ACOS ARCOS ARSIN ARTAN ASIN ATAN COS SIN TAN
* Missing Value Functions:: MISSING NMISS NVALID SYSMIS VALUE
* Set Membership:: ANY RANGE
-* Statistical Functions:: CFVAR MAX MEAN MIN SD SUM VARIANCE
+* Statistical Functions:: CFVAR MAX MEAN MEDIAN MIN SD SUM VARIANCE
* String Functions:: CONCAT INDEX LENGTH LOWER LPAD LTRIM NUMBER
REPLACE RINDEX RPAD RTRIM STRING SUBSTR UPCASE
* Time and Date:: CTIME.xxx DATE.xxx TIME.xxx XDATE.xxx
Results in the mean of the values of @var{number}.
@end deftypefn
+@cindex median
+@deftypefn {Function} {} MEDIAN (@var{number}, @var{number}[, @dots{}])
+Results in the median of the values of @var{number}. Given an even
+number of nonmissing arguments, yields the mean of the two middle
+values.
+@end deftypefn
+
@cindex minimum
@deftypefn {Function} {} MIN (@var{number}, @var{number}[, @dots{}])
Results in the value of the least @var{value}. The @var{value}s may
[[min("1", "2")], ["1"]],
[[min("1")], ["1"]])
-CHECK_EXPR_EVAL([cfvar mean sd sum variance],
+CHECK_EXPR_EVAL([cfvar mean median sd sum variance],
[[cfvar(1, 2, 3, 4, 5)], [0.53]],
[[cfvar(1, $sysmis, 2, 3, $sysmis, 4, 5)], [0.53]],
[[cfvar(1, 2)], [0.47]],
[[mean.4(1, 2, 3)], [error],
[error: DEBUG EVALUATE: With MEAN(number[, number]...), using minimum valid argument count of 4 does not make sense when passing only 3 arguments in list.]],
+ [[median(1, 2, 3, 4, 5)], [3.00]],
+ [[median(2, 3, 4, 5, 1)], [3.00]],
+ [[median(2, 3, 4, 1, 5)], [3.00]],
+ [[median(2, 1, 4, 5, 3)], [3.00]],
+ [[median(1, 2, 3, 4)], [2.50]],
+ [[median(2, 3, 1, 4)], [2.50]],
+ [[median(2, 3, 4, 1)], [2.50]],
+ [[median(2, 1, 4, 3)], [2.50]],
+ [[median(1, $sysmis, 3, 4, 5)], [3.50]],
+ [[median(2, 3, 4, 5, $sysmis, 1)], [3.00]],
+ [[median($sysmis, $sysmis, $sysmis, 2, 3, 4, 1, 5)], [3.00]],
+ [[median(1, 2, 3)], [2.00]],
+ [[median(1)], [1.00]],
+ [[median(1, 2)], [1.50]],
+ [[median(1, 2, $sysmis)], [1.50]],
+ [[median(1, $sysmis, $sysmis)], [1.00]],
+ [[median($sysmis, $sysmis, $sysmis)], [sysmis]],
+ [[median.3(1, 2, $sysmis)], [sysmis]],
+ [[median.2(1, $sysmis)], [sysmis]],
[[sd(1, 2, 3, 4, 5)], [1.58]],
[[sd(1, $sysmis, 2, 3, $sysmis, 4, 5)], [1.58]],