此为 Mathematica 7 文档,内容基于更早版本的 Wolfram 语言
查看最新文档(版本11.2)
Mathematica HowTo
How to | Calculate Basic Descriptive Statistics
Mathematica 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):
In[1]:=
Click for copyable input
Out[1]=
Use Mean to find the mean of data:
In[2]:=
Click for copyable input
Out[2]=
Use Median to find the median:
In[3]:=
Click for copyable input
Out[3]=
Use Max to find the maximum element:
In[4]:=
Click for copyable input
Out[4]=
You can also find the Variance and the StandardDeviation:
In[5]:=
Click for copyable input
Out[5]=
In[6]:=
Click for copyable input
Out[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.
In[7]:=
Click for copyable input
Out[7]=
If you want to find out quartiles or percentiles, you can use Quantile with an argument of n/4 or n/100, respectively:
In[8]:=
Click for copyable input
Out[8]=
If you would like a list of the quartiles, use the Quartiles function:
In[9]:=
Click for copyable input
Out[9]=