ポアソン回帰のプロット

R における Generalized Linear Models

Richard Erickson

Instructor

ポアソンでの geom_smooth の使いどき

  • 連続型の説明変数で最適
  • 例:用量が増えると、cm$^2$あたりのがん細胞数が増加
  • それ以外は boxplot などを使用
R における Generalized Linear Models

がん細胞の用量研究

  • データをシミュレーション
  • 用量反応
    • x:用量
    • y:cm$^2$あたりのがん細胞数
R における Generalized Linear Models

点を描く

ggplot(data = dat, aes(x = dose, y = cells)) +
    geom_point()

点の ggplot

R における Generalized Linear Models

ジッターを付ける

ggplot(data = dat, aes(x = dose, y = cells)) +
   geom_jitter(width = 0.05, height = 0.05)

ggplot2 によるジッター付き点の例

R における Generalized Linear Models

geom_smooth()

ggplot(data = dat, aes(x = dose, y = cells)) +
   geom_jitter(width = 0.05, height = 0.05)
   geom_smooth()

ジッター上の既定の geom_smooth() の例

R における Generalized Linear Models

geom_smooth() での GLM

ggplot(data = dat, aes(x = dose, y = cells)) +
   geom_jitter(width = 0.05, height = 0.05)
   geom_smooth(method = 'glm')

geom_smooth() と既定のGLM(LM)の例

R における Generalized Linear Models

geom_smooth() によるポアソンGLM

ggplot(data = dat, aes(x = dose, y = cells)) +
   geom_jitter(width = 0.05, height = 0.05) +
   geom_smooth(method = 'glm', method.args = list(family = 'poisson'))

ポアソン回帰プロットの例

R における Generalized Linear Models

手順の要約

  • 重ならない点を描画
  • ポアソンの傾向線を追加
  • 仕上げ(ここでは未実施)
R における Generalized Linear Models

Ayo berlatih!

R における Generalized Linear Models

Preparing Video For Download...