# Median

## Median(X, I)

Computes the sample median. Equivalent to GetFract(X, 50%).

Without an index parameter, computes the sample median of the uncertainty sample (along the Run index). With an index, computes the sample median along index «I».

The median is the "middle" value of a sample, such that half the samples are less or equal to than the median and half greater than or equal to the median. It is also called the 50%-fractile or 50th-percentile.

## Optional parameters

### W

A weighting on the data points. Median can compute the percentile based on an unequal weighting, such that some points carry more weight than others. If specified, «w» should be indexed by «I» (or by Run, if «I» is omitted). When «w» and «I» are both omitted, Median uses the global weighting specified by the system variable SampleWeighting.

### Discrete

A boolean parameter that explicitly controls whether the data is treated as discrete or continuous. Without this, various heuristic rules are used (see below).

### Domain

This is seldom used by Analytica modelers, although it could be in rare cases. Analytica itself makes use of this parameter internally. A variable containing a domain attribute can be specified here to indicate the set of possible values. Analytica can use that to figure out whether the value is discrete or continuous, and in the discrete case, it will use this domain to determine the ordering between possible values (which impacts the resulting percentile value).

## Library

Statistical Functions