Tarea 15
library("gdata")
## gdata: read.xls support for 'XLS' (Excel 97-2004) files ENABLED.
##
## gdata: read.xls support for 'XLSX' (Excel 2007+) files ENABLED.
##
## Attaching package: 'gdata'
## The following object is masked from 'package:stats':
##
## nobs
## The following object is masked from 'package:utils':
##
## object.size
fc = read.xls("/Users/ferarevalo1/Documents/Econometria 1 /Fotocopias .xls")
fc
## copias estufm otrasus escolares otros total
## 1 55.786 33.813 1.758 1.853 2.336 39.760
## 2 55.734 30.431 1.352 2.317 1.906 36.006
## 3 51.222 27.226 1.737 1.695 1.547 32.205
## 4 27.344 15.366 1.165 0.872 2.084 19.487
## 5 52.456 31.724 1.255 1.328 2.177 36.484
## 6 47.630 26.745 1.140 2.915 1.821 32.621
## 7 43.670 31.612 1.594 1.835 1.439 36.480
## 8 15.314 20.357 0.768 0.307 1.144 22.576
## 9 67.434 36.322 1.799 1.917 2.790 42.828
## 10 59.024 29.418 0.962 1.712 1.624 33.716
## 11 60.868 29.728 1.352 1.634 0.811 33.525
## 12 27.214 14.993 0.890 0.307 0.275 16.465
## 13 57.632 36.361 1.865 2.066 2.622 42.914
## 14 57.518 38.427 1.276 2.759 2.188 44.650
## 15 48.266 28.327 1.580 1.933 2.111 33.951
## 16 29.928 21.425 1.163 0.514 1.325 24.427
## 17 56.128 36.398 1.930 2.214 2.451 42.993
## 18 46.948 30.474 1.670 1.874 2.103 36.121
## 19 37.942 22.712 1.948 1.342 1.716 27.718
## 20 19.682 17.772 0.938 0.341 1.153 20.204
## 21 45.282 28.261 1.939 1.741 1.639 33.580
## 22 67.546 27.090 1.711 2.323 1.796 32.920
## 23 65.364 23.751 2.210 1.732 1.658 29.351
## 24 30.064 12.827 0.710 0.182 0.672 14.391
reg = lm(formula = fc$copias ~ fc$estufm+fc$otrasus+fc$escolares+fc$otros, data = fc)
summary(reg)
##
## Call:
## lm(formula = fc$copias ~ fc$estufm + fc$otrasus + fc$escolares +
## fc$otros, data = fc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -11.5838 -5.9892 -0.7439 8.0433 13.2489
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 5.1790 8.5258 0.607 0.5507
## fc$estufm 0.7665 0.4719 1.624 0.1208
## fc$otrasus 9.4056 5.4859 1.715 0.1027
## fc$escolares 9.0494 3.9891 2.269 0.0351 *
## fc$otros -3.9982 4.5433 -0.880 0.3898
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 8.651 on 19 degrees of freedom
## Multiple R-squared: 0.7279, Adjusted R-squared: 0.6706
## F-statistic: 12.71 on 4 and 19 DF, p-value: 3.375e-05
reg1 = lm(formula = fc$copias ~ 0 +fc$estufm+fc$otrasus+fc$escolares+fc$otros, data = fc)
summary(reg1)
##
## Call:
## lm(formula = fc$copias ~ 0 + fc$estufm + fc$otrasus + fc$escolares +
## fc$otros, data = fc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -12.133 -5.803 -0.969 7.632 13.913
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## fc$estufm 0.9429 0.3659 2.577 0.0180 *
## fc$otrasus 10.8706 4.8489 2.242 0.0365 *
## fc$escolares 7.9885 3.5293 2.263 0.0349 *
## fc$otros -4.1638 4.4630 -0.933 0.3620
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 8.514 on 20 degrees of freedom
## Multiple R-squared: 0.975, Adjusted R-squared: 0.97
## F-statistic: 195.2 on 4 and 20 DF, p-value: 1.013e-15
reg2 = lm(formula = fc$copias ~ 0 +fc$estufm+fc$otrasus+fc$escolares, data = fc)
summary(reg2)
##
## Call:
## lm(formula = fc$copias ~ 0 + fc$estufm + fc$otrasus + fc$escolares,
## data = fc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -10.076 -6.146 -1.940 6.358 14.164
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## fc$estufm 0.7726 0.3162 2.444 0.0235 *
## fc$otrasus 9.5605 4.6268 2.066 0.0514 .
## fc$escolares 7.5549 3.4878 2.166 0.0420 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 8.487 on 21 degrees of freedom
## Multiple R-squared: 0.9739, Adjusted R-squared: 0.9702
## F-statistic: 261.6 on 3 and 21 DF, p-value: < 2.2e-16
reg3 = lm(formula = fc$estufm ~ 0 +fc$otrasus+fc$escolares, data = fc)
summary(reg3)
##
## Call:
## lm(formula = fc$estufm ~ 0 + fc$otrasus + fc$escolares, data = fc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -11.645 -2.913 2.210 4.466 10.077
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## fc$otrasus 10.647 2.141 4.974 5.61e-05 ***
## fc$escolares 6.850 1.844 3.716 0.0012 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 5.723 on 22 degrees of freedom
## Multiple R-squared: 0.9618, Adjusted R-squared: 0.9584
## F-statistic: 277.2 on 2 and 22 DF, p-value: 2.504e-16
reg4 = lm(formula = fc$otrasus ~ 0+fc$estufm+fc$escolares, data = fc)
summary(reg4)
##
## Call:
## lm(formula = fc$otrasus ~ 0 + fc$estufm + fc$escolares, data = fc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.73694 -0.20174 0.03999 0.16938 0.96485
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## fc$estufm 0.049715 0.009995 4.974 5.61e-05 ***
## fc$escolares 0.037161 0.160520 0.232 0.819
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.3911 on 22 degrees of freedom
## Multiple R-squared: 0.938, Adjusted R-squared: 0.9324
## F-statistic: 166.5 on 2 and 22 DF, p-value: 5.176e-14
reg5 = lm(formula = fc$escolares ~ 0+fc$estufm+fc$otrasus, data = fc)
summary(reg5)
##
## Call:
## lm(formula = fc$escolares ~ 0 + fc$estufm + fc$otrasus, data = fc)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.88910 -0.31884 -0.05624 0.09587 1.33499
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## fc$estufm 0.05629 0.01515 3.716 0.0012 **
## fc$otrasus 0.06540 0.28248 0.232 0.8191
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.5188 on 22 degrees of freedom
## Multiple R-squared: 0.9191, Adjusted R-squared: 0.9118
## F-statistic: 125 on 2 and 22 DF, p-value: 9.709e-13
Se puede ver que en las regresiones encontradas ninguna supera el R^2 de la regresion original, por lo tanto no hay multicolinealidad.