Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥

R を用いた分析(補講) (1) — 重回帰分析 / Analysis using R (su...

R を用いた分析(補講) (1) — 重回帰分析 / Analysis using R (supplementary) (1) - Multiple regression analysis

早稲田大学大学院経営管理研究科「企業データ分析」2024 冬のオンデマンド教材 第11回で使用したスライドです。

Kenji Saito

November 30, 2024
Tweet

More Decks by Kenji Saito

Other Decks in Technology

Transcript

  1. Boxes and whiskers — generated by Stable Diffusion XL v1.0

    2024 11 R ( ) (1) — (WBS) 2024 11 R ( ) (1) — — 2024-11 – p.1/11
  2. ( 20 ) 1 • 2 R • 3 •

    4 • 5 • 6 ( ) • 7 (1) • 8 (2) • 9 R ( ) (1) — Welch • 10 R ( ) (2) — χ2 • 11 R ( ) (1) — • 12 R ( ) (2) — 13 GPT-4 14 GPT-4 15 ( ) LaTeX Overleaf 8 (12/16 ) / (2 ) OK / 2024 11 R ( ) (1) — — 2024-11 – p.3/11
  3. ( ) R ( ) = a + b1 ×

    + b2 × + e 2024 11 R ( ) (1) — — 2024-11 – p.4/11
  4. (1/2) “ .txt” g <- read.table(" .txt", header=T) # g

    # boxplot(g) # plot(g) # cor.test(g$ , g$ ) 2024 11 R ( ) (1) — — 2024-11 – p.5/11
  5. ( ) ፉ㌟㛗 ∗㌟㛗 ẕ㌟㛗 150 155 160 165 170

    175 : 158.37cm : 169.02cm : 155.2cm 2024 11 R ( ) (1) — — 2024-11 – p.6/11
  6. ( ) ፉ㌟㛗 160 165 170 175 152 156 160

    164 160 165 170 175 ∗㌟㛗 152 156 160 164 150 154 158 150 154 158 ẕ㌟㛗 . . . . . . 2024 11 R ( ) (1) — — 2024-11 – p.7/11
  7. (2/2) m <- lm(g$ ~ g$ + g$ ) #

    + m # summary(m) # “Multiple R-squared” “Adjusted R-squared” 30% 2024 11 R ( ) (1) — — 2024-11 – p.8/11
  8. ( pp.291–298) R2 = 1 − SSresidual SStotal = 1

    − n i=1 (yi − ˆ yi)2 n i=1 (yi − ¯ y)2 R∗2 = 1 − SSresidual n−k−1 SStotal n−1 = 1 − (1 − R2)(n − 1) n − k − 1 ( k ) 2024 11 R ( ) (1) — — 2024-11 – p.9/11
  9. (b1 b2 ) sg <- scale(g) # sg <- data.frame(sg)

    # m <- lm(sg$ ~ sg$ + sg$ ) # summary(m) # . . . : 3.951e-01 : 3.436e-01 ^^; ^^; 2024 11 R ( ) (1) — — 2024-11 – p.10/11