Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我运行我的qplot(data, x, y)并通过添加获得平滑线
qplot(data, x, y)
+ geom_smooth(method=lm)
你如何获得关于这条平滑线的数据?
您正在拟合线性模型,因此您可以在qplot调用之外拟合模型并查看拟合值、残差等。
qplot
fit <- lm(y ~ x, data) names(fit) summary(fit) fit$residuals fit$fitted.values
也许通过运行线性回归?
lm(y~x,data)