Phi相關係數

統計學裡,「Phi相關係數」(英語:Phi coefficient)(符號表示為: ϕ {\displaystyle \phi } r ϕ {\displaystyle r_{\phi }} )是測量兩個二元變數(英語:binary variables or dichotomous variables)之間相關性的工具,由卡爾·皮爾森所發明 [1]。他也發明了與Phi相關係數有密切關聯的皮爾森卡方檢定(英語:Pearson's chi-squared test。一般所稱的卡方檢定,若未明指種類,即指此),以及發明了測量兩個連續變數之間相關程度的皮爾森積差相關係數(英語:Pearson's r。一般所稱的相關係數,若未明指種類,即指此)。

Phi 相關係數機器學習的領域又稱為Matthews相關係數英语Matthews correlation coefficient

定義

首先將兩個變數排成2×2列聯表英语contingency table,注意 1 和 0 的位置必須如同下表,若只變動 X 或只變動 Y 的 0/1 位置,計算出來的Phi相關係數會正負號相反。Phi相關係數的基本概念是:兩個二元變數的觀察值若大多落在2×2列聯表的「主對角線」(英語:diagonal:左上-右下線)欄位,亦即若觀察值大多為 ( X , Y ) = ( 1 , 1 ) , ( 0 , 0 ) {\displaystyle (X,Y)=(1,1),(0,0)} 這兩種組合,則這兩個變數呈正相關。反之,若兩個二元變數的觀察值大多落在「非對角線」(英語:off-diagonal:主對角線以外的位置)欄位,對應於2×2列聯表,亦即若觀察值大多為 ( X , Y ) = ( 0 , 1 ) , ( 1 , 0 ) {\displaystyle (X,Y)=(0,1),(1,0)} 這兩種組合,則這兩個變數呈負相關。例如我們從兩個隨機二元變數(X, Y)抽樣得出這樣的2×2列聯表:

y = 1 y = 0 總計
x = 1 n 11 {\displaystyle n_{11}} n 10 {\displaystyle n_{10}} n 1 {\displaystyle n_{1\bullet }}
x = 0 n 01 {\displaystyle n_{01}} n 00 {\displaystyle n_{00}} n 0 {\displaystyle n_{0\bullet }}
總計 n 1 {\displaystyle n_{\bullet 1}} n 0 {\displaystyle n_{\bullet 0}} n {\displaystyle n}

其中 n11, n10, n01, n00都是非負數的欄位計次值,它們加總為 n {\displaystyle n} ,亦即觀察值的個數。由上面的表格可以得出 X 和 Y 的 Phi相關係數如下:

ϕ = n 11 n 00 n 10 n 01 n 1 n 0 n 0 n 1 {\displaystyle \phi ={\frac {n_{11}n_{00}-n_{10}n_{01}}{\sqrt {n_{1\bullet }n_{0\bullet }n_{\bullet 0}n_{\bullet 1}}}}}

實例

研究者欲觀察性別與慣用手的相關性。虛無假設是:性別與慣用手無相關性。觀察對象是隨機抽樣出來的個人,身上有兩個二元變數(性別 X ,慣用手 Y),X 有兩種結果值(男=1/女=0),Y也有兩種結果值(右撇子=1/左撇子=0)。

觀察兩個二元變數的相關性可以使用Phi相關係數。假設簡單隨機抽樣100人,得出如下的2×2列聯表:

男=1 女=0 總計
右=1 43 44 87
左=0 9 4 13
總計 52 48 100

本例的Phi相關係數:

ϕ = ( 43 × 4 44 × 9 ) 87 × 13 × 48 × 52 = 0.133 {\displaystyle \phi ={(43\times 4-44\times 9) \over {\sqrt {87\times 13\times 48\times 52}}}=-0.133}

本處暫不介紹Phi相關係數的顯著性檢定,僅簡介其詮釋:假設−0.133的相關係數檢定為顯著,在本例對變數 1/0 的指定下,代表身為男性與身為右撇子有輕微的負相關,也就是男性右撇子的比例略低於女性右撇子的比例;或者反過來說,男性左撇子的比例略高於女性左撇子的比例。

與Pearson相關係數的異同

「Phi相關係數」與「Pearson相關係數」在詮釋上非常類似;事實上,使用Pearson相關係數來計算兩個二元變數(各輸入成1/0)之間的相關性時,就會得出Phi相關係數[2]

儘管Phi相關係數只是把Pearson相關係數簡化為兩個二元變數的情況,但詮釋這兩種相關係數時仍必須注意其差別。Pearson相關係數的值從−1 到 +1,±1 是其兩個端點,指出完全正相關與完全負相關,0則是無相關。Phi相關係數的極值則受到兩個變數各別的二元結果比例所影響,當兩個變數的二元結果都是50:50時,Phi值才會從−1 到 +1。[3]

與Pearson卡方統計值的關係

一個2×2列聯表英语contingency table卡方統計值 χ 2 {\displaystyle \chi ^{2}} ),與Phi相關係數呈下述關係[4]

ϕ 2 = χ 2 n {\displaystyle \phi ^{2}={\frac {\chi ^{2}}{n}}}
其中 n {\displaystyle n} 是觀察值的個數。

亦參見

  • Phi相關係數的網頁版計算器(页面存档备份,存于互联网档案馆)(還有許多的基礎統計教材和計算器)。
  • 列聯表英语Contingency table
  • Matthews相關係數英语Matthews correlation coefficient
  • Cramér's V英语Cramér's V (statistics):類別變數間相關性的另一個測量法。
  • Polychoric相關英语Polychoric correlation:當兩個連續變項被人為地改成二分變項時,求其相關性。其中一種是「四分相關英语Tetrachoric correlation」。

註腳

  1. ^ Cramer, H. 1946. Mathematical Methods of Statistics. Princeton: Princeton University Press, p282 (second paragraph). ISBN 0-691-08004-6
  2. ^ Guilford, J. (1936). Psychometric Methods. New York: McGraw–Hill Book Company, Inc.
  3. ^ 詳見:Davenport, E., & El-Sanhury, N. (1991). Phi/Phimax: Review and Synthesis. Educational and Psychological Measurement, 51, 821–828.
  4. ^ Everitt B.S. (2002) The Cambridge Dictionary of Statistics, CUP. ISBN 0-521-81099-X
描述统计学
分布形态英语Shape of the distribution
  • 次數英语Count data
  • · 列聯表英语Contingency table
推論統計學
假說檢定
样本量英语Sample size
常规估计
相關及
迴歸分析
相关性
  • 非参数回归模型英语Nonparametric regression
  • 半参数回归模型英语Semiparametric regression
  • 邏輯斯諦迴歸
统计图形
其他
  • 分类分类
  • 主题主题
  • 共享资源页面共享资源
  • 专题 专题