ロジスティック回帰モデル

R で学ぶ統計面接対策

Zuzanna Chmielewska

Actuary

ロジスティック回帰の応用

スパム

金融不正

R で学ぶ統計面接対策

二値データ点

R で学ぶ統計面接対策

二値データ点

R で学ぶ統計面接対策

ロジスティック関数

$$f(x) = \frac{1}{1+e^{-x}} $$

R で学ぶ統計面接対策

ロジスティック関数

$$f(x) = \frac{1}{1+e^{-x}} \in (0,1)$$

R で学ぶ統計面接対策

ロジスティック回帰モデル

確率の予測: $$ p_i = P(y_i=1) = \frac{1}{1+e^{-(\beta_0+\beta_1 \cdot x_{i1}+...+\beta_p \cdot x_{ip})}} $$

ロジットの予測: $$ l_i = ln(\frac{p_i}{1-p_i}) = \beta_0+\beta_1 \cdot x_{i1}+...+\beta_p \cdot x_{ip}$$

R で学ぶ統計面接対策

二値データの予測

R で学ぶ統計面接対策

二値データの予測

R で学ぶ統計面接対策

Rでのロジスティック回帰

model <- glm(y ~ x, data = df, family = "binomial")
R で学ぶ統計面接対策

Rでのロジスティック回帰

model <- glm(y ~ x, data = df, family = "binomial")
predict(model, newdata = new_df, type = "response")
R で学ぶ統計面接対策

まとめ

  • ロジスティック回帰モデル
  • 二値応答変数の予測
  • Rのglm()でのロジスティック回帰
R で学ぶ統計面接対策

練習に進みましょう!

R で学ぶ統計面接対策

Preparing Video For Download...