6.2 Linear Regression in R-Programming
- x <- c(77,50,71,72,81,94,96,99,67)
- y <- c(82,66,78,34,47,85,99,99,68)
- fit <- lm(y~x)
- fit$coefficient
- OR summary(fit)
(Intercept) x
12.0623211 0.7771416
- y = 0.7771416x + 12.0623211
- Therefore when x is 85, y = 78.12
- y = 0.7771416(85) + 12.0623211