median

From STX Wiki
< Programmer Guide‎ | Command Reference‎ | EVAL
Revision as of 14:05, 17 May 2010 by 193.171.195.8 (talk) (initial import)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
median

Calculate the median of the vector x.

Usage:

median(x)

median(x,q)

Parameters:
x
The data vector.
q
The cut point (0 < q < 1) or a vector of cut points. If no cut point is specified, 0.5 is used. If q is a vector, each element q[i] must be in the range 0 to 1.
Return Type:

scalar

Result:

The value xq with sum(h(x <= xq)) = q

If q is a vector the result is a vector xq with nrow(q) elements with: h(x | x<=xq[i]) = q[i]

Navigation menu

Personal tools