我学会了在我的 R 脚本中使用 lm 获得与某些点的线性拟合。所以,我这样做了(效果很好),并打印了合身:
lm(formula = y2 ~ x2)
Residuals:
1 2 3 4
5.000e+00 -1.000e+01 5.000e+00 7.327e-15
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 70.000 17.958 3.898 0.05996 .
x2 85.000 3.873 21.947 0.00207 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 8.66 on 2 degrees of freedom
Multiple R-squared: 0.9959, Adjusted R-squared: 0.9938
F-statistic: 481.7 on 1 and 2 DF, p-value: 0.00207
我正在尝试确定判断这种合身程度的最佳方法。我需要将此拟合与其他一些拟合(使用lm()
函数也是线性的)进行比较。从这个总结中得到什么价值是判断这种拟合有多好的最好方法?我正在考虑使用残差标准误差。有什么建议么。另外,如何从 fit 变量中提取该值?