\(~\)
\(~\)
data <- read.table("./Week 3 - Test.txt", header = TRUE)
reg <- lm(INTRATE ~ INFL + PROD + UNEMPL + COMMPRI + PCE + PERSINC + HOUST, data = data)
summary (reg)
##
## Call:
## lm(formula = INTRATE ~ INFL + PROD + UNEMPL + COMMPRI + PCE +
## PERSINC + HOUST, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -7.4066 -1.4340 -0.1175 1.3555 7.7386
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.221161 0.244995 -0.903 0.3670
## INFL 0.696059 0.062229 11.185 < 2e-16 ***
## PROD -0.057743 0.039900 -1.447 0.1483
## UNEMPL 0.102481 0.096757 1.059 0.2899
## COMMPRI -0.005521 0.002974 -1.857 0.0638 .
## PCE 0.344380 0.069455 4.958 9.08e-07 ***
## PERSINC 0.246999 0.060590 4.077 5.13e-05 ***
## HOUST -0.019411 0.004672 -4.155 3.68e-05 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.188 on 652 degrees of freedom
## Multiple R-squared: 0.6385, Adjusted R-squared: 0.6346
## F-statistic: 164.5 on 7 and 652 DF, p-value: < 2.2e-16
\(~\)
With a t-value of 1.059, the first removed variable is ‘unemployment rate’.
\(~\)
reg <- lm(INTRATE ~ INFL + PROD + COMMPRI + PCE + PERSINC + HOUST, data = data)
summary(reg)
##
## Call:
## lm(formula = INTRATE ~ INFL + PROD + COMMPRI + PCE + PERSINC +
## HOUST, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -7.5322 -1.4982 -0.1005 1.3882 7.6954
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.290851 0.236016 -1.232 0.2183
## INFL 0.693309 0.062180 11.150 < 2e-16 ***
## PROD -0.025460 0.025752 -0.989 0.3232
## COMMPRI -0.006514 0.002822 -2.308 0.0213 *
## PCE 0.368561 0.065602 5.618 2.86e-08 ***
## PERSINC 0.251581 0.060441 4.162 3.57e-05 ***
## HOUST -0.021023 0.004417 -4.760 2.39e-06 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.188 on 653 degrees of freedom
## Multiple R-squared: 0.6379, Adjusted R-squared: 0.6346
## F-statistic: 191.7 on 6 and 653 DF, p-value: < 2.2e-16
\(~\)
The next removed variable is ‘production’, with a -0.989 t-value.
\(~\)
reg <- lm(INTRATE ~ INFL + COMMPRI + PCE + PERSINC + HOUST, data = data)
summary(reg)
##
## Call:
## lm(formula = INTRATE ~ INFL + COMMPRI + PCE + PERSINC + HOUST,
## data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -7.1631 -1.5244 -0.1125 1.3715 7.6725
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.240119 0.230366 -1.042 0.29764
## INFL 0.717527 0.057152 12.555 < 2e-16 ***
## COMMPRI -0.007501 0.002640 -2.841 0.00464 **
## PCE 0.340525 0.059156 5.756 1.32e-08 ***
## PERSINC 0.240242 0.059342 4.048 5.77e-05 ***
## HOUST -0.020530 0.004389 -4.678 3.52e-06 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.188 on 654 degrees of freedom
## Multiple R-squared: 0.6374, Adjusted R-squared: 0.6346
## F-statistic: 229.9 on 5 and 654 DF, p-value: < 2.2e-16
\(~\)
Now all variables can be considered significant, since their t-values are all above 2 and their standard error close to 0. The final version of the model thus includes the variables:
\(~\)
\(~\)
First we regress the federal funds rate on each constant, to define which variable will be added first.
\(~\)
reg <- lm(INTRATE ~ INFL, data = data)
summary(reg)
##
## Call:
## lm(formula = INTRATE ~ INFL, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -5.9947 -1.5592 0.0603 1.4990 8.2910
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.64209 0.15863 10.35 <2e-16 ***
## INFL 0.94534 0.03268 28.93 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.403 on 658 degrees of freedom
## Multiple R-squared: 0.5598, Adjusted R-squared: 0.5591
## F-statistic: 836.6 on 1 and 658 DF, p-value: < 2.2e-16
reg <- lm(INTRATE ~ PROD, data = data)
summary(reg)
##
## Call:
## lm(formula = INTRATE ~ PROD, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -5.4733 -2.3293 -0.1199 1.8050 13.7859
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 5.39419 0.16551 32.592 <2e-16 ***
## PROD -0.01592 0.02966 -0.537 0.592
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 3.621 on 658 degrees of freedom
## Multiple R-squared: 0.0004375, Adjusted R-squared: -0.001082
## F-statistic: 0.288 on 1 and 658 DF, p-value: 0.5917
reg <- lm(INTRATE ~ UNEMPL, data = data)
summary(reg)
##
## Call:
## lm(formula = INTRATE ~ UNEMPL, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -5.4502 -2.3216 -0.4573 1.9157 14.4183
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 4.54462 0.18496 24.571 < 2e-16 ***
## UNEMPL 0.45247 0.07018 6.447 2.21e-10 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 3.513 on 658 degrees of freedom
## Multiple R-squared: 0.05942, Adjusted R-squared: 0.05799
## F-statistic: 41.57 on 1 and 658 DF, p-value: 2.206e-10
reg <- lm(INTRATE ~ COMMPRI, data = data)
summary(reg)
##
## Call:
## lm(formula = INTRATE ~ COMMPRI, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -6.0892 -2.4343 -0.2646 1.9122 13.8328
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 5.401743 0.141559 38.16 < 2e-16 ***
## COMMPRI -0.011526 0.004191 -2.75 0.00613 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 3.601 on 658 degrees of freedom
## Multiple R-squared: 0.01136, Adjusted R-squared: 0.009859
## F-statistic: 7.562 on 1 and 658 DF, p-value: 0.006125
reg <- lm(INTRATE ~ PCE, data = data)
summary(reg)
##
## Call:
## lm(formula = INTRATE ~ PCE, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -6.0034 -2.2094 -0.1965 1.6315 10.9790
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.33613 0.28161 -1.194 0.233
## PCE 0.82938 0.03799 21.832 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.758 on 658 degrees of freedom
## Multiple R-squared: 0.4201, Adjusted R-squared: 0.4192
## F-statistic: 476.6 on 1 and 658 DF, p-value: < 2.2e-16
reg <- lm(INTRATE ~ PERSINC, data = data)
summary(reg)
##
## Call:
## lm(formula = INTRATE ~ PERSINC, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -5.6152 -2.2902 -0.2105 1.7326 13.9662
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 5.12454 0.20844 24.586 <2e-16 ***
## PERSINC 0.10429 0.07186 1.451 0.147
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 3.616 on 658 degrees of freedom
## Multiple R-squared: 0.003191, Adjusted R-squared: 0.001676
## F-statistic: 2.106 on 1 and 658 DF, p-value: 0.1472
reg <- lm(INTRATE ~ HOUST, data = data)
summary(reg)
##
## Call:
## lm(formula = INTRATE ~ HOUST, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -6.950 -2.223 -0.156 1.833 14.152
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 5.403640 0.138710 38.956 < 2e-16 ***
## HOUST -0.030950 0.006062 -5.106 4.32e-07 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 3.552 on 658 degrees of freedom
## Multiple R-squared: 0.03811, Adjusted R-squared: 0.03665
## F-statistic: 26.07 on 1 and 658 DF, p-value: 4.317e-07
\(~\)
With the highest F-statistic, ‘Inflation’ is the first variable added to the model. We now repeat the process for all the remaining ones.
\(~\)
reg <- lm(INTRATE ~ INFL + PROD, data = data)
summary(reg)
##
## Call:
## lm(formula = INTRATE ~ INFL + PROD, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -5.1592 -1.6762 0.0141 1.3730 7.9203
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.24890 0.17619 7.088 3.51e-12 ***
## INFL 0.97498 0.03273 29.785 < 2e-16 ***
## PROD 0.09472 0.01971 4.805 1.92e-06 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.364 on 657 degrees of freedom
## Multiple R-squared: 0.5747, Adjusted R-squared: 0.5734
## F-statistic: 443.9 on 2 and 657 DF, p-value: < 2.2e-16
reg <- lm(INTRATE ~ INFL + UNEMPL, data = data)
summary(reg)
##
## Call:
## lm(formula = INTRATE ~ INFL + UNEMPL, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -5.1135 -1.7040 -0.0674 1.2620 8.4818
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.12297 0.16879 6.653 6.05e-11 ***
## INFL 0.92573 0.03159 29.300 < 2e-16 ***
## UNEMPL 0.33581 0.04642 7.235 1.30e-12 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.315 on 657 degrees of freedom
## Multiple R-squared: 0.5922, Adjusted R-squared: 0.591
## F-statistic: 477.1 on 2 and 657 DF, p-value: < 2.2e-16
reg <- lm(INTRATE ~ INFL + COMMPRI, data = data)
summary(reg)
##
## Call:
## lm(formula = INTRATE ~ INFL + COMMPRI, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -6.2351 -1.5814 0.0128 1.4972 8.3501
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.682029 0.160251 10.496 <2e-16 ***
## INFL 0.940702 0.032760 28.715 <2e-16 ***
## COMMPRI -0.004637 0.002803 -1.654 0.0986 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.4 on 657 degrees of freedom
## Multiple R-squared: 0.5616, Adjusted R-squared: 0.5602
## F-statistic: 420.8 on 2 and 657 DF, p-value: < 2.2e-16
reg <- lm(INTRATE ~ INFL + PCE, data = data)
summary(reg)
##
## Call:
## lm(formula = INTRATE ~ INFL + PCE, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -5.8640 -1.7141 -0.0637 1.5733 7.8959
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.10125 0.23417 0.432 0.666
## INFL 0.71575 0.04094 17.483 <2e-16 ***
## PCE 0.35616 0.04146 8.590 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.28 on 657 degrees of freedom
## Multiple R-squared: 0.6042, Adjusted R-squared: 0.603
## F-statistic: 501.5 on 2 and 657 DF, p-value: < 2.2e-16
reg <- lm(INTRATE ~ INFL + PERSINC, data = data)
summary(reg)
##
## Call:
## lm(formula = INTRATE ~ INFL + PERSINC, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -7.4839 -1.4786 -0.1279 1.4757 7.8344
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.44720 0.19510 2.292 0.0222 *
## INFL 1.01224 0.03148 32.156 <2e-16 ***
## PERSINC 0.43597 0.04600 9.478 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.256 on 657 degrees of freedom
## Multiple R-squared: 0.6127, Adjusted R-squared: 0.6115
## F-statistic: 519.7 on 2 and 657 DF, p-value: < 2.2e-16
reg <- lm(INTRATE ~ INFL + HOUST, data = data)
summary(reg)
##
## Call:
## lm(formula = INTRATE ~ INFL + HOUST, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -6.1362 -1.5837 0.1037 1.4405 8.2763
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.676666 0.163125 10.278 <2e-16 ***
## INFL 0.938290 0.033590 27.934 <2e-16 ***
## HOUST -0.003841 0.004215 -0.911 0.362
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.404 on 657 degrees of freedom
## Multiple R-squared: 0.5603, Adjusted R-squared: 0.559
## F-statistic: 418.6 on 2 and 657 DF, p-value: < 2.2e-16
\(~\)
The highest f-statistic now belongs to ‘Personal income’, which is the second added variable.
\(~\)
reg <- lm(INTRATE ~ INFL + PERSINC + PROD, data = data)
summary(reg)
##
## Call:
## lm(formula = INTRATE ~ INFL + PERSINC + PROD, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -7.354 -1.492 -0.136 1.450 7.817
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.442226 0.195958 2.257 0.0244 *
## INFL 1.013042 0.031616 32.042 < 2e-16 ***
## PERSINC 0.428021 0.053304 8.030 4.53e-15 ***
## PROD 0.006446 0.021800 0.296 0.7675
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.257 on 656 degrees of freedom
## Multiple R-squared: 0.6128, Adjusted R-squared: 0.611
## F-statistic: 346 on 3 and 656 DF, p-value: < 2.2e-16
reg <- lm(INTRATE ~ INFL + PERSINC + UNEMPL, data = data)
summary(reg)
##
## Call:
## lm(formula = INTRATE ~ INFL + PERSINC + UNEMPL, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -6.4139 -1.4914 -0.1884 1.3693 7.9992
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.44625 0.19422 2.298 0.02190 *
## INFL 0.99164 0.03230 30.705 < 2e-16 ***
## PERSINC 0.35595 0.05493 6.480 1.8e-10 ***
## UNEMPL 0.14249 0.05402 2.638 0.00854 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.246 on 656 degrees of freedom
## Multiple R-squared: 0.6168, Adjusted R-squared: 0.615
## F-statistic: 351.9 on 3 and 656 DF, p-value: < 2.2e-16
reg <- lm(INTRATE ~ INFL + PERSINC + COMMPRI, data = data)
summary(reg)
##
## Call:
## lm(formula = INTRATE ~ INFL + PERSINC + COMMPRI, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -7.810 -1.438 -0.141 1.448 7.904
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.483740 0.195167 2.479 0.0134 *
## INFL 1.007126 0.031464 32.009 <2e-16 ***
## PERSINC 0.441293 0.045916 9.611 <2e-16 ***
## COMMPRI -0.005935 0.002630 -2.257 0.0244 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.249 on 656 degrees of freedom
## Multiple R-squared: 0.6157, Adjusted R-squared: 0.6139
## F-statistic: 350.3 on 3 and 656 DF, p-value: < 2.2e-16
reg <- lm(INTRATE ~ INFL + PERSINC + PCE, data = data)
summary(reg)
##
## Call:
## lm(formula = INTRATE ~ INFL + PERSINC + PCE, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -6.8267 -1.5734 -0.1168 1.4852 7.6214
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.02122 0.23031 0.092 0.926622
## INFL 0.87542 0.05083 17.224 < 2e-16 ***
## PERSINC 0.30541 0.05955 5.129 3.85e-07 ***
## PCE 0.18118 0.05310 3.412 0.000684 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.238 on 656 degrees of freedom
## Multiple R-squared: 0.6195, Adjusted R-squared: 0.6177
## F-statistic: 356 on 3 and 656 DF, p-value: < 2.2e-16
reg <- lm(INTRATE ~ INFL + PERSINC + HOUST, data = data)
summary(reg)
##
## Call:
## lm(formula = INTRATE ~ INFL + PERSINC + HOUST, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -7.7516 -1.4280 -0.1377 1.3543 7.7685
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.482973 0.194586 2.482 0.01331 *
## INFL 0.995683 0.031906 31.207 < 2e-16 ***
## PERSINC 0.458846 0.046532 9.861 < 2e-16 ***
## HOUST -0.010938 0.004001 -2.733 0.00644 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.245 on 656 degrees of freedom
## Multiple R-squared: 0.6171, Adjusted R-squared: 0.6153
## F-statistic: 352.4 on 3 and 656 DF, p-value: < 2.2e-16
\(~\)
The third added variable is: ‘Personal consumption expenditure’
\(~\)
reg <- lm(INTRATE ~ INFL + PERSINC + PCE + PROD, data = data)
summary(reg)
##
## Call:
## lm(formula = INTRATE ~ INFL + PERSINC + PCE + PROD, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -7.4144 -1.5287 -0.1259 1.5313 7.6676
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.05171 0.23513 -0.220 0.826001
## INFL 0.83827 0.05645 14.849 < 2e-16 ***
## PERSINC 0.31987 0.06026 5.308 1.52e-07 ***
## PCE 0.22432 0.06029 3.720 0.000216 ***
## PROD -0.03694 0.02454 -1.506 0.132675
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.236 on 655 degrees of freedom
## Multiple R-squared: 0.6208, Adjusted R-squared: 0.6185
## F-statistic: 268.1 on 4 and 655 DF, p-value: < 2.2e-16
reg <- lm(INTRATE ~ INFL + PERSINC + PCE + UNEMPL, data = data)
summary(reg)
##
## Call:
## lm(formula = INTRATE ~ INFL + PERSINC + PCE + UNEMPL, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -6.4059 -1.5649 -0.1561 1.5020 7.7442
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.09932 0.23950 0.415 0.6785
## INFL 0.89023 0.05232 17.013 < 2e-16 ***
## PERSINC 0.28896 0.06113 4.727 2.79e-06 ***
## PCE 0.14775 0.06012 2.458 0.0142 *
## UNEMPL 0.07218 0.06094 1.184 0.2367
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.237 on 655 degrees of freedom
## Multiple R-squared: 0.6203, Adjusted R-squared: 0.618
## F-statistic: 267.5 on 4 and 655 DF, p-value: < 2.2e-16
reg <- lm(INTRATE ~ INFL + PERSINC + PCE + COMMPRI, data = data)
summary(reg)
##
## Call:
## lm(formula = INTRATE ~ INFL + PERSINC + PCE + COMMPRI, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -7.1468 -1.4614 -0.1224 1.5219 7.6744
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.021050 0.229123 -0.092 0.92683
## INFL 0.837752 0.051854 16.156 < 2e-16 ***
## PERSINC 0.284055 0.059525 4.772 2.25e-06 ***
## PCE 0.221367 0.054235 4.082 5.02e-05 ***
## COMMPRI -0.008483 0.002673 -3.173 0.00158 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.222 on 655 degrees of freedom
## Multiple R-squared: 0.6252, Adjusted R-squared: 0.6229
## F-statistic: 273.2 on 4 and 655 DF, p-value: < 2.2e-16
reg <- lm(INTRATE ~ INFL + PERSINC + PCE + HOUST, data = data)
summary(reg)
##
## Call:
## lm(formula = INTRATE ~ INFL + PERSINC + PCE + HOUST, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -6.8827 -1.5365 -0.1099 1.3049 7.7022
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.213571 0.231416 -0.923 0.356
## INFL 0.744809 0.056643 13.149 < 2e-16 ***
## PERSINC 0.256885 0.059370 4.327 1.75e-05 ***
## PCE 0.310975 0.058548 5.311 1.49e-07 ***
## HOUST -0.021522 0.004398 -4.893 1.25e-06 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.2 on 655 degrees of freedom
## Multiple R-squared: 0.6329, Adjusted R-squared: 0.6306
## F-statistic: 282.3 on 4 and 655 DF, p-value: < 2.2e-16
\(~\)
The fourth added variable is: ‘Housing starts’.
\(~\)
reg <- lm(INTRATE ~ INFL + PERSINC + PCE + HOUST + PROD, data = data)
summary(reg)
##
## Call:
## lm(formula = INTRATE ~ INFL + PERSINC + PCE + HOUST + PROD, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -7.6237 -1.4669 -0.1326 1.3547 7.7370
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.312558 0.236607 -1.321 0.1870
## INFL 0.694049 0.062385 11.125 < 2e-16 ***
## PERSINC 0.273587 0.059881 4.569 5.86e-06 ***
## PCE 0.369249 0.065818 5.610 2.99e-08 ***
## HOUST -0.022185 0.004403 -5.039 6.07e-07 ***
## PROD -0.046477 0.024167 -1.923 0.0549 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.195 on 654 degrees of freedom
## Multiple R-squared: 0.6349, Adjusted R-squared: 0.6322
## F-statistic: 227.5 on 5 and 654 DF, p-value: < 2.2e-16
reg <- lm(INTRATE ~ INFL + PERSINC + PCE + HOUST + UNEMPL, data = data)
summary(reg)
##
## Call:
## lm(formula = INTRATE ~ INFL + PERSINC + PCE + HOUST + UNEMPL,
## data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -6.9710 -1.5410 -0.1044 1.3203 7.7000
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.233338 0.245864 -0.949 0.343
## INFL 0.739770 0.060466 12.235 < 2e-16 ***
## PERSINC 0.259579 0.060468 4.293 2.03e-05 ***
## PCE 0.319874 0.069389 4.610 4.85e-06 ***
## HOUST -0.021845 0.004603 -4.745 2.56e-06 ***
## UNEMPL -0.015013 0.062716 -0.239 0.811
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.201 on 654 degrees of freedom
## Multiple R-squared: 0.6329, Adjusted R-squared: 0.6301
## F-statistic: 225.5 on 5 and 654 DF, p-value: < 2.2e-16
reg <- lm(INTRATE ~ INFL + PERSINC + PCE + HOUST + COMMPRI, data = data)
summary(reg)
##
## Call:
## lm(formula = INTRATE ~ INFL + PERSINC + PCE + HOUST + COMMPRI,
## data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -7.1631 -1.5244 -0.1125 1.3715 7.6725
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.240119 0.230366 -1.042 0.29764
## INFL 0.717527 0.057152 12.555 < 2e-16 ***
## PERSINC 0.240242 0.059342 4.048 5.77e-05 ***
## PCE 0.340525 0.059156 5.756 1.32e-08 ***
## HOUST -0.020530 0.004389 -4.678 3.52e-06 ***
## COMMPRI -0.007501 0.002640 -2.841 0.00464 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.188 on 654 degrees of freedom
## Multiple R-squared: 0.6374, Adjusted R-squared: 0.6346
## F-statistic: 229.9 on 5 and 654 DF, p-value: < 2.2e-16
\(~\)
The fifth added variable is: ‘Commodity prices’.
\(~\)
reg <- lm(INTRATE ~ INFL + PERSINC + PCE + HOUST + COMMPRI + PROD, data = data)
summary(reg)
##
## Call:
## lm(formula = INTRATE ~ INFL + PERSINC + PCE + HOUST + COMMPRI +
## PROD, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -7.5322 -1.4982 -0.1005 1.3882 7.6954
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.290851 0.236016 -1.232 0.2183
## INFL 0.693309 0.062180 11.150 < 2e-16 ***
## PERSINC 0.251581 0.060441 4.162 3.57e-05 ***
## PCE 0.368561 0.065602 5.618 2.86e-08 ***
## HOUST -0.021023 0.004417 -4.760 2.39e-06 ***
## COMMPRI -0.006514 0.002822 -2.308 0.0213 *
## PROD -0.025460 0.025752 -0.989 0.3232
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.188 on 653 degrees of freedom
## Multiple R-squared: 0.6379, Adjusted R-squared: 0.6346
## F-statistic: 191.7 on 6 and 653 DF, p-value: < 2.2e-16
reg <- lm(INTRATE ~ INFL + PERSINC + PCE + HOUST + + COMMPRI + UNEMPL, data = data)
summary(reg)
##
## Call:
## lm(formula = INTRATE ~ INFL + PERSINC + PCE + HOUST + +COMMPRI +
## UNEMPL, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -7.1891 -1.5245 -0.1037 1.3731 7.6719
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.245982 0.244598 -1.006 0.3150
## INFL 0.716063 0.060725 11.792 < 2e-16 ***
## PERSINC 0.241071 0.060502 3.985 7.52e-05 ***
## PCE 0.343138 0.069508 4.937 1.01e-06 ***
## HOUST -0.020628 0.004599 -4.485 8.61e-06 ***
## COMMPRI -0.007489 0.002647 -2.830 0.0048 **
## UNEMPL -0.004483 0.062494 -0.072 0.9428
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.19 on 653 degrees of freedom
## Multiple R-squared: 0.6374, Adjusted R-squared: 0.634
## F-statistic: 191.3 on 6 and 653 DF, p-value: < 2.2e-16
\(~\)
Now none of the remaining variables fulfill the criteria to be considered significant. The final version of the model is thus the same as in question a, including the variables:
\(~\)
\(~\)
First we define Taylor’s rule as:
\(~\)
reg <- lm(INTRATE ~ INFL + PROD, data = data)
summary(reg)
##
## Call:
## lm(formula = INTRATE ~ INFL + PROD, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -5.1592 -1.6762 0.0141 1.3730 7.9203
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.24890 0.17619 7.088 3.51e-12 ***
## INFL 0.97498 0.03273 29.785 < 2e-16 ***
## PROD 0.09472 0.01971 4.805 1.92e-06 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.364 on 657 degrees of freedom
## Multiple R-squared: 0.5747, Adjusted R-squared: 0.5734
## F-statistic: 443.9 on 2 and 657 DF, p-value: < 2.2e-16
\(~\)
Now we compare it with the model from exercise a, considering R², AIC and BIC:
\(~\)
taylor <- glance(reg)[,c(1,8,9)]
exercise <- glance(lm(INTRATE ~ INFL + COMMPRI + PCE + PERSINC + HOUST, data = data))[,c(1,8,9)]
data.frame("Taylor" = t(taylor), "Exercise A" = t(exercise))
## Taylor Exercise.A
## r.squared 0.5747014 0.637361
## AIC 3013.6163432 2914.423247
## BIC 3031.5853026 2945.868926
\(~\)
With lower AIC and BIC values, and a higher R², the model from exercise A is the best one.
\(~\)
\(~\)
reset <- resettest(reg, power = 2, type = "fitted")
reset <- t(data.frame(reset[c(1,4)], row.names = "Reset"))
chow <- sctest(INTRATE ~ INFL + PROD, type = "Chow", data = data, point = 240)
chow <- t(data.frame(chow[c(1,2)], row.names = "Chow"))
res2 <- sum(reg$residuals[1:240])
res <- sum(reg$residuals)
fore <- t(data.frame("statistic" = ((res2-res)/420)/(res/(240-2)), "p.value" = 0, row.names = "Forecast"))
jarq <- jarque.bera.test(reg$residuals)
jarq <- t(data.frame(jarq[c(1,3)], row.names = "Jarque Bera"))
data.frame(reset, chow, fore, jarq)
## Reset Chow Forecast Jarque.Bera
## statistic 2.5371195 28.73501 2.089009e+15 12.444043308
## p.value 0.1116792 0.00000 0.000000e+00 0.001985228
\(~\)
The values observed reject the null hypothesis that the model has been correctly specified, meaning it is not a good fit for the data.
\(~\) \(~\) \(~\)