Prévia do material em texto
5º EXERCÍCIO ECONOMETRIA DE SÉRIES TEMPORAIS PROFESSOR: RICARDO CHAVES LIMA ALUNA: DANIELLY ROBERTA TARGINO SILVA RECIFE 2016 Exercício 5 Usando o banco de dados Canada, e o exemplo varcanada-2, realize e comente os teste de causalidade de Granger para as variáveis e o teste de número de defasagens para o modelo. ##e=emplyment;prod=labor prductivity;rw=real wage; U=unempoyment## data("Canada") summary(Canada) VARselect(Canada, lag.max = 8, type = "both") ##Check causality## var.2c <- VAR(Canada, p = 5, type = "const") causality(var.2c, cause = "prod") causality(var.2c, cause = "e") causality(var.2c, cause = "U") causality(var.2c, cause = "rw") reg1 <- lm(Canada[3:100] ~ Canada[2:99]); summary(reg1) reg2 <- dyn$lm(Canada ~ lag(Canada,-1)); summary(reg2) CONSOLE: > ##e=emplyment;prod=labor prductivity;rw=real wage; U=unempoyment## > data("Canada") > summary(Canada) e prod rw U Min. :928.6 Min. :401.3 Min. :386.1 Min. : 6.700 1st Qu.:935.4 1st Qu.:404.8 1st Qu.:423.9 1st Qu.: 7.782 Median :946.0 Median :406.5 Median :444.4 Median : 9.450 Mean :944.3 Mean :407.8 Mean :440.8 Mean : 9.321 3rd Qu.:950.0 3rd Qu.:410.7 3rd Qu.:461.1 3rd Qu.:10.607 Max. :961.8 Max. :418.0 Max. :470.0 Max. :12.770 > VARselect(Canada, lag.max = 8, type = "both") $selection AIC(n) HQ(n) SC(n) FPE(n) 3 2 1 3 $criteria 1 2 3 4 5 6 AIC(n) -6.272579064 -6.636669705 -6.771176872 -6.634609210 -6.398132246 -6.307704843 HQ(n) -5.978429449 -6.146420347 -6.084827770 -5.752160366 -5.319583658 -5.033056512 SC(n) -5.536558009 -5.409967947 -5.053794411 -4.426546046 -3.699388378 -3.118280272 FPE(n) 0.001889842 0.001319462 0.001166019 0.001363175 0.001782055 0.002044202 7 8 AIC(n) -6.070727259 -6.06159685 HQ(n) -4.599979185 -4.39474903 SC(n) -2.390621985 -1.89081087 FPE(n) 0.002768551 0.00306012 > ##Check causality## > var.2c <- VAR(Canada, p = 5, type = "const") > causality(var.2c, cause = "prod") $Granger Granger causality H0: prod do not Granger-cause e rw U data: VAR object var.2c F-Test = 1.6346, df1 = 15, df2 = 232, p-value = 0.06592 $Instant H0: No instantaneous causality between: prod and e rw U data: VAR object var.2c Chi-squared = 3.4626, df = 3, p-value = 0.3256 #p-value > 0,05 H0 > causality(var.2c, cause = "e") $Granger Granger causality H0: e do not Granger-cause prod rw U data: VAR object var.2c F-Test = 1.9521, df1 = 15, df2 = 232, p-value = 0.01956 $Instant H0: No instantaneous causality between: e and prod rw U data: VAR object var.2c Chi-squared = 28.596, df = 3, p-value = 2.723e-06 #p-value > 0,05 H0 > causality(var.2c, cause = "U") $Granger Granger causality H0: U do not Granger-cause e prod rw data: VAR object var.2c F-Test = 1.2308, df1 = 15, df2 = 232, p-value = 0.2494 $Instant H0: No instantaneous causality between: U and e prod rw data: VAR object var.2c Chi-squared = 28.316, df = 3, p-value = 3.118e-06 #p-value > 0,05 H0 > causality(var.2c, cause = "rw") $Granger Granger causality H0: rw do not Granger-cause e prod U data: VAR object var.2c F-Test = 1.2181, df1 = 15, df2 = 232, p-value = 0.2588 $Instant H0: No instantaneous causality between: rw and e prod U data: VAR object var.2c Chi-squared = 4.3587, df = 3, p-value = 0.2252 #p-value > 0,05 H0 > reg1 <- lm(Canada[3:100] ~ Canada[2:99]); summary(reg1) Call: lm(formula = Canada[3:100] ~ Canada[2:99]) Residuals: Min 1Q Median 3Q Max -549.63 6.28 6.85 7.33 7.74 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 6.72211 25.83295 0.26 0.795 Canada[2:99] 0.98597 0.02924 33.72 <2e-16 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 56.46 on 96 degrees of freedom Multiple R-squared: 0.9221, Adjusted R-squared: 0.9213 F-statistic: 1137 on 1 and 96 DF, p-value: < 2.2e-16 > reg2 <- dyn$lm(Canada ~ lag(Canada,-1)); summary(reg2) Response Y1 : Call: lm(formula = Y1 ~ lag(Canada, -1)) Residuals: Min 1Q Median 3Q Max -1.53117 -0.21104 0.02751 0.28837 0.96233 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -192.56361 63.81154 -3.018 0.00344 ** lag(Canada, -1)1 1.17354 0.08196 14.319 < 2e-16 *** lag(Canada, -1)2 0.14479 0.02741 5.282 1.13e-06 *** lag(Canada, -1)3 -0.07905 0.02832 -2.791 0.00660 ** lag(Canada, -1)4 0.52438 0.16574 3.164 0.00222 ** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 0.4798 on 78 degrees of freedom (2 observations deleted due to missingness) Multiple R-squared: 0.9973, Adjusted R-squared: 0.9972 F-statistic: 7304 on 4 and 78 DF, p-value: < 2.2e-16 Response Y2 : Call: lm(formula = Y2 ~ lag(Canada, -1)) Residuals: Min 1Q Median 3Q Max -2.30383 -0.42320 -0.08153 0.49945 1.70407 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -81.55110 92.05141 -0.886 0.378 lag(Canada, -1)1 0.08710 0.11823 0.737 0.464 lag(Canada, -1)2 1.01970 0.03955 25.785 <2e-16 *** lag(Canada, -1)3 -0.02629 0.04085 -0.644 0.522 lag(Canada, -1)4 0.32299 0.23910 1.351 0.181 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 0.6921 on 78 degrees of freedom (2 observations deleted due to missingness) Multiple R-squared: 0.9746, Adjusted R-squared: 0.9733 F-statistic: 747.4 on 4 and 78 DF, p-value: < 2.2e-16 Response Y3 : Call: lm(formula = Y3 ~ lag(Canada, -1)) Residuals: Min 1Q Median 3Q Max -1.74912 -0.42149 -0.05094 0.41187 2.36337 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 11.61376 104.96033 0.111 0.91218 lag(Canada, -1)1 0.06381 0.13481 0.473 0.63729 lag(Canada, -1)2 -0.13551 0.04509 -3.005 0.00357 ** lag(Canada, -1)3 0.96873 0.04658 20.797 < 2e-16 *** lag(Canada, -1)4 -0.19538 0.27262 -0.717 0.47571 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 0.7892 on 78 degrees of freedom (2 observations deleted due to missingness) Multiple R-squared: 0.9988, Adjusted R-squared: 0.9988 F-statistic: 1.681e+04 on 4 and 78 DF, p-value: < 2.2e-16 Response Y4 : Call: lm(formula = Y4 ~ lag(Canada, -1)) Residuals: Min 1Q Median 3Q Max -0.5879 -0.1923 -0.0751 0.1376 1.4260 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 186.80892 47.72282 3.914 0.000193 *** lag(Canada, -1)1 -0.19294 0.06129 -3.148 0.002331 ** lag(Canada, -1)2 -0.08087 0.02050 -3.944 0.000174 *** lag(Canada, -1)3 0.07539 0.02118 3.559 0.000637 *** lag(Canada, -1)4 0.47531 0.12396 3.835 0.000254 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 0.3588 on 78 degrees of freedom (2 observations deleted due to missingness) Multiple R-squared: 0.9524, Adjusted R-squared: 0.95 F-statistic: 390.5 on 4 and 78 DF, p-value: < 2.2e-16 Se todos são conjuntamente diferentes de zero, então temos que X → Y . Porém, o contrário também pode valer, isto é Y → X. Se valores passados de X nos ajudam a prever Y, então diz-se que X Granger causa Y , ou simplesmente X → Y . Quando não rejeitamos H0, concluímos que o modelo correto é o de menor defasagem,e quando rejeitamos H0, concluímos que o melhor modelo é aquele com maior defasagem.