残差プロット

残差プロットテンプレート。回帰モデルの妥当性を評価。

残差回帰モデル診断
残差プロット

R Code (ggplot2)

library(ggplot2)

# ---- Residual Plot ----
# あなたのデータを入力してください
df <- data.frame(
  x = c(),
  y = c()
)

ggplot(df, aes(x = x, y = y)) +
  geom_point(size = 2) +
  geom_line() +
  scale_x_continuous(name = "Fitted values", limits = c(0, 100)) +
  scale_y_continuous(name = "Residuals", limits = c(-30, 30)) +
  labs(title = "Residual Plot") +
  theme_bw(base_size = 14) +
  theme(plot.title = element_text(face = "bold", hjust = 0.5))