y | x1 | x2 | x3 |
---|---|---|---|
80 | 2.0 | 25 | 2.5 |
100 | 1.0 | 30 | 2.0 |
110 | 1.0 | 40 | 5.0 |
120 | 2.0 | 45 | 4.0 |
90 | 1.2 | 30 | 3.0 |
85 | 1.5 | 20 | 1.5 |
70 | 1.5 | 30 | 3.5 |
105 | 2.0 | 60 | 5.0 |
95 | 2.5 | 50 | 5.5 |
115 | 2.0 | 60 | 6.0 |
Aula 34
Considere os seguintes dados:
y | x1 | x2 | x3 |
---|---|---|---|
80 | 2.0 | 25 | 2.5 |
100 | 1.0 | 30 | 2.0 |
110 | 1.0 | 40 | 5.0 |
120 | 2.0 | 45 | 4.0 |
90 | 1.2 | 30 | 3.0 |
85 | 1.5 | 20 | 1.5 |
70 | 1.5 | 30 | 3.5 |
105 | 2.0 | 60 | 5.0 |
95 | 2.5 | 50 | 5.5 |
115 | 2.0 | 60 | 6.0 |
Call:
lm(formula = y ~ x1 + x2 + x3, data = df)
Residuals:
Min 1Q Median 3Q Max
-17.7432 -2.5914 0.7333 2.7050 19.2940
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 77.4325 15.1157 5.123 0.00217 **
x1 -11.3779 9.7588 -1.166 0.28790
x2 1.3758 0.7127 1.930 0.10179
x3 -3.9704 6.3465 -0.626 0.55461
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 12.52 on 6 degrees of freedom
Multiple R-squared: 0.5927, Adjusted R-squared: 0.3891
F-statistic: 2.91 on 3 and 6 DF, p-value: 0.123
\[ \hat{Y}_i = 77.4325 -11.3779 X_{1i} + 1.3758 X_{2i} -3.9704 X_{3i} \]
Call:
lm(formula = x1 ~ x2 + x3, data = df)
Residuals:
Min 1Q Median 3Q Max
-0.68490 -0.24226 -0.03185 0.20828 0.62479
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.934418 0.466909 2.001 0.0855 .
x2 0.019211 0.026631 0.721 0.4941
x3 -0.003594 0.245798 -0.015 0.9887
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.485 on 7 degrees of freedom
Multiple R-squared: 0.2844, Adjusted R-squared: 0.07997
F-statistic: 1.391 on 2 and 7 DF, p-value: 0.31
\[ VIF = \frac{1}{1-0.2844} =1.3975 < 10 \]
Call:
lm(formula = x2 ~ x1 + x3, data = df)
Residuals:
Min 1Q Median 3Q Max
-6.0503 -5.1909 -0.7711 3.1076 10.4620
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 3.378 7.914 0.427 0.68228
x1 3.602 4.993 0.721 0.49406
x3 7.791 1.630 4.781 0.00201 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 6.641 on 7 degrees of freedom
Multiple R-squared: 0.8322, Adjusted R-squared: 0.7843
F-statistic: 17.36 on 2 and 7 DF, p-value: 0.001934
\[ VIF = \frac{1}{1-0.8322} =5.9604 < 10 \]
Call:
lm(formula = x3 ~ x1 + x2, data = df)
Residuals:
Min 1Q Median 3Q Max
-0.92137 -0.42259 0.07937 0.47200 1.09605
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.017873 0.900193 -0.020 0.98471
x1 -0.008499 0.581181 -0.015 0.98874
x2 0.098258 0.020552 4.781 0.00201 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.7458 on 7 degrees of freedom
Multiple R-squared: 0.8198, Adjusted R-squared: 0.7683
F-statistic: 15.92 on 2 and 7 DF, p-value: 0.002486
\[ VIF = \frac{1}{1-0.8198} =5.5481 < 10 \]
Logo, não há fundamento para suspeitar de multicolinearidade
Considere os dados em ANSCOMBE.DTA
para este exercício.
variables | N | Mean | StdDev | Min | Max |
---|---|---|---|---|---|
x1 | 11 | 9.000000 | 3.316625 | 4.00 | 14.00 |
x2 | 11 | 9.000000 | 3.316625 | 4.00 | 14.00 |
x3 | 11 | 9.000000 | 3.316625 | 4.00 | 14.00 |
x4 | 11 | 9.000000 | 3.316625 | 8.00 | 19.00 |
y1 | 11 | 7.500909 | 2.031568 | 4.26 | 10.84 |
y2 | 11 | 7.500909 | 2.031657 | 3.10 | 9.26 |
y3 | 11 | 7.500000 | 2.030424 | 5.39 | 12.74 |
y4 | 11 | 7.500909 | 2.030578 | 5.25 | 12.50 |
Call:
lm(formula = y1 ~ x1, data = df)
Residuals:
Min 1Q Median 3Q Max
-1.92127 -0.45577 -0.04136 0.70941 1.83882
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 3.0001 1.1247 2.667 0.02573 *
x1 0.5001 0.1179 4.241 0.00217 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.237 on 9 degrees of freedom
Multiple R-squared: 0.6665, Adjusted R-squared: 0.6295
F-statistic: 17.99 on 1 and 9 DF, p-value: 0.00217
Call:
lm(formula = y2 ~ x2, data = df)
Residuals:
Min 1Q Median 3Q Max
-1.9009 -0.7609 0.1291 0.9491 1.2691
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 3.001 1.125 2.667 0.02576 *
x2 0.500 0.118 4.239 0.00218 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.237 on 9 degrees of freedom
Multiple R-squared: 0.6662, Adjusted R-squared: 0.6292
F-statistic: 17.97 on 1 and 9 DF, p-value: 0.002179
Call:
lm(formula = y3 ~ x3, data = df)
Residuals:
Min 1Q Median 3Q Max
-1.1586 -0.6146 -0.2303 0.1540 3.2411
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 3.0025 1.1245 2.670 0.02562 *
x3 0.4997 0.1179 4.239 0.00218 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.236 on 9 degrees of freedom
Multiple R-squared: 0.6663, Adjusted R-squared: 0.6292
F-statistic: 17.97 on 1 and 9 DF, p-value: 0.002176
Call:
lm(formula = y4 ~ x4, data = df)
Residuals:
Min 1Q Median 3Q Max
-1.751 -0.831 0.000 0.809 1.839
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 3.0017 1.1239 2.671 0.02559 *
x4 0.4999 0.1178 4.243 0.00216 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.236 on 9 degrees of freedom
Multiple R-squared: 0.6667, Adjusted R-squared: 0.6297
F-statistic: 18 on 1 and 9 DF, p-value: 0.002165
Call:
lm(formula = y2 ~ x2 + I(x2^2), data = df)
Residuals:
Min 1Q Median 3Q Max
-0.0013286 -0.0011888 -0.0006296 0.0008744 0.0023776
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -5.9957353 0.0043300 -1385 <2e-16 ***
x2 2.7808394 0.0010401 2674 <2e-16 ***
I(x2^2) -0.1267133 0.0000571 -2219 <2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.001672 on 8 degrees of freedom
Multiple R-squared: 1, Adjusted R-squared: 1
F-statistic: 7.378e+06 on 2 and 8 DF, p-value: < 2.2e-16
Call:
lm(formula = y3 ~ x3, data = subset(df, x3 < 10))
Residuals:
1 2 3 4 5 6
0.003143 -0.001429 0.002286 0.001429 -0.002286 -0.003143
attr(,"format.stata")
[1] "%9.0g"
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 4.0102855 0.0047033 852.6 1.14e-11 ***
x3 0.3445715 0.0006998 492.4 1.02e-10 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.002928 on 4 degrees of freedom
Multiple R-squared: 1, Adjusted R-squared: 1
F-statistic: 2.424e+05 on 1 and 4 DF, p-value: 1.021e-10