c:ms:2023:schedule:w10.lecture.note
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
c:ms:2023:schedule:w10.lecture.note [2023/05/08 01:52] – [R. output] hkimscil | c:ms:2023:schedule:w10.lecture.note [2024/05/13 08:54] (current) – [R code] hkimscil | ||
---|---|---|---|
Line 88: | Line 88: | ||
b <- lm.mod2$coefficients[2] | b <- lm.mod2$coefficients[2] | ||
a <- lm.mod2$coefficients[1] | a <- lm.mod2$coefficients[1] | ||
+ | |||
+ | b | ||
+ | a | ||
+ | |||
+ | # y추정치 y.hat = a + bx | ||
ggplot(data=df, | ggplot(data=df, | ||
Line 105: | Line 110: | ||
y.hat <- lm.mod2$fitted.values | y.hat <- lm.mod2$fitted.values | ||
+ | # 참고로 | ||
+ | # y.hat2 <- a + b*x | ||
+ | head(y.hat) | ||
+ | head(y.hat2) | ||
+ | |||
y.hat - mean(df$y) | y.hat - mean(df$y) | ||
explained <- y.hat - mean(df$y) | explained <- y.hat - mean(df$y) | ||
Line 675: | Line 685: | ||
====== R. Graph output ====== | ====== R. Graph output ====== | ||
- | {{: | + | {{: |
- | {{: | + | {{: |
- | {{: | + | {{: |
+ | {{: | ||
+ | |||
+ | |||
+ | {{: | ||
+ | {{: | ||
+ | {{: | ||
+ | {{: | ||
+ | |||
+ | ############################## | ||
+ | |||
+ | {{: | ||
- | {{: | ||
- | {{: | ||
- | {{: | ||
- | {{: |
c/ms/2023/schedule/w10.lecture.note.1683478331.txt.gz · Last modified: 2023/05/08 01:52 by hkimscil