User Tools

Site Tools


c:ms:2023:schedule:w10.lecture.note

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
c:ms:2023:schedule:w10.lecture.note [2023/05/08 01:56] – [R. Graph output] hkimscilc: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
 +
 +
 +# y추정치 y.hat = a + bx 
  
 ggplot(data=df, aes(x,y)) + ggplot(data=df, aes(x,y)) +
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)
c/ms/2023/schedule/w10.lecture.note.txt · Last modified: 2024/05/13 08:54 by hkimscil

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki