multiple_regression_exercise
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
multiple_regression_exercise [2021/11/25 20:43] – [개인과제 2] hkimscil | multiple_regression_exercise [2023/12/10 21:41] (current) – old revision restored (2022/11/02 23:41) hkimscil | ||
---|---|---|---|
Line 151: | Line 151: | ||
< | < | ||
+ | # install.packages(" | ||
+ | library(ISLR) | ||
+ | |||
head(Carseats) | head(Carseats) | ||
str(Carseats) | str(Carseats) | ||
Line 389: | Line 392: | ||
아래는 설명을 하지 않고 코드만 적었었는데 이는 아래 둘의 model이 동일한 것임을 보여주기 위한 것입니다. | 아래는 설명을 하지 않고 코드만 적었었는데 이는 아래 둘의 model이 동일한 것임을 보여주기 위한 것입니다. | ||
< | < | ||
- | lm.2 <- lm(Sales ~ Advertising: | + | lm.2 <- lm(Sales ~ Advertising: |
- | lm.1 <- lm(Sales ~ Advertising + Advertising: | + | lm.1 <- lm(Sales ~ Advertising + Advertising: |
</ | </ | ||
Line 469: | Line 472: | ||
Coefficients: | Coefficients: | ||
Estimate Std. Error t value Pr(> | Estimate Std. Error t value Pr(> | ||
- | (Intercept) | + | (Intercept) |
- | ShelveLocGood | + | ShelveLocGood |
- | ShelveLocMedium | + | ShelveLocMedium |
- | ShelveLocBad: | + | ShelveLocBad: |
- | ShelveLocGood: | + | ShelveLocGood: |
- | ShelveLocMedium: | + | ShelveLocMedium: |
--- | --- | ||
Signif. codes: | Signif. codes: | ||
Line 519: | Line 522: | ||
그러니 이렇게 보아도 마찬가지임을 알 수 있죠? | 그러니 이렇게 보아도 마찬가지임을 알 수 있죠? | ||
- | ====== | + | ====== |
{{: | {{: | ||
< | < | ||
Line 754: | Line 757: | ||
library(ppcor) | library(ppcor) | ||
attach(Carseats) | attach(Carseats) | ||
- | spcor.Price <- spcor.test(Price, | + | spcor.Price <- spcor.test(Sales, Price, CompPrice) |
- | spcor.CompPrice <- spcor.test(CompPrice, | + | spcor.CompPrice <- spcor.test(Sales, CompPrice, Price) |
spcor.Price | spcor.Price | ||
Line 776: | Line 779: | ||
# 이 둘을 더해봅니다. | # 이 둘을 더해봅니다. | ||
- | # 이 값은 0.3648334 | + | # 이 값은 0.5135791 |
b + d | b + d | ||
Line 799: | Line 802: | ||
</ | </ | ||
+ | --> | ||
+ | [[: | ||
====== Making Questionnaire ====== | ====== Making Questionnaire ====== | ||
[[https:// | [[https:// |
multiple_regression_exercise.1637840600.txt.gz · Last modified: 2021/11/25 20:43 by hkimscil