1. summary
summary(fit_all)
Call:
lm(formula = A$BRAY ~ A$DIST)
Residuals:
Min 1Q Median 3Q Max
-0.4751 -0.1584 0.0202 0.2031 0.3990
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 4.751e-01 2.250e-02 21.11 <2e-16 ***
A$DIST 5.938e-04 4.208e-05 14.11 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.2347 on 250 degrees of freedom
Multiple R-squared: 0.4433, Adjusted R-squared: 0.4411
F-statistic: 199.1 on 1 and 250 DF, p-value: < 2.2e-16
T检验是检验解释变量的显著性的; R-squared是查看方程拟合程度的; F检验是检验方程整体显著性的;
2. coef(lm.fit) 直接出变量的系数。向量形式,用[ ]指示取哪些系数
coef(fit_all)[1]
(Intercept)
0.4750591
> coef(fit_all)[2]
A$DIST
0.0005937671
3. summary(lm.fit)$coefficients[,'Pr(>|t|)'] 取P值。
summary(fit_all)$coefficients[,'Pr(>|t|)']
(Intercept) A$DIST
1.705975e-57 1.202421e-33
网友评论