我做了这两个模型:
(model1 <- summary(lm(mpg ~ drat + wt + cyl, mtcars)))
Call:
lm(formula = mpg ~ drat + wt + cyl, data = mtcars)
Residuals:
Min 1Q Median 3Q Max
-4.2944 -1.5576 -0.4667 1.5678 6.1014
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 39.7677 6.8729 5.786 3.26e-06 ***
drat -0.0162 1.3231 -0.012 0.990317
wt -3.1947 0.8293 -3.852 0.000624 ***
cyl -1.5096 0.4464 -3.382 0.002142 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 2.613 on 28 degrees of freedom
Multiple R-squared: 0.8302, Adjusted R-squared: 0.812
F-statistic: 45.64 on 3 and 28 DF, p-value: 6.569e-11
(model2 <- summary(lm(mpg ~ wt + cyl + drat, mtcars)))
Call:
lm(formula = mpg ~ wt + cyl + drat, data = mtcars)
Residuals:
Min 1Q Median 3Q Max
-4.2944 -1.5576 -0.4667 1.5678 6.1014
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 39.7677 6.8729 5.786 3.26e-06 ***
wt -3.1947 0.8293 -3.852 0.000624 ***
cyl -1.5096 0.4464 -3.382 0.002142 **
drat -0.0162 1.3231 -0.012 0.990317
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 2.613 on 28 degrees of freedom
Multiple R-squared: 0.8302, Adjusted R-squared: 0.812
F-statistic: 45.64 on 3 and 28 DF, p-value: 6.569e-11
我的理解是 R 对mpg. 所以 in model1,drat应该是未调整wt的, 应该被调整drat并且cyl应该被调整drat和wt. 在model2,wt应该是未调整的,cyl应该为 调整wt并且drat应该为wt和调整cyl。
然而,每个模型中的系数似乎完全相同,这表明系数根本没有被调整。系数根本没有调整吗?