Advertisement
HolyC0w

lab8

Apr 11th, 2023
1,602
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 0.29 KB | None | 0 0
  1. x <- c(1, 2, 3, 4, 5)
  2. y <- c(3, 4, 2, 4, 5)
  3. relation <- lm(y ~ x)
  4. print(summary(relation))
  5. sqrt(mean(relation$residuals^2))
  6. png(file = "lab8.png")
  7.  
  8. plot(y, x,
  9.     col = "blue", pch = 16, cex = 1.3, abline(lm(x ~ y)),
  10.     main = "Linear Regression", xlab = "x", ylab = "y"
  11. )
  12. dev.off()
  13.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement