Group: | Statistical Data Analysis |
Topic: | Basic Statistics |
See also: | mean sum var |
Function: | median | |
Description: | Computes the empirical medians of a given array. |
Usage: | median = median (x {, j}) | |
Input: | ||
x | d1 x d2 x .. x dn array | |
j | integer (for faster median, default 0) | |
Output: | ||
median | 1 x d2 x .. x dn array - for each column in x the empirical medians |
Any non-zero number as the optional parameter causes for even number of observations faster computing - the median is simply aproximated by the (# of elements)/2 th element (possible to use for samples greater than 100 only).
randomize(0) x = normal(200, 3) median(x)
Contents of median [1,] -0.063414 -0.040036 0.062863
randomize(0) x = normal(200, 3) x[1,1:2] = NaN x[2,1] = NaN median(x)
Contents of median [1,] +NAN +NAN 0.062863