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/07 16:55] – [R. Graph output] hkimscil | c:ms:2023:schedule:w10.lecture.note [2024/05/12 23: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 683: | Line 693: | ||
| {{: | {{: | ||
| {{: | {{: | ||
| - | {{: | ||
| - | |||
| {{: | {{: | ||
| {{: | {{: | ||
| + | ############################## | ||
| + | |||
| + | {{: | ||
c/ms/2023/schedule/w10.lecture.note.1683478506.txt.gz · Last modified: by hkimscil
