我正在寻找B1(newx)
线性模型系数的值,而不是名称。我只想要 0.5 的值。我不想要“newx”这个名字。
newx <- c(0.5,1.5.2.5)
newy <- c(2,3,4)
out <- lm(newy ~ newx)
out
好像:
Call:
lm(formula = newy ~ newx)
Coefficients:
(Intercept) newx
1.5 1.0
我到了这里。但现在我被困住了。
out$coefficients["newx"]
newx
1.0