R
cor1<-cor(data3_1[,-1])
round(cor1,digits = 3)
x2 x3 x4 x5 x6 x7 x8 x9 y
x2 1.000 0.305 0.646 0.470 0.460 0.615 0.144 0.013 0.512
x3 0.305 1.000 0.584 0.736 0.539 0.777 -0.178 -0.325 0.781
x4 0.646 0.584 1.000 0.488 0.381 0.651 0.070 -0.110 0.494
x5 0.470 0.736 0.488 1.000 0.747 0.814 -0.104 -0.374 0.941
x6 0.460 0.539 0.381 0.747 1.000 0.780 -0.018 -0.499 0.785
x7 0.615 0.777 0.651 0.814 0.780 1.000 -0.020 -0.262 0.873
x8 0.144 -0.178 0.070 -0.104 -0.018 -0.020 1.000 -0.130 -0.130
x9 0.013 -0.325 -0.110 -0.374 -0.499 -0.262 -0.130 1.000 -0.361
y 0.512 0.781 0.494 0.941 0.785 0.873 -0.130 -0.361 1.000
R
lm3<-update(lm1,.~.-x9)
lm3
Call:
lm(formula = y ~ x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8, data = data3_1)
Coefficients:
(Intercept) x1 x2 x3 x4 x5 x6
947.138614 1.314540 1.669009 2.136855 -0.021107 1.679586 0.008060
x7 x8
0.004812 -22.326103
R
summary(lm3)
Call:
lm(formula = y ~ x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8, data = data3_1)
Residuals:
Min 1Q Median 3Q Max
-932.95 -188.17 7.63 242.43 448.20
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 9.471e+02 3.414e+03 0.277 0.784035
x1 1.315e+00 1.038e-01 12.659 1.41e-11 ***
x2 1.669e+00 2.894e-01 5.768 8.40e-06 ***
x3 2.137e+00 4.946e-01 4.321 0.000276 ***
x4 -2.111e-02 4.647e-01 -0.045 0.964181
x5 1.680e+00 2.094e-01 8.022 5.64e-08 ***
x6 8.060e-03 1.139e-02 0.708 0.486471
x7 4.812e-03 9.922e-03 0.485 0.632473
x8 -2.233e+01 2.990e+01 -0.747 0.463213
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 381.5 on 22 degrees of freedom
Multiple R-squared: 0.9922, Adjusted R-squared: 0.9894
F-statistic: 350.4 on 8 and 22 DF, p-value: < 2.2e-16
多元线性回归模型的基本假设:解释变量是确定性变量,自变量列之间不相关,样本量的个数大于解释变量的个数。随机误差项具有0均值和等方差。正态分布的假定条件为e~N(0,d^2),相互独立。
拒绝H0,认为在显著性