// **************************************************************************** // Results for quarterly data > HousePrices <- read.table("F:/tz/CVSRoot/tz/projects/housing/own_work/for_stats_program.dat",header=TRUE) > attach(HousePrices) > > # do log version > formula.1 <- LN.RPH ~ 1 + LN.HH + LN.RGDP + RINT + RENT.DRG + TAX > RegModel.1 <- lm(formula.1, data=HousePrices) > summary(RegModel.1) Call: lm(formula = formula.1, data = HousePrices) Residuals: Min 1Q Median 3Q Max -0.257452 -0.070161 0.007918 0.082201 0.246745 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -15.405831 5.525742 -2.788 0.00619 ** LN.HH 1.509511 0.719735 2.097 0.03812 * LN.RGDP 0.842991 0.387900 2.173 0.03178 * RINT -0.006376 0.001219 -5.229 7.57e-07 *** RENT.DRG 0.003268 0.001516 2.155 0.03323 * TAX 0.182241 0.028020 6.504 2.02e-09 *** --- Signif. codes: 0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 Residual standard error: 0.1041 on 117 degrees of freedom Multiple R-Squared: 0.782, Adjusted R-squared: 0.7726 F-statistic: 83.92 on 5 and 117 DF, p-value: < 2.2e-16 > bgtest(formula.1,data = HousePrices) Breusch-Godfrey test for serial correlation of order 1 data: formula.1 LM test = 89.6731, df = 1, p-value = < 2.2e-16 > dwtest(formula.1,data = HousePrices) Durbin-Watson test data: formula.1 DW = 0.3178, p-value = < 2.2e-16 alternative hypothesis: true autocorrelation is greater than 0 > Box.test(resid(RegModel.1)) Box-Pierce test data: resid(RegModel.1) X-squared = 84.8589, df = 1, p-value = < 2.2e-16 > > # add in lag > formula.3 <- LN.RPH ~ 1 + LN.RPH.1 + LN.HH + LN.RGDP + RINT + RENT.DRG + TAX > RegModel.3 <- lm(formula.3, data=HousePrices) > summary(RegModel.3) Call: lm(formula = formula.3, data = HousePrices) Residuals: Min 1Q Median 3Q Max -0.108060 -0.022111 -0.002451 0.026729 0.129579 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -2.1764707 2.2163368 -0.982 0.328137 LN.RPH.1 0.8987236 0.0351637 25.558 < 2e-16 *** LN.HH 0.2248246 0.2851624 0.788 0.432066 LN.RGDP 0.0919818 0.1541089 0.597 0.551763 RINT -0.0018213 0.0005079 -3.586 0.000493 *** RENT.DRG -0.0010070 0.0006146 -1.638 0.104056 TAX -0.0111508 0.0132919 -0.839 0.403244 --- Signif. codes: 0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 Residual standard error: 0.04061 on 116 degrees of freedom Multiple R-Squared: 0.9671, Adjusted R-squared: 0.9654 F-statistic: 568.6 on 6 and 116 DF, p-value: < 2.2e-16 > bgtest(formula.3,data = HousePrices) Breusch-Godfrey test for serial correlation of order 1 data: formula.3 LM test = 0.0293, df = 1, p-value = 0.8641 > dwtest(formula.3,data = HousePrices) Durbin-Watson test data: formula.3 DW = 1.934, p-value = 0.1847 alternative hypothesis: true autocorrelation is greater than 0 > Box.test(resid(RegModel.3)) Box-Pierce test data: resid(RegModel.3) X-squared = 0.0263, df = 1, p-value = 0.8711 > bgtest(formula.1,data = HousePrices) Breusch-Godfrey test for serial correlation of order 1 data: formula.1 LM test = 89.6731, df = 1, p-value = < 2.2e-16 > formula.5 <- LN.RPH ~ 1 + LN.RPH.1 + LN.HH + LN.RGDP + RINT > RegModel.5 <- lm(formula.5, data=HousePrices) > summary(RegModel.5) Call: lm(formula = formula.5, data = HousePrices) Residuals: Min 1Q Median 3Q Max -0.119731 -0.025184 -0.000948 0.021768 0.125026 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -2.7949062 2.1330174 -1.310 0.193 LN.RPH.1 0.8962109 0.0275447 32.537 < 2e-16 *** LN.HH 0.3354880 0.2646795 1.268 0.207 LN.RGDP -0.0298681 0.1034310 -0.289 0.773 RINT -0.0023358 0.0004099 -5.698 9.07e-08 *** --- Signif. codes: 0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 Residual standard error: 0.04081 on 118 degrees of freedom Multiple R-Squared: 0.9662, Adjusted R-squared: 0.9651 F-statistic: 844.1 on 4 and 118 DF, p-value: < 2.2e-16 > bgtest(formula.5,data = HousePrices) Breusch-Godfrey test for serial correlation of order 1 data: formula.5 LM test = 0.1312, df = 1, p-value = 0.7172 > dwtest(formula.5,data = HousePrices) Durbin-Watson test data: formula.5 DW = 1.9031, p-value = 0.1823 alternative hypothesis: true autocorrelation is greater than 0 > Box.test(resid(RegModel.5)) Box-Pierce test data: resid(RegModel.5) X-squared = 0.1211, df = 1, p-value = 0.7278 // **************************************************************************** // Results for annual data > # do log version > formula.1 <- LN.RPH ~ 1 + LN.HH + LN.RGDPC + LN.POP + RINT + RENT.DRG + TAX > RegModel.1 <- lm(formula.1, data=HousePrices) > summary(RegModel.1) Call: lm(formula = formula.1, data = HousePrices) Residuals: Min 1Q Median 3Q Max -0.139198 -0.080249 0.001271 0.063077 0.218542 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 1.417695 153.728827 0.009 0.9927 LN.HH -4.243643 2.606062 -1.628 0.1171 LN.RGDPC 3.477513 1.341678 2.592 0.0163 * LN.POP 3.291940 14.895036 0.221 0.8270 RINT -0.002800 0.003251 -0.861 0.3979 RENT.DRG 0.001687 0.003855 0.438 0.6657 TAX 0.129415 0.081821 1.582 0.1274 --- Signif. codes: 0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 Residual standard error: 0.1084 on 23 degrees of freedom Multiple R-Squared: 0.8667, Adjusted R-squared: 0.8319 F-statistic: 24.92 on 6 and 23 DF, p-value: 5.601e-09 > bgtest(formula.1,data = HousePrices) Breusch-Godfrey test for serial correlation of order 1 data: formula.1 LM test = 18.3822, df = 1, p-value = 1.807e-05 > dwtest(formula.1,data = HousePrices) Durbin-Watson test data: formula.1 DW = 0.5721, p-value = 1.112e-08 alternative hypothesis: true autocorrelation is greater than 0 > Box.test(resid(RegModel.1)) Box-Pierce test data: resid(RegModel.1) X-squared = 15.2658, df = 1, p-value = 9.34e-05 > > # add in lag > formula.3 <- LN.RPH ~ 1 + LN.RPH.1 + LN.HH + LN.RGDPC + LN.POP + RINT + RENT.DRG + TAX > RegModel.3 <- lm(formula.3, data=HousePrices) > summary(RegModel.3) Call: lm(formula = formula.3, data = HousePrices) Residuals: Min 1Q Median 3Q Max -0.009579 -0.003062 -0.000681 0.001808 0.014686 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -2.847e+01 9.283e+00 -3.067 0.00564 ** LN.RPH.1 4.225e+00 5.325e-02 79.343 < 2e-16 *** LN.HH -4.265e-01 1.644e-01 -2.594 0.01658 * LN.RGDPC 4.549e-02 9.179e-02 0.496 0.62510 LN.POP 2.851e+00 8.988e-01 3.172 0.00441 ** RINT 3.243e-04 2.000e-04 1.621 0.11920 RENT.DRG -5.396e-04 2.343e-04 -2.303 0.03111 * TAX 5.505e-03 5.178e-03 1.063 0.29926 --- Signif. codes: 0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 Residual standard error: 0.00654 on 22 degrees of freedom Multiple R-Squared: 0.9995, Adjusted R-squared: 0.9994 F-statistic: 6767 on 7 and 22 DF, p-value: < 2.2e-16 > bgtest(formula.3,data = HousePrices) Breusch-Godfrey test for serial correlation of order 1 data: formula.3 LM test = 5.2571, df = 1, p-value = 0.02186 > dwtest(formula.3,data = HousePrices) Durbin-Watson test data: formula.3 DW = 1.0682, p-value = 2.454e-05 alternative hypothesis: true autocorrelation is greater than 0 > Box.test(resid(RegModel.3)) Box-Pierce test data: resid(RegModel.3) X-squared = 4.5037, df = 1, p-value = 0.03382 > > # add in lag > formula.5 <- LN.RPH ~ 1 + LN.RPH.1 + LN.HH + LN.RGDPC + LN.POP + RINT + INFL > RegModel.5 <- lm(formula.5, data=HousePrices) > summary(RegModel.5) Call: lm(formula = formula.5, data = HousePrices) Residuals: Min 1Q Median 3Q Max -0.011478 -0.004814 -0.001282 0.003657 0.015049 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -2.4384655 5.9870702 -0.407 0.6876 LN.RPH.1 4.2438440 0.0599888 70.744 <2e-16 *** LN.HH -0.2287649 0.1246709 -1.835 0.0795 . LN.RGDPC 0.0796768 0.0884797 0.901 0.3772 LN.POP 0.2418750 0.5250472 0.461 0.6494 RINT 0.0001723 0.0002176 0.792 0.4365 INFL 0.0002264 0.0003642 0.622 0.5403 --- Signif. codes: 0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 Residual standard error: 0.007726 on 23 degrees of freedom Multiple R-Squared: 0.9993, Adjusted R-squared: 0.9991 F-statistic: 5656 on 6 and 23 DF, p-value: < 2.2e-16 > bgtest(formula.5,data = HousePrices) Breusch-Godfrey test for serial correlation of order 1 data: formula.5 LM test = 8.242, df = 1, p-value = 0.004093 > dwtest(formula.5,data = HousePrices) Durbin-Watson test data: formula.5 DW = 0.8481, p-value = 9.203e-07 alternative hypothesis: true autocorrelation is greater than 0 > Box.test(resid(RegModel.5)) Box-Pierce test data: resid(RegModel.5) X-squared = 5.7181, df = 1, p-value = 0.01679 > > # **************************************************************************** > > # change to a differences specification > formula.7 <- D.LN.RPH ~ 1 + LN.RPH.1 + LN.HH + LN.RGDPC + LN.POP + RINT + RENT.DRG + TAX > RegModel.7 <- lm(formula.7, data=HousePrices) > summary(RegModel.7) Call: lm(formula = formula.7, data = HousePrices) Residuals: Min 1Q Median 3Q Max -0.170647 -0.023764 0.003525 0.033983 0.161489 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 113.134922 108.048150 1.047 0.3064 LN.RPH.1 -0.023066 0.619797 -0.037 0.9706 LN.HH 0.748828 1.913899 0.391 0.6994 LN.RGDPC 0.664094 1.068285 0.622 0.5406 LN.POP -11.290116 10.460537 -1.079 0.2921 RINT -0.003951 0.002328 -1.697 0.1038 RENT.DRG -0.005809 0.002727 -2.130 0.0446 * TAX -0.153343 0.060267 -2.544 0.0185 * --- Signif. codes: 0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 Residual standard error: 0.07612 on 22 degrees of freedom Multiple R-Squared: 0.5615, Adjusted R-squared: 0.422 F-statistic: 4.025 on 7 and 22 DF, p-value: 0.005578 > bgtest(formula.7,data = HousePrices) Breusch-Godfrey test for serial correlation of order 1 data: formula.7 LM test = 3.0682, df = 1, p-value = 0.07984 > dwtest(formula.7,data = HousePrices) Durbin-Watson test data: formula.7 DW = 1.5388, p-value = 0.005618 alternative hypothesis: true autocorrelation is greater than 0 > Box.test(resid(RegModel.7)) Box-Pierce test data: resid(RegModel.7) X-squared = 1.5643, df = 1, p-value = 0.2110 > > # add in differences in gdp > formula.7 <- D.LN.RPH ~ 1 + LN.RPH.1 + LN.HH + LN.RGDPC + D.LN.RGDPC + LN.POP + RINT + RENT.DRG + TAX > RegModel.7 <- lm(formula.7, data=HousePrices) Error in eval(expr, envir, enclos) : Object "D.LN.RGDPC" not found > summary(RegModel.7) Call: lm(formula = formula.7, data = HousePrices) Residuals: Min 1Q Median 3Q Max -0.170647 -0.023764 0.003525 0.033983 0.161489 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 113.134922 108.048150 1.047 0.3064 LN.RPH.1 -0.023066 0.619797 -0.037 0.9706 LN.HH 0.748828 1.913899 0.391 0.6994 LN.RGDPC 0.664094 1.068285 0.622 0.5406 LN.POP -11.290116 10.460537 -1.079 0.2921 RINT -0.003951 0.002328 -1.697 0.1038 RENT.DRG -0.005809 0.002727 -2.130 0.0446 * TAX -0.153343 0.060267 -2.544 0.0185 * --- Signif. codes: 0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 Residual standard error: 0.07612 on 22 degrees of freedom Multiple R-Squared: 0.5615, Adjusted R-squared: 0.422 F-statistic: 4.025 on 7 and 22 DF, p-value: 0.005578 > bgtest(formula.7,data = HousePrices) Error in eval(expr, envir, enclos) : Object "D.LN.RGDPC" not found > dwtest(formula.7,data = HousePrices) Error in eval(expr, envir, enclos) : Object "D.LN.RGDPC" not found > Box.test(resid(RegModel.7)) Box-Pierce test data: resid(RegModel.7) X-squared = 1.5643, df = 1, p-value = 0.2110 >