Median - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Student[Statistics]

  

Median

  

compute the median

 

Calling Sequence

Parameters

Description

Computation

Examples

References

Compatibility

Calling Sequence

Median(A, numeric_options, output_option)

Median(M, numeric_options, output_option)

Median(X, numeric_options, output_option)

Parameters

A

-

data sample

M

-

Matrix data sample

X

-

algebraic; random variable

numeric_option

-

(optional) equation of the form numeric=value where value is true or false

output_option

-

(optional) equation of the form output=x where x is value, plot, or both

Description

• 

The Median function computes the median of the specified random variable or data sample.

• 

The first parameter can be a Vector, a list, a Matrix, a random variable, or an algebraic expression involving random variables (see Student[Statistics][RandomVariable]).

• 

In the first calling sequence, if A has an even number of data points, then the median is the mean of the two middle data points.

• 

In the second calling sequence, if X is a discrete random variable, then the median is defined as the first point t such that the CDF at t is greater than or equal to 12.

• 

If the option output is not included or is specified to be output=value, then the function will return the value of the mean. If output=plot is specified, then the function will return a plot of the input data set and its mean. If output=both is specified, then both the value and the plot of the mean will be returned.

Computation

• 

By default, all computations involving random variables are performed symbolically (see option numeric below).

• 

If the median is determined by only one data point in the data set, then the median equals that data point.

• 

If the median is determined by two data points in the data set, and at least one of them has floating point values or the option numeric is included , then the computation is done in floating point. Otherwise the computation is exact.

• 

By default, the median is computed according to the rules mentioned above. To always compute the median numerically, specify the numeric or numeric = true option.

Examples

withStudentStatistics:

Compute the median of the Normal distribution with parameters p and q.

MedianNormalRandomVariablep,q

p

(1)

Use numeric parameters.

MedianNormalRandomVariable3,5

3

(2)

MedianNormalRandomVariableπ,5,numeric

3.141592654

(3)

If the output=plot option is included, then a plot will be returned.

MedianNormalRandomVariableπ,5,numeric,output=plot

Compute the median of the given data. Since π and 4 are the numbers that are eventually used to compute the median, and they are both exact values (not using floating point values), the result is an exact expression.

MedianVectorrowπ,1,4,6.01

π2+2

(4)

Compute the median of the given data. Since 263 and 22.0 are the numbers that are eventually used to compute the median, and 22.0 is a floating point value, the result will be a floating point value.

Median34.2,22.0,2,263

15.33333333

(5)

If the output=both option is included, then both the value of the median and its plot will be returned.

median,graphMedian34.2,22.0,2,263,output=both

median,graph15.33333333,PLOT...

(6)

median

15.33333333

(7)

graph

Consider the following Matrix data sample.

MMatrix3,5.0,ln300,3,2,2π,9,3,1,sqrt26,4,3.0,5,7,7.0,3

M35.0ln300322π9312643.0577.03

(8)

Compute the median of each of the columns according to the computation rules.

MedianM

52262+π6.3518912383.000000000

(9)

References

  

Stuart, Alan, and Ord, Keith. Kendall's Advanced Theory of Statistics. 6th ed. London: Edward Arnold, 1998. Vol. 1: Distribution Theory.

Compatibility

• 

The Student[Statistics][Median] command was introduced in Maple 18.

• 

For more information on Maple 18 changes, see Updates in Maple 18.

See Also

Statistics[Median]

Student

Student[Statistics]

Student[Statistics][RandomVariable]