Use the
mean,
median, mode and
percentile functions to give measures of the location of data points relative to the rest of the distribution. The best choice of location estimator depends on the general dispersion or distribution of the data.
mean
Find the arithmetic mean of a data set.
1. Define a set of numeric data.
2. Use the mean function to calculate the arithmetic mean of the data.
This is equivalent to the following calculation:
3. Change one of the data points before recalculating the mean.
The mean is sensitive to the change in the value of one or more of the data points. If your data set has significant outliers, you may find the mean a poor description of the central location. You can trim the outliers, and calculate the trimmed mean for a better estimate.
median
Find the median, or middle value, of a data set.
1. Use the median function to find the median of the previous data set.
2. Use the
sort function to sort the data in ascending order and show that the median is the middle value of the set:
The median depends on the relative positions of the data, not on the actual values of every data point. Therefore, the median is relatively insensitive to small changes in individual data values.
3. Use the median function to find the median for an even number of data points.
When data sets contain an even number of data points, the median is the average of the two middle data points.
mode
The mode of a data set is the value that occurs with greatest frequency.
1. Use the mode function to find the mode of the data set. Since there are no repeated values in data, an error is returned.
2. Create a new data set that contains more than one element that repeat with the same frequency.
3. Use the mode function to show that an error is returned when more than one data value is repeated with the same frequency.
percentile
Use the percentile function to find percentiles, quartiles, and the median of a data set. Percentiles measure which values of a data set fall below a certain percentage of the total number of points.
1. Define a data set.
2. Use the percentile function to find the fiftieth percentile of data set X.
This is equivalent to the median of data set X:
3. Use the percentile function to find the ninetieth percentile of data set X.
The ninetieth percentile occurs between two data points.
4. Use the percentile function to find the quartiles of the first data set.
A quartile is one of the three percentiles that mark 1/4 of the data. Quartiles can be used for graphical analysis of data in Quantile-Quantile plots.