日誌

点双列相関係数の出し方

ピアソンの積率相関では,連続量と連続量の関係ですが,
点双列相関係数(point-biserial correlation)は
2値変数と連続量の関係の相関係数になるみたいです。

とはいっても,出てくる結果は基本的に同じみたい。
Stata13では,2つの平均値の効果量の所から算出できるようになっています。

ためしにやってみます。

sysuse auto

このデータセットでは,foreignが2値データになっています。

まずはピアソンの積率相関から

pwcorr foreign price mpg weight

               |  foreign    price      mpg   weight
  -------------+------------------------------------
     foreign |   1.0000
        price |   0.0487   1.0000
         mpg |   0.3934  -0.4686   1.0000
      weight |  -0.5928   0.5386  -0.8072   1.0000


次に点双列相関係数をそれぞれ出してみます。

esize twosample price, by(foreign) pbcorr

---------------------------------------------------------
         Effect Size |   Estimate     [95% Conf. Interval]
    --------------------+------------------------------------
   Point-Biserial r |  -.0487195    -.2693882    .1795464
---------------------------------------------------------


esize twosample mpg, by(foreign) pbcorr

---------------------------------------------------------
         Effect Size |   Estimate     [95% Conf. Interval]
    --------------------+------------------------------------
   Point-Biserial r |  -.3933974     -.555367   -.1821459
---------------------------------------------------------


esize twosample weight, by(foreign) pbcorr

---------------------------------------------------------
         Effect Size |   Estimate     [95% Conf. Interval]
     --------------------+------------------------------------
   Point-Biserial r |   .5928299     .4281699    .7051208
---------------------------------------------------------

符号が逆になっていますが,数値は一致しています。