
上QQ阅读APP看本书,新人免费读10天
设备和账号都新为新人
1.4 汇总统计量
下式中,x=[x1,…,xn]T是包含n个数字的列向量。例如,对于我们的nutri数据,向量x可以表示226(n=226)个人的身高。
x的样本均值用表示,是数据值的平均值:

例如,对数据nutri使用mean方法,可以得到:

x的p样本分位数(0<p<1)是指这样的数值x,使得样本中小于或等于x的数据比例至少为p,而大于或等于x的数据比例至少为1-p。样本中位数就是0.5样本分位数。p样本分位数也称为100×p百分位数。25、50、75样本百分位数称为数据的第一、第二、第三四分位数。对于数据nutri,它们的计算方法如下:

样本均值和中位数提供了数据的位置信息,而样本分位数(如0.1和0.9分位数)之间的距离则提供了数据的分散(分布)指示。衡量数据分散性的其他指标有样本范围(maxixi-minixi)和样本方差:

为样本标准差。对于nutri数据,height的范围(单位cm)为

height的方差(单位cm2)为:

该特征的标准差可以通过以下方法获得:

1.3节介绍了定性特征汇总的describe方法,通过最常用的计数和不重复元素的数量进行汇总。当应用于定量特征时,它返回的则是最小值、最大值、均值和3个四分位数。例如,nutri数据中height特征具有如下统计汇总结果:
