モデルの仮定が満たされない場合の対処法

R による線形回帰の推測

Jo Hardin

Professor, Pomona College

線形モデル

$$\huge{Y = \beta_0 + \beta_1 \cdot X + \epsilon}$$

$$\large{\text{where } \epsilon \sim N(0, \sigma_\epsilon)}$$

R による線形回帰の推測

説明変数の変換

$Y = \beta_0 + \beta_1 \cdot X + \beta_2 \cdot X^2 + \epsilon$, where $\epsilon \sim N(0, \sigma_\epsilon)$

$Y = \beta_0 + \beta_1 \cdot \ln(X) + \epsilon$, where $\epsilon \sim N(0, \sigma_\epsilon)$

$Y = \beta_0 + \beta_1 \cdot \sqrt{X} + \epsilon$, where $\epsilon \sim N(0, \sigma_\epsilon)$

R による線形回帰の推測

説明変数の二乗変換

ggplot(data=data_nonlinear, 
  aes(x=explanatory, y=response)) + 
     geom_point()

ggplot(data=data_nonlinear, 
  aes(x=explanatory^2, y=response))+ 
     geom_point()

R による線形回帰の推測

目的変数の変換

$Y^2 = \beta_0 + \beta_1 \cdot X + \epsilon$, where $\epsilon \sim N(0, \sigma_\epsilon)$

$\ln(Y) = \beta_0 + \beta_1 \cdot X + \epsilon$, where $\epsilon \sim N(0, \sigma_\epsilon)$

$\sqrt(Y) = \beta_0 + \beta_1 \cdot X + \epsilon$, where $\epsilon \sim N(0, \sigma_\epsilon)$

R による線形回帰の推測

自然対数変換

ggplot(data = data_nonnorm, 
  aes(x = explanatory, y = response)) + 
     geom_point()

ggplot(data = data_nonnorm, 
  aes(x = explanatory, y = log(response))) + 
     geom_point()

R による線形回帰の推測

練習しましょう!

R による線形回帰の推測

Preparing Video For Download...