離散程度的度量

統計學入門

George Boorman

Curriculum Manager, DataCamp

什麼是離散程度?

車輛犯罪直方圖(離散程度大)

入室竊盜直方圖(離散程度小)

統計學入門

為何離散程度很重要?

  • 離散程度描述資料的變化幅度

 

  • T 恤通常約 $30

    • 可能落在 $10–200 之間
    • 買到 $30 的機率有多高?
  • 若 T 恤價位介於 $20–50

    • 這會影響找到 $30 的機率嗎?

牆上吊掛的 T 恤

1 Image credit: https://unsplash.com/@uyk
統計學入門

全距(Range)

 

${range} = maximum - minimum$

 

${range(Burglaries)} = 5,183 - 1,432$

${range(Burglaries)} = 3,751$

Borough Burglary
Tower Hamlets 5,183
Hackney 5,079
Barnet 5,067
... ...
Sutton 1,815
Bexley 1,583
Kingston upon Thames 1,432
統計學入門

變異數

中央紅線表示平均數的點圖

統計學入門

變異數

顯示 Westminster 到平均數距離的變異數示意圖

統計學入門

變異數

Borough Total Crime Mean Distance
Barking and Dagenham 37,939 47,672 -9,733
Barnet 52,421 47,672 4,749
Bexley 29,285 47,672 -18,387
Brent 55,465 47,672 7,793
Bromley 42,982 47,672 -4,690
Camden 54,806 47,672 7,134
... ... ... ...
Total 1,525,492 1,525,492 0
統計學入門

變異數

Borough Total Crime Mean Distance Squared Distance
Barking and Dagenham 37,939 47,672 -9,733 94,731,289
Barnet 52,421 47,672 4,749 22,553,001
Bexley 29,285 47,672 -18,387 338,081,769
Brent 55,465 47,672 7,793 60,730,849
Bromley 42,982 47,672 -4,690 21,996,100
Camden 54,806 47,672 7,134 50,893,956
... ... ... ... ...
Total 1,525,492 1,525,492 0 7,509,750,824
統計學入門

變異數

 

$${variance(total \ crime)} = \frac{7,509,750,824}{32}$$

$${variance(total \ crime)} = \ 234,679,713$$

統計學入門

標準差

${standard \ deviation(total \ crime)} = {\sqrt( variance(total \ crime))}$

${standard \ deviation(total \ crime)} = {\sqrt(234,679,713)}$

${standard \ deviation(total \ crime)} = 15,319.26$

  • 標準差越接近 0,資料越聚集在平均附近
統計學入門

直方圖中的標準差

直方圖中顯示離平均數 1 與 2 個標準差

統計學入門

四分位數

  • 四分位數:
    • 將資料分成四等份

 

Crime 0% 25% 50% 75% 100%
Burglary 1,432.00 2,681.75 3,416.50 4,392.00 5,183.00
Robbery 363.00 895.75 1,354.50 1,976.50 4,156.00
Theft 4,090.00 7,739.75 9,624.00 12,059.00 40,278.00
Vehicle Offenses 2,143.00 4,838.25 6,424.50 7,520.75 11,292.00
統計學入門

四分位數

  • 四分位數:
    • 將資料分成四等份

 

Crime 0% 25% 50% 75% 100%
Burglary 1,432.00 2,681.75 3,416.50 4,392.00 5,183.00
Robbery 363.00 895.75 1,354.50 1,976.50 4,156.00
Theft 4,090.00 7,739.75 9,624.00 12,059.00 40,278.00
Vehicle Offenses 2,143.00 4,838.25 6,424.50 7,520.75 11,292.00

 

  • 第二四分位(50%)=中位數
統計學入門

盒形圖

倫敦搶劫的盒形圖,標出中位數與第一、第三四分位

統計學入門

四分位距(IQR)

倫敦搶劫的盒形圖,標出四分位距

  • IQR 較不受極端值影響

          IQR = 第三四分位 − 第一四分位

                IQR = 1976.50 − 895.75

                       IQR = 1080.75

統計學入門

一起來練習吧!

統計學入門

Preparing Video For Download...