series<-(uschange)
autoplot(uschange[,1:2], ylab = "Valores")
ts.plot(series[,1:2], xlab="Tiempo",col=c(1,2))
a <- VARselect(uschange[,1:2], lag.max=15,type="trend")
a$selection
## AIC(n) HQ(n) SC(n) FPE(n)
## 3 3 1 3
modelo1<-VAR(uschange[,1:2],p=3,type=c("trend"))
modelo3<-VAR(uschange[,1:2],p=1,type=c("trend"))
summary(modelo1)
##
## VAR Estimation Results:
## =========================
## Endogenous variables: Consumption, Income
## Deterministic variables: trend
## Sample size: 184
## Log Likelihood: -385.38
## Roots of the characteristic polynomial:
## 0.8886 0.5506 0.5506 0.4563 0.2912 0.2912
## Call:
## VAR(y = uschange[, 1:2], p = 3, type = c("trend"))
##
##
## Estimation results for equation Consumption:
## ============================================
## Consumption = Consumption.l1 + Income.l1 + Consumption.l2 + Income.l2 + Consumption.l3 + Income.l3 + trend
##
## Estimate Std. Error t value Pr(>|t|)
## Consumption.l1 0.2346575 0.0799935 2.933 0.003796 **
## Income.l1 0.1008841 0.0552239 1.827 0.069412 .
## Consumption.l2 0.1931296 0.0835806 2.311 0.022003 *
## Income.l2 -0.0035172 0.0579583 -0.061 0.951679
## Consumption.l3 0.2701792 0.0800381 3.376 0.000905 ***
## Income.l3 0.0078077 0.0549405 0.142 0.887153
## trend 0.0011036 0.0005638 1.958 0.051860 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
##
## Residual standard error: 0.6092 on 177 degrees of freedom
## Multiple R-Squared: 0.6405, Adjusted R-squared: 0.6263
## F-statistic: 45.05 on 7 and 177 DF, p-value: < 2.2e-16
##
##
## Estimation results for equation Income:
## =======================================
## Income = Consumption.l1 + Income.l1 + Consumption.l2 + Income.l2 + Consumption.l3 + Income.l3 + trend
##
## Estimate Std. Error t value Pr(>|t|)
## Consumption.l1 0.5074199 0.1153193 4.400 1.87e-05 ***
## Income.l1 -0.2460717 0.0796113 -3.091 0.002318 **
## Consumption.l2 0.0634472 0.1204906 0.527 0.599148
## Income.l2 -0.0618530 0.0835532 -0.740 0.460109
## Consumption.l3 0.4073755 0.1153836 3.531 0.000529 ***
## Income.l3 -0.0268248 0.0792028 -0.339 0.735248
## trend 0.0017128 0.0008128 2.107 0.036497 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
##
## Residual standard error: 0.8782 on 177 degrees of freedom
## Multiple R-Squared: 0.4602, Adjusted R-squared: 0.4389
## F-statistic: 21.56 on 7 and 177 DF, p-value: < 2.2e-16
##
##
##
## Covariance matrix of residuals:
## Consumption Income
## Consumption 0.3689 0.2022
## Income 0.2022 0.7683
##
## Correlation matrix of residuals:
## Consumption Income
## Consumption 1.0000 0.3799
## Income 0.3799 1.0000
summary(modelo3)
##
## VAR Estimation Results:
## =========================
## Endogenous variables: Consumption, Income
## Deterministic variables: trend
## Sample size: 186
## Log Likelihood: -408.648
## Roots of the characteristic polynomial:
## 0.5838 0.3287
## Call:
## VAR(y = uschange[, 1:2], p = 1, type = c("trend"))
##
##
## Estimation results for equation Consumption:
## ============================================
## Consumption = Consumption.l1 + Income.l1 + trend
##
## Estimate Std. Error t value Pr(>|t|)
## Consumption.l1 0.4626250 0.0714742 6.473 8.58e-10 ***
## Income.l1 0.1375815 0.0553825 2.484 0.013883 *
## trend 0.0022217 0.0005588 3.976 0.000101 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
##
## Residual standard error: 0.654 on 183 degrees of freedom
## Multiple R-Squared: 0.574, Adjusted R-squared: 0.567
## F-statistic: 82.18 on 3 and 183 DF, p-value: < 2.2e-16
##
##
## Estimation results for equation Income:
## =======================================
## Income = Consumption.l1 + Income.l1 + trend
##
## Estimate Std. Error t value Pr(>|t|)
## Consumption.l1 0.6969795 0.0998422 6.981 5.23e-11 ***
## Income.l1 -0.2075006 0.0773637 -2.682 0.00798 **
## trend 0.0025844 0.0007806 3.311 0.00112 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
##
## Residual standard error: 0.9135 on 183 degrees of freedom
## Multiple R-Squared: 0.405, Adjusted R-squared: 0.3953
## F-statistic: 41.53 on 3 and 183 DF, p-value: < 2.2e-16
##
##
##
## Covariance matrix of residuals:
## Consumption Income
## Consumption 0.4189 0.2554
## Income 0.2554 0.8243
##
## Correlation matrix of residuals:
## Consumption Income
## Consumption 1.0000 0.4347
## Income 0.4347 1.0000
aic1<-summary(modelo1)$logLik;aic1
## [1] -385.3802
aic2<-summary(modelo3)$logLik;aic2
## [1] -408.6483
Por medio del criterio de información de Akaike, se determina que el modelo más eficiente para las variables utilizadas es el número 3, dado que su resultaado es de -408.6483, que es más negativo que el otro modelo utilizado.
summary(modelo1,equation="Consumption")
##
## VAR Estimation Results:
## =========================
## Endogenous variables: Consumption, Income
## Deterministic variables: trend
## Sample size: 184
## Log Likelihood: -385.38
## Roots of the characteristic polynomial:
## 0.8886 0.5506 0.5506 0.4563 0.2912 0.2912
## Call:
## VAR(y = uschange[, 1:2], p = 3, type = c("trend"))
##
##
## Estimation results for equation Consumption:
## ============================================
## Consumption = Consumption.l1 + Income.l1 + Consumption.l2 + Income.l2 + Consumption.l3 + Income.l3 + trend
##
## Estimate Std. Error t value Pr(>|t|)
## Consumption.l1 0.2346575 0.0799935 2.933 0.003796 **
## Income.l1 0.1008841 0.0552239 1.827 0.069412 .
## Consumption.l2 0.1931296 0.0835806 2.311 0.022003 *
## Income.l2 -0.0035172 0.0579583 -0.061 0.951679
## Consumption.l3 0.2701792 0.0800381 3.376 0.000905 ***
## Income.l3 0.0078077 0.0549405 0.142 0.887153
## trend 0.0011036 0.0005638 1.958 0.051860 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
##
## Residual standard error: 0.6092 on 177 degrees of freedom
## Multiple R-Squared: 0.6405, Adjusted R-squared: 0.6263
## F-statistic: 45.05 on 7 and 177 DF, p-value: < 2.2e-16
##
##
##
## Covariance matrix of residuals:
## Consumption Income
## Consumption 0.3689 0.2022
## Income 0.2022 0.7683
##
## Correlation matrix of residuals:
## Consumption Income
## Consumption 1.0000 0.3799
## Income 0.3799 1.0000
summary(modelo1,equation="Income")
##
## VAR Estimation Results:
## =========================
## Endogenous variables: Consumption, Income
## Deterministic variables: trend
## Sample size: 184
## Log Likelihood: -385.38
## Roots of the characteristic polynomial:
## 0.8886 0.5506 0.5506 0.4563 0.2912 0.2912
## Call:
## VAR(y = uschange[, 1:2], p = 3, type = c("trend"))
##
##
## Estimation results for equation Income:
## =======================================
## Income = Consumption.l1 + Income.l1 + Consumption.l2 + Income.l2 + Consumption.l3 + Income.l3 + trend
##
## Estimate Std. Error t value Pr(>|t|)
## Consumption.l1 0.5074199 0.1153193 4.400 1.87e-05 ***
## Income.l1 -0.2460717 0.0796113 -3.091 0.002318 **
## Consumption.l2 0.0634472 0.1204906 0.527 0.599148
## Income.l2 -0.0618530 0.0835532 -0.740 0.460109
## Consumption.l3 0.4073755 0.1153836 3.531 0.000529 ***
## Income.l3 -0.0268248 0.0792028 -0.339 0.735248
## trend 0.0017128 0.0008128 2.107 0.036497 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
##
## Residual standard error: 0.8782 on 177 degrees of freedom
## Multiple R-Squared: 0.4602, Adjusted R-squared: 0.4389
## F-statistic: 21.56 on 7 and 177 DF, p-value: < 2.2e-16
##
##
##
## Covariance matrix of residuals:
## Consumption Income
## Consumption 0.3689 0.2022
## Income 0.2022 0.7683
##
## Correlation matrix of residuals:
## Consumption Income
## Consumption 1.0000 0.3799
## Income 0.3799 1.0000