ロジスティック回帰の出力を理解する

R における Generalized Linear Models

Richard Erickson

Instructor

ロジスティック回帰の結果を伝えるには?

  • 線形回帰は簡単:

    • 切片を加算する
    • 傾きを乗算する
  • ポアソン回帰:

    • 指数変換が必要
    • 変換後は線形回帰と同様
  • ロジスティック回帰は?
R における Generalized Linear Models

オッズ比

  • ポアソンの指数変換ほど単純ではない
  • 2事象の相対的なオッズを比較するために使用される
R における Generalized Linear Models

オッズ比の例

  • 不公平なコイン:
    • 表と裏を比較する
    • 表が裏の3倍出る
    • 3対1のオッズ
    • オッズ比 3.0
  • スポーツ・ギャンブルでよく使われる
  • 医学研究でも活用
R における Generalized Linear Models

オッズ比のロジスティック導出

対数オッズ(「ロジット」):

$\phi(x) = \text{ln}(\frac{p(x)}{1 - p(x)}) = \beta_0 + \beta_1 x$

オッズ、指数変換($e^{x}$):

$\frac{p(x)}{1 - p(x)} = e^{\beta_0 + \beta_1x}$

R における Generalized Linear Models

連続変数のオッズ比

連続変数のオッズ比(OR):

$\text{OR} = \frac{e^{\beta_0 + \beta_1(x +1)}}{e^{\beta_0 + \beta_1x}} = e^{\beta_1}$

R における Generalized Linear Models

解釈

OR の値:

  • OR = 1: 係数に効果なし
  • OR < 1: 係数がオッズを減少させる
  • OR > 1: 係数がオッズを増加させる
R における Generalized Linear Models

がんの例

非喫煙者 vs 喫煙者(男性)(Pesch et al. 2012)

  • OR: 103.5(95% CI 74.8–143.2)
  • 喫煙男性の発がんオッズは100倍超!
  • 医学文献ではp値よりも95%信頼区間が多用される
  • p値離れの広まる傾向
R における Generalized Linear Models

GLM からの抽出

glm_out <- glm(y ~ x, family = 'binomial')

coef(glm_out)

exp(coef(glm_out))

confint(glm_out)

exp(confint(glm_out))
R における Generalized Linear Models

Tidyverse

library(broom)

glm_out <- glm(y ~ x, family = 'binomial')

tidy(glm_out, exponentiate = TRUE, conf.int= TRUE)
R における Generalized Linear Models

練習しましょう!

R における Generalized Linear Models

Preparing Video For Download...