我想在 R 中绘制一条简单的回归线。我已经输入了数据,但回归线似乎不正确。有人可以帮忙吗?
x <- c(10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120) y <- c(10, 18, 25, 29, 30, 28, 25, 22, 18, 15, 11, 8) df <- data.frame(x,y) plot(y,x) abline(lm(y ~ x))
plot regression r linear-regression lm
linear-regression ×1
lm ×1
plot ×1
r ×1
regression ×1