Questão 1 - Replicando os resultados de Nelson & Plosser (60 pontos):

Base de Dados e Pacotes de Análise:

library(readxl)
setwd("C:/Users/giord/OneDrive/Área de Trabalho/FGV/FGV  - NOVO/FGV - 9º SEMESTRE/Indicadores Econômicos/Prova Parcial")
dados = read_xls("dados_pp.xls")
dados = data.frame(dados, row.names = 1)
dados = log(dados)

library(urca)

A) Real GNP:

rgnp = dados$RGNP[50:111]
rgnp = ts(rgnp, start = 1909, end = 1970, frequency = 1)
rgnp_adf = ur.df(rgnp, type = "trend", lags = 2)
summary(rgnp_adf)
## 
## ############################################### 
## # Augmented Dickey-Fuller Test Unit Root Test # 
## ############################################### 
## 
## Test regression trend 
## 
## 
## Call:
## lm(formula = z.diff ~ z.lag.1 + 1 + tt + z.diff.lag)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.166182 -0.030344  0.008053  0.030462  0.150420 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)   
## (Intercept)  0.869931   0.293307   2.966  0.00449 **
## z.lag.1     -0.188314   0.064365  -2.926  0.00502 **
## tt           0.006087   0.002042   2.981  0.00430 **
## z.diff.lag1  0.407611   0.127289   3.202  0.00229 **
## z.diff.lag2  0.048316   0.135340   0.357  0.72249   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.05915 on 54 degrees of freedom
## Multiple R-squared:  0.2463, Adjusted R-squared:  0.1905 
## F-statistic: 4.412 on 4 and 54 DF,  p-value: 0.003697
## 
## 
## Value of test-statistic is: -2.9257 4.8801 4.448 
## 
## Critical values for test statistics: 
##       1pct  5pct 10pct
## tau3 -4.04 -3.45 -3.15
## phi2  6.50  4.88  4.16
## phi3  8.73  6.49  5.47

B) Nominal GNP

gnp = dados$GNP[50:111]
gnp = ts(gnp, start = 1909, end = 1970, frequency = 1)
gnp_adf = ur.df(gnp, type = "trend", lags = 2)
summary(gnp_adf) 
## 
## ############################################### 
## # Augmented Dickey-Fuller Test Unit Root Test # 
## ############################################### 
## 
## Test regression trend 
## 
## 
## Call:
## lm(formula = z.diff ~ z.lag.1 + 1 + tt + z.diff.lag)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.291858 -0.040234  0.006546  0.052642  0.195404 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  0.999551   0.475454   2.102 0.040204 *  
## z.lag.1     -0.094783   0.046360  -2.044 0.045793 *  
## tt           0.005239   0.002544   2.059 0.044328 *  
## z.diff.lag1  0.508722   0.129926   3.915 0.000255 ***
## z.diff.lag2 -0.050976   0.136428  -0.374 0.710130    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.08849 on 54 degrees of freedom
## Multiple R-squared:  0.2661, Adjusted R-squared:  0.2118 
## F-statistic: 4.896 on 4 and 54 DF,  p-value: 0.001926
## 
## 
## Value of test-statistic is: -2.0445 3.6798 2.1453 
## 
## Critical values for test statistics: 
##       1pct  5pct 10pct
## tau3 -4.04 -3.45 -3.15
## phi2  6.50  4.88  4.16
## phi3  8.73  6.49  5.47

C) Real per Capita GNP

pcgnp = dados$PCGNP[50:111]
pcgnp = ts(pcgnp, start = 1909, end = 1970, frequency = 1)
pcgnp_adf = ur.df(pcgnp, type = "trend", lags = 2)
summary(pcgnp_adf)
## 
## ############################################### 
## # Augmented Dickey-Fuller Test Unit Root Test # 
## ############################################### 
## 
## Test regression trend 
## 
## 
## Call:
## lm(formula = z.diff ~ z.lag.1 + 1 + tt + z.diff.lag)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.166951 -0.029138  0.004678  0.034746  0.148945 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)   
## (Intercept)  1.377094   0.457508   3.010  0.00397 **
## z.lag.1     -0.197243   0.065680  -3.003  0.00404 **
## tt           0.003826   0.001277   2.997  0.00411 **
## z.diff.lag1  0.398356   0.126901   3.139  0.00275 **
## z.diff.lag2  0.055838   0.134604   0.415  0.67991   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.0598 on 54 degrees of freedom
## Multiple R-squared:  0.2452, Adjusted R-squared:  0.1893 
## F-statistic: 4.386 on 4 and 54 DF,  p-value: 0.00383
## 
## 
## Value of test-statistic is: -3.0031 3.8165 4.6584 
## 
## Critical values for test statistics: 
##       1pct  5pct 10pct
## tau3 -4.04 -3.45 -3.15
## phi2  6.50  4.88  4.16
## phi3  8.73  6.49  5.47

D) Industrial Production

ip = dados$IP
ip = ts(ip, start = 1860, end = 1970, frequency = 1)
ip_adf = ur.df(ip, type = "trend", lags = 6)
summary(ip_adf)
## 
## ############################################### 
## # Augmented Dickey-Fuller Test Unit Root Test # 
## ############################################### 
## 
## Test regression trend 
## 
## 
## Call:
## lm(formula = z.diff ~ z.lag.1 + 1 + tt + z.diff.lag)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.33741 -0.04449  0.01665  0.05137  0.19021 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)  
## (Intercept)  0.059528   0.025591   2.326   0.0221 *
## z.lag.1     -0.168435   0.067593  -2.492   0.0144 *
## tt           0.006884   0.002835   2.428   0.0170 *
## z.diff.lag1  0.124914   0.107550   1.161   0.2484  
## z.diff.lag2 -0.023953   0.101820  -0.235   0.8145  
## z.diff.lag3  0.045999   0.100253   0.459   0.6474  
## z.diff.lag4 -0.030399   0.099522  -0.305   0.7607  
## z.diff.lag5 -0.217744   0.097979  -2.222   0.0286 *
## z.diff.lag6  0.085590   0.100460   0.852   0.3964  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.09769 on 95 degrees of freedom
## Multiple R-squared:  0.1643, Adjusted R-squared:  0.09393 
## F-statistic: 2.335 on 8 and 95 DF,  p-value: 0.02463
## 
## 
## Value of test-statistic is: -2.4919 7.9757 3.1934 
## 
## Critical values for test statistics: 
##       1pct  5pct 10pct
## tau3 -3.99 -3.43 -3.13
## phi2  6.22  4.75  4.07
## phi3  8.43  6.49  5.47

E) Employment:

emp = dados$EMP[31:111]
emp = ts(emp, start = 1890, end = 1970, frequency = 1)
emp_adf = ur.df(emp, type = "trend", lags = 3)
summary(emp_adf)
## 
## ############################################### 
## # Augmented Dickey-Fuller Test Unit Root Test # 
## ############################################### 
## 
## Test regression trend 
## 
## 
## Call:
## lm(formula = z.diff ~ z.lag.1 + 1 + tt + z.diff.lag)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.08250 -0.01153  0.00171  0.01957  0.07632 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  1.6871517  0.5169102   3.264  0.00169 ** 
## z.lag.1     -0.1657344  0.0513632  -3.227  0.00190 ** 
## tt           0.0023828  0.0008009   2.975  0.00400 ** 
## z.diff.lag1  0.4681950  0.1064498   4.398 3.76e-05 ***
## z.diff.lag2 -0.1119140  0.1126999  -0.993  0.32407    
## z.diff.lag3  0.1028858  0.1088433   0.945  0.34773    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.03307 on 71 degrees of freedom
## Multiple R-squared:  0.2762, Adjusted R-squared:  0.2253 
## F-statistic:  5.42 on 5 and 71 DF,  p-value: 0.0002803
## 
## 
## Value of test-statistic is: -3.2267 6.7239 5.5581 
## 
## Critical values for test statistics: 
##       1pct  5pct 10pct
## tau3 -4.04 -3.45 -3.15
## phi2  6.50  4.88  4.16
## phi3  8.73  6.49  5.47

F) Unemployment:

un = dados$UN[31:111]
un = ts(un, start = 1890, end = 1970, frequency = 1)
un_adf = ur.df(un, type = "trend", lags = 4)
summary(un_adf)
## 
## ############################################### 
## # Augmented Dickey-Fuller Test Unit Root Test # 
## ############################################### 
## 
## Test regression trend 
## 
## 
## Call:
## lm(formula = z.diff ~ z.lag.1 + 1 + tt + z.diff.lag)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1.31059 -0.20280 -0.00699  0.23062  0.83850 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)   
## (Intercept)  0.4960271  0.2004062   2.475  0.01578 * 
## z.lag.1     -0.2810985  0.0910128  -3.089  0.00290 **
## tt          -0.0005256  0.0021883  -0.240  0.81088   
## z.diff.lag1  0.3873118  0.1197937   3.233  0.00188 **
## z.diff.lag2 -0.2247957  0.1212136  -1.855  0.06793 . 
## z.diff.lag3  0.2477131  0.1084116   2.285  0.02540 * 
## z.diff.lag4 -0.0400062  0.1102087  -0.363  0.71771   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.4122 on 69 degrees of freedom
## Multiple R-squared:  0.2839, Adjusted R-squared:  0.2216 
## F-statistic: 4.559 on 6 and 69 DF,  p-value: 0.0005967
## 
## 
## Value of test-statistic is: -3.0886 3.2203 4.7992 
## 
## Critical values for test statistics: 
##       1pct  5pct 10pct
## tau3 -4.04 -3.45 -3.15
## phi2  6.50  4.88  4.16
## phi3  8.73  6.49  5.47

G) GNP Deflator:

prgnp = dados$PRGNP[30:111]
prgnp = ts(prgnp, start = 1889, end = 1970, frequency = 1)
prgnp_adf = ur.df(prgnp, type = "trend", lags = 2)
summary(prgnp_adf)
## 
## ############################################### 
## # Augmented Dickey-Fuller Test Unit Root Test # 
## ############################################### 
## 
## Test regression trend 
## 
## 
## Call:
## lm(formula = z.diff ~ z.lag.1 + 1 + tt + z.diff.lag)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.186319 -0.016316  0.000074  0.017632  0.149903 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  0.2769162  0.1060928   2.610 0.010949 *  
## z.lag.1     -0.0918472  0.0357116  -2.572 0.012120 *  
## tt           0.0021845  0.0008171   2.674 0.009230 ** 
## z.diff.lag1  0.4206318  0.1113790   3.777 0.000319 ***
## z.diff.lag2  0.0855415  0.1144034   0.748 0.457000    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.04646 on 74 degrees of freedom
## Multiple R-squared:  0.2573, Adjusted R-squared:  0.2172 
## F-statistic:  6.41 on 4 and 74 DF,  p-value: 0.0001745
## 
## 
## Value of test-statistic is: -2.5719 3.9298 3.5743 
## 
## Critical values for test statistics: 
##       1pct  5pct 10pct
## tau3 -4.04 -3.45 -3.15
## phi2  6.50  4.88  4.16
## phi3  8.73  6.49  5.47

H) Consumer Prices:

cpi = dados$CPI
cpi = ts(cpi, start = 1860, end = 1970, frequency = 1)
cpi_adf = ur.df(cpi, type = "trend", lags = 4)
summary(cpi_adf)
## 
## ############################################### 
## # Augmented Dickey-Fuller Test Unit Root Test # 
## ############################################### 
## 
## Test regression trend 
## 
## 
## Call:
## lm(formula = z.diff ~ z.lag.1 + 1 + tt + z.diff.lag)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.169538 -0.012808  0.000006  0.017828  0.105750 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  0.1093128  0.0472578   2.313  0.02279 *  
## z.lag.1     -0.0409796  0.0149072  -2.749  0.00711 ** 
## tt           0.0008581  0.0002027   4.234 5.15e-05 ***
## z.diff.lag1  0.5519046  0.0885481   6.233 1.13e-08 ***
## z.diff.lag2 -0.2599878  0.1042206  -2.495  0.01427 *  
## z.diff.lag3  0.1305110  0.1026455   1.271  0.20654    
## z.diff.lag4 -0.0199930  0.0835096  -0.239  0.81128    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.038 on 99 degrees of freedom
## Multiple R-squared:  0.4221, Adjusted R-squared:  0.3871 
## F-statistic: 12.05 on 6 and 99 DF,  p-value: 3.969e-10
## 
## 
## Value of test-statistic is: -2.749 6.7219 9.405 
## 
## Critical values for test statistics: 
##       1pct  5pct 10pct
## tau3 -3.99 -3.43 -3.13
## phi2  6.22  4.75  4.07
## phi3  8.43  6.49  5.47

I) Wages:

wg = dados$WG[41:111]
wg = ts(wg, start = 1900, end = 1970, frequency = 1)
wg_adf = ur.df(wg, type = "trend", lags = 3)
summary(wg_adf)
## 
## ############################################### 
## # Augmented Dickey-Fuller Test Unit Root Test # 
## ############################################### 
## 
## Test regression trend 
## 
## 
## Call:
## lm(formula = z.diff ~ z.lag.1 + 1 + tt + z.diff.lag)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.160970 -0.026380  0.004898  0.024368  0.139041 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  0.588511   0.254990   2.308   0.0244 *  
## z.lag.1     -0.095280   0.042551  -2.239   0.0288 *  
## tt           0.003997   0.001746   2.288   0.0256 *  
## z.diff.lag1  0.546002   0.123251   4.430 3.98e-05 ***
## z.diff.lag2 -0.096335   0.139529  -0.690   0.4925    
## z.diff.lag3  0.062032   0.127595   0.486   0.6286    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.06075 on 61 degrees of freedom
## Multiple R-squared:  0.2944, Adjusted R-squared:  0.2366 
## F-statistic:  5.09 on 5 and 61 DF,  p-value: 0.000578
## 
## 
## Value of test-statistic is: -2.2392 4.1249 2.6192 
## 
## Critical values for test statistics: 
##       1pct  5pct 10pct
## tau3 -4.04 -3.45 -3.15
## phi2  6.50  4.88  4.16
## phi3  8.73  6.49  5.47

J) Real Wages:

rwg = dados$RWG[41:111]
rwg = ts(rwg, start = 1900, end = 1970, frequency = 1)
rwg_adf = ur.df(rwg, type = "trend", lags = 2)
summary(rwg_adf)
## 
## ############################################### 
## # Augmented Dickey-Fuller Test Unit Root Test # 
## ############################################### 
## 
## Test regression trend 
## 
## 
## Call:
## lm(formula = z.diff ~ z.lag.1 + 1 + tt + z.diff.lag)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.090435 -0.017603 -0.002577  0.017592  0.088688 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)   
## (Intercept)  0.510118   0.168551   3.026  0.00358 **
## z.lag.1     -0.178520   0.060042  -2.973  0.00417 **
## tt           0.003761   0.001228   3.062  0.00323 **
## z.diff.lag1  0.245234   0.119343   2.055  0.04404 * 
## z.diff.lag2  0.021920   0.122396   0.179  0.85844   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.03509 on 63 degrees of freedom
## Multiple R-squared:  0.1669, Adjusted R-squared:  0.114 
## F-statistic: 3.155 on 4 and 63 DF,  p-value: 0.01988
## 
## 
## Value of test-statistic is: -2.9732 6.2316 4.7115 
## 
## Critical values for test statistics: 
##       1pct  5pct 10pct
## tau3 -4.04 -3.45 -3.15
## phi2  6.50  4.88  4.16
## phi3  8.73  6.49  5.47

K) Money Stock:

m = dados$M[30:111]
m = ts(m, start = 1889, end = 1970, frequency = 1)
m_adf = ur.df(m, type = "trend", lags = 2)
summary(m_adf)
## 
## ############################################### 
## # Augmented Dickey-Fuller Test Unit Root Test # 
## ############################################### 
## 
## Test regression trend 
## 
## 
## Call:
## lm(formula = z.diff ~ z.lag.1 + 1 + tt + z.diff.lag)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.146482 -0.019578 -0.001253  0.019018  0.113876 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  0.132927   0.038119   3.487 0.000825 ***
## z.lag.1     -0.087035   0.029255  -2.975 0.003955 ** 
## tt           0.004994   0.001713   2.916 0.004692 ** 
## z.diff.lag1  0.601354   0.110028   5.465 5.95e-07 ***
## z.diff.lag2  0.077361   0.115714   0.669 0.505859    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.04691 on 74 degrees of freedom
## Multiple R-squared:  0.4348, Adjusted R-squared:  0.4042 
## F-statistic: 14.23 on 4 and 74 DF,  p-value: 1.161e-08
## 
## 
## Value of test-statistic is: -2.975 6.0443 4.4531 
## 
## Critical values for test statistics: 
##       1pct  5pct 10pct
## tau3 -4.04 -3.45 -3.15
## phi2  6.50  4.88  4.16
## phi3  8.73  6.49  5.47

L) Velocity:

vel = dados$VEL[10:111]
vel = ts(vel, start = 1869, end = 1970, frequency = 1)
vel_adf = ur.df(vel, type = "trend", lags = 1)
summary(vel_adf)
## 
## ############################################### 
## # Augmented Dickey-Fuller Test Unit Root Test # 
## ############################################### 
## 
## Test regression trend 
## 
## 
## Call:
## lm(formula = z.diff ~ z.lag.1 + 1 + tt + z.diff.lag)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.156282 -0.035278  0.004818  0.042358  0.142090 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)  
## (Intercept)  0.0650269  0.0544974   1.193   0.2357  
## z.lag.1     -0.0644365  0.0367516  -1.753   0.0827 .
## tt          -0.0004586  0.0005115  -0.896   0.3722  
## z.diff.lag   0.1210574  0.1017588   1.190   0.2371  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.06724 on 96 degrees of freedom
## Multiple R-squared:  0.0622, Adjusted R-squared:  0.03289 
## F-statistic: 2.122 on 3 and 96 DF,  p-value: 0.1024
## 
## 
## Value of test-statistic is: -1.7533 2.3638 2.5503 
## 
## Critical values for test statistics: 
##       1pct  5pct 10pct
## tau3 -3.99 -3.43 -3.13
## phi2  6.22  4.75  4.07
## phi3  8.43  6.49  5.47

M) Interest Rate:

bnd = exp(dados$BND[41:111])
bnd = ts(bnd, start = 1900, end = 1970, frequency = 1)
bnd_adf = ur.df(bnd, type = "trend", lags = 3)
summary(bnd_adf)
## 
## ############################################### 
## # Augmented Dickey-Fuller Test Unit Root Test # 
## ############################################### 
## 
## Test regression trend 
## 
## 
## Call:
## lm(formula = z.diff ~ z.lag.1 + 1 + tt + z.diff.lag)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2.57711 -0.21400 -0.03212  0.18740  1.55434 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)  
## (Intercept) -0.484415   0.359266  -1.348   0.1825  
## z.lag.1      0.088737   0.084712   1.048   0.2990  
## tt           0.006489   0.003279   1.979   0.0523 .
## z.diff.lag1 -0.398203   0.158387  -2.514   0.0146 *
## z.diff.lag2 -0.191998   0.158134  -1.214   0.2294  
## z.diff.lag3 -0.089862   0.145108  -0.619   0.5380  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.4989 on 61 degrees of freedom
## Multiple R-squared:  0.1237, Adjusted R-squared:  0.05187 
## F-statistic: 1.722 on 5 and 61 DF,  p-value: 0.1431
## 
## 
## Value of test-statistic is: 1.0475 2.0001 2.2042 
## 
## Critical values for test statistics: 
##       1pct  5pct 10pct
## tau3 -4.04 -3.45 -3.15
## phi2  6.50  4.88  4.16
## phi3  8.73  6.49  5.47

N) Common Stock Prices:

sp500 = dados$SP500[12:111]
sp500 = ts(sp500, start = 1871, end = 1970, frequency = 1)
sp500_adf = ur.df(sp500, type = "trend", lags = 3)
summary(sp500_adf)
## 
## ############################################### 
## # Augmented Dickey-Fuller Test Unit Root Test # 
## ############################################### 
## 
## Test regression trend 
## 
## 
## Call:
## lm(formula = z.diff ~ z.lag.1 + 1 + tt + z.diff.lag)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.63422 -0.11260  0.01245  0.11410  0.29904 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)   
## (Intercept)  0.095552   0.057131   1.673  0.09790 . 
## z.lag.1     -0.097999   0.045802  -2.140  0.03509 * 
## tt           0.003302   0.001383   2.387  0.01908 * 
## z.diff.lag1  0.302346   0.106838   2.830  0.00574 **
## z.diff.lag2 -0.147538   0.107752  -1.369  0.17433   
## z.diff.lag3  0.052388   0.107600   0.487  0.62753   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1562 on 90 degrees of freedom
## Multiple R-squared:  0.1366, Adjusted R-squared:  0.08868 
## F-statistic: 2.849 on 5 and 90 DF,  p-value: 0.01959
## 
## 
## Value of test-statistic is: -2.1396 2.8281 2.8497 
## 
## Critical values for test statistics: 
##       1pct  5pct 10pct
## tau3 -4.04 -3.45 -3.15
## phi2  6.50  4.88  4.16
## phi3  8.73  6.49  5.47

Tabela de Resultados:

#COLUNA 1 - NOME DAS VARIÁVEIS:
Series = c("Real GNP", "Nominal GNP", "Real per Capita GNP", "Industrial Production", "Employment", "Unemployment Rate", "GNP Deflator", "Consumer Prices", "Wages", "Real Wages", "Money Stock", "Velocity", "Interest Rate", "Common Stock Prices")

#COLUNA 2 - NÚMERO DE OBSERVAÇÕES:
T = c(length(rgnp_adf@y),
      length(gnp_adf@y),
      length(pcgnp_adf@y),
      length(ip_adf@y),
      length(emp_adf@y),
      length(un_adf@y),
      length(prgnp_adf@y),
      length(cpi_adf@y),
      length(wg_adf@y),
      length(rwg_adf@y),
      length(m_adf@y),
      length(vel_adf@y),
      length(bnd_adf@y),
      length(sp500_adf@y))

#COLUNA 3 - NÚMERO DE LAGS:
k = c(rgnp_adf@lags,
      gnp_adf@lags,
      pcgnp_adf@lags,
      ip_adf@lags,
      emp_adf@lags,
      un_adf@lags,
      prgnp_adf@lags,
      cpi_adf@lags,
      wg_adf@lags,
      rwg_adf@lags,
      m_adf@lags,
      vel_adf@lags,
      bnd_adf@lags,
      sp500_adf@lags)

#COLUNA 4 - ESTIMATIVA DO INTERCEPTO:
u = c(rgnp_adf@testreg$coefficients[1,1],
      gnp_adf@testreg$coefficients[1,1],
      pcgnp_adf@testreg$coefficients[1,1],
      ip_adf@testreg$coefficients[1,1],
      emp_adf@testreg$coefficients[1,1],
      un_adf@testreg$coefficients[1,1],
      prgnp_adf@testreg$coefficients[1,1],
      cpi_adf@testreg$coefficients[1,1],
      wg_adf@testreg$coefficients[1,1],
      rwg_adf@testreg$coefficients[1,1],
      m_adf@testreg$coefficients[1,1],
      vel_adf@testreg$coefficients[1,1],
      bnd_adf@testreg$coefficients[1,1],
      sp500_adf@testreg$coefficients[1,1])

u = round(u,3)


#COLUNA 5 - ESTATÍSTICA DE TESTE DO INTERCEPTO:
t_u = c(rgnp_adf@testreg$coefficients[1,3],
      gnp_adf@testreg$coefficients[1,3],
      pcgnp_adf@testreg$coefficients[1,3],
      ip_adf@testreg$coefficients[1,3],
      emp_adf@testreg$coefficients[1,3],
      un_adf@testreg$coefficients[1,3],
      prgnp_adf@testreg$coefficients[1,3],
      cpi_adf@testreg$coefficients[1,3],
      wg_adf@testreg$coefficients[1,3],
      rwg_adf@testreg$coefficients[1,3],
      m_adf@testreg$coefficients[1,3],
      vel_adf@testreg$coefficients[1,3],
      bnd_adf@testreg$coefficients[1,3],
      sp500_adf@testreg$coefficients[1,3])

t_u = round(t_u,2)


#COLUNA 6 - ESTIMATIVA DA TENDÊNCIA DETERMINÍSTICA:
y = c(rgnp_adf@testreg$coefficients[3,1],
      gnp_adf@testreg$coefficients[3,1],
      pcgnp_adf@testreg$coefficients[3,1],
      ip_adf@testreg$coefficients[3,1],
      emp_adf@testreg$coefficients[3,1],
      un_adf@testreg$coefficients[3,1],
      prgnp_adf@testreg$coefficients[3,1],
      cpi_adf@testreg$coefficients[3,1],
      wg_adf@testreg$coefficients[3,1],
      rwg_adf@testreg$coefficients[3,1],
      m_adf@testreg$coefficients[3,1],
      vel_adf@testreg$coefficients[3,1],
      bnd_adf@testreg$coefficients[3,1],
      sp500_adf@testreg$coefficients[3,1])

y = round(y,3)


#COLUNA 7 - ESTATÍSTICA DE TESTE DA TENDÊNCIA DETERMINÍSTICA:
t_y = c(rgnp_adf@testreg$coefficients[3,3],
      gnp_adf@testreg$coefficients[3,3],
      pcgnp_adf@testreg$coefficients[3,3],
      ip_adf@testreg$coefficients[3,3],
      emp_adf@testreg$coefficients[3,3],
      un_adf@testreg$coefficients[3,3],
      prgnp_adf@testreg$coefficients[3,3],
      cpi_adf@testreg$coefficients[3,3],
      wg_adf@testreg$coefficients[3,3],
      rwg_adf@testreg$coefficients[3,3],
      m_adf@testreg$coefficients[3,3],
      vel_adf@testreg$coefficients[3,3],
      bnd_adf@testreg$coefficients[3,3],
      sp500_adf@testreg$coefficients[3,3])

t_y = round(t_y,2)


#COLUNA 8 - ESTIMATIVA DA AUTOCORRELAÇÃO:
p = c(exp(rgnp_adf@testreg$coefficients[2,1]),
      exp(gnp_adf@testreg$coefficients[2,1]),
      exp(pcgnp_adf@testreg$coefficients[2,1]),
      exp(ip_adf@testreg$coefficients[2,1]),
      exp(emp_adf@testreg$coefficients[2,1]),
      exp(un_adf@testreg$coefficients[2,1]),
      exp(prgnp_adf@testreg$coefficients[2,1]),
      exp(cpi_adf@testreg$coefficients[2,1]),
      exp(wg_adf@testreg$coefficients[2,1]),
      exp(rwg_adf@testreg$coefficients[2,1]),
      exp(m_adf@testreg$coefficients[2,1]),
      exp(vel_adf@testreg$coefficients[2,1]),
      exp(bnd_adf@testreg$coefficients[2,1]),
      exp(sp500_adf@testreg$coefficients[2,1]))

p = round(p,3)


#COLUNA 9 - ESTATÍSTICA DE TESTE DA AUTOCORRELAÇÃO:
t_p = c(rgnp_adf@testreg$coefficients[2,3],
      gnp_adf@testreg$coefficients[2,3],
      pcgnp_adf@testreg$coefficients[2,3],
      ip_adf@testreg$coefficients[2,3],
      emp_adf@testreg$coefficients[2,3],
      un_adf@testreg$coefficients[2,3],
      prgnp_adf@testreg$coefficients[2,3],
      cpi_adf@testreg$coefficients[2,3],
      wg_adf@testreg$coefficients[2,3],
      rwg_adf@testreg$coefficients[2,3],
      m_adf@testreg$coefficients[2,3],
      vel_adf@testreg$coefficients[2,3],
      bnd_adf@testreg$coefficients[2,3],
      sp500_adf@testreg$coefficients[2,3])

t_p = round(t_p,2)


library(knitr)
tab = cbind(Series, T, k, u, t_u, y, t_y, p, t_p)
tab = data.frame(tab)
kable(tab, caption = "Teste para Raízes Unitárias Autoregressivas")
Teste para Raízes Unitárias Autoregressivas
Series T k u t_u y t_y p t_p
Real GNP 62 2 0.87 2.97 0.006 2.98 0.828 -2.93
Nominal GNP 62 2 1 2.1 0.005 2.06 0.91 -2.04
Real per Capita GNP 62 2 1.377 3.01 0.004 3 0.821 -3
Industrial Production 111 6 0.06 2.33 0.007 2.43 0.845 -2.49
Employment 81 3 1.687 3.26 0.002 2.98 0.847 -3.23
Unemployment Rate 81 4 0.496 2.48 -0.001 -0.24 0.755 -3.09
GNP Deflator 82 2 0.277 2.61 0.002 2.67 0.912 -2.57
Consumer Prices 111 4 0.109 2.31 0.001 4.23 0.96 -2.75
Wages 71 3 0.589 2.31 0.004 2.29 0.909 -2.24
Real Wages 71 2 0.51 3.03 0.004 3.06 0.837 -2.97
Money Stock 82 2 0.133 3.49 0.005 2.92 0.917 -2.98
Velocity 102 1 0.065 1.19 0 -0.9 0.938 -1.75
Interest Rate 71 3 -0.484 -1.35 0.006 1.98 1.093 1.05
Common Stock Prices 100 3 0.096 1.67 0.003 2.39 0.907 -2.14