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):
Copy to clipboard.
In[1]:=1
✖
https://wolfram.com/xid/0cdy7dcu7i49j9k4l1jwhim9wvolc3p-nyxrnp
Direct link to example
Out[1]=1
Use Mean to find the mean of data:
Copy to clipboard.
In[2]:=2
✖
https://wolfram.com/xid/0cdy7dcu7i49j9k4l1jwhim9wvolc3p-g3cx29
Direct link to example
Out[2]=2
Use Median to find the median:
Copy to clipboard.
In[3]:=3
✖
https://wolfram.com/xid/0cdy7dcu7i49j9k4l1jwhim9wvolc3p-xemwab
Direct link to example
Out[3]=3
Use Max to find the maximum element:
Copy to clipboard.
In[4]:=4
✖
https://wolfram.com/xid/0cdy7dcu7i49j9k4l1jwhim9wvolc3p-eocwk7
Direct link to example
Out[4]=4
You can also find the Variance and the StandardDeviation:
Copy to clipboard.
In[5]:=5
✖
https://wolfram.com/xid/0cdy7dcu7i49j9k4l1jwhim9wvolc3p-ghfdt7
Direct link to example
Out[5]=5
Copy to clipboard.
In[6]:=6
✖
https://wolfram.com/xid/0cdy7dcu7i49j9k4l1jwhim9wvolc3p-ka9ovc
Direct link to example
Out[6]=6
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:
Copy to clipboard.
In[7]:=7
✖
https://wolfram.com/xid/0cdy7dcu7i49j9k4l1jwhim9wvolc3p-2p1mjt
Direct link to example
Out[7]=7
If you want to find out quartiles or percentiles, you can use Quantile with an argument of n/4 or n/100, respectively:
Copy to clipboard.
In[8]:=8
✖
https://wolfram.com/xid/0cdy7dcu7i49j9k4l1jwhim9wvolc3p-rirnlz
Direct link to example
Out[8]=8
If you would like a list of the quartiles, use the Quartiles function:
Copy to clipboard.
In[9]:=9
✖
https://wolfram.com/xid/0cdy7dcu7i49j9k4l1jwhim9wvolc3p-vkausr
Direct link to example
Out[9]=9