Student[Statistics]
Median
compute the median
Calling Sequence
Parameters
Description
Computation
Examples
References
Compatibility
Median(A, numeric_options, output_option)
Median(M, numeric_options, output_option)
Median(X, numeric_options, output_option)
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
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.
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.
with⁡StudentStatistics:
Compute the median of the Normal distribution with parameters p and q.
Median⁡NormalRandomVariable⁡p,q
p
Use numeric parameters.
Median⁡NormalRandomVariable⁡3,5
3
Median⁡NormalRandomVariable⁡π,5,numeric
3.141592654
If the output=plot option is included, then a plot will be returned.
Median⁡NormalRandomVariable⁡π,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.
Median⁡Vectorrow⁡π,1,4,6.01
π2+2
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.
Median⁡34.2,22.0,2,263
15.33333333
If the output=both option is included, then both the value of the median and its plot will be returned.
median,graph≔Median⁡34.2,22.0,2,263,output=both
median,graph≔15.33333333,PLOT⁡...
median
graph
Consider the following Matrix data sample.
M≔Matrix⁡3,5.0,ln⁡300,3,2,2⁢π,9,3,1,sqrt⁡26,4,3.0,5,7,7.0,3
M≔35.0ln⁡300322⁢π9312643.0577.03
Compute the median of each of the columns according to the computation rules.
Median⁡M
52262+π6.3518912383.000000000
Stuart, Alan, and Ord, Keith. Kendall's Advanced Theory of Statistics. 6th ed. London: Edward Arnold, 1998. Vol. 1: Distribution Theory.
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][RandomVariable]
Download Help Document