How to | Calculate Basic Descriptive Statistics
The Wolfram Language has many powerful features to handle a wide range of statistical needs. Some of the most elementary are outlined below.
Here is some data (20 random real numbers between 0 and 50):
data = RandomReal[50, 20]Use Mean to find the mean of data:
Mean[data]Use Median to find the median:
Median[data]Use Max to find the maximum element:
Max[data]You can also find the Variance and the StandardDeviation:
Variance[data]StandardDeviation[data]If you want to figure out quantiles, you can use Quantile. The first argument is a set of data; the second is a number q between 0 and 1:
Quantile[data, 4 / 5]If you want to find out quartiles or percentiles, you can use Quantile with an argument of n/4 or n/100, respectively:
Quantile[data, 95 / 100]If you would like a list of the quartiles, use the Quartiles function:
Quartiles[data]