median

From STX Wiki
< Programmer Guide‎ | Command Reference‎ | EVAL
Revision as of 17:31, 18 November 2010 by Admin (talk | contribs) (1 revision: Initial import)
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