library(readxl)
GP <- read_excel("C:/Users/User1/Desktop/GP.xlsx")
View(GP)
require(vars)
## Zorunlu paket yükleniyor: vars
## Zorunlu paket yükleniyor: MASS
## Zorunlu paket yükleniyor: strucchange
## Zorunlu paket yükleniyor: zoo
##
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
##
## as.Date, as.Date.numeric
## Zorunlu paket yükleniyor: sandwich
## Zorunlu paket yükleniyor: urca
## Zorunlu paket yükleniyor: lmtest
library(urca)
df1 = GP[,2]
df1 <- as.numeric(unlist(df1))
summary(ur.df(df1))
##
## ###############################################
## # Augmented Dickey-Fuller Test Unit Root Test #
## ###############################################
##
## Test regression none
##
##
## Call:
## lm(formula = z.diff ~ z.lag.1 - 1 + z.diff.lag)
##
## Residuals:
## Min 1Q Median 3Q Max
## -30058828 -3954421 953714 5148590 23623793
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## z.lag.1 -0.02006 0.03681 -0.545 0.589
## z.diff.lag -0.21346 0.15552 -1.373 0.178
##
## Residual standard error: 10960000 on 40 degrees of freedom
## Multiple R-squared: 0.05657, Adjusted R-squared: 0.009401
## F-statistic: 1.199 on 2 and 40 DF, p-value: 0.312
##
##
## Value of test-statistic is: -0.5451
##
## Critical values for test statistics:
## 1pct 5pct 10pct
## tau1 -2.62 -1.95 -1.61
varmodeli<-var(2:length(GP),)
VARselect(GP,
type = "none",
lag.max = 8)
## $selection
## AIC(n) HQ(n) SC(n) FPE(n)
## 8 8 2 7
##
## $criteria
## 1 2 3 4 5
## AIC(n) 5.265851e+01 10.73544 10.87689 10.94825 10.83646
## HQ(n) 5.279668e+01 11.01178 11.29140 11.50094 11.52733
## SC(n) 5.305439e+01 11.52720 12.06453 12.53177 12.81586
## FPE(n) 7.409777e+22 46390.79074 54685.99007 61555.22149 59776.81075
## 6 7 8
## AIC(n) 9.903486 9.41151 9.158799
## HQ(n) 10.732522 10.37872 10.264180
## SC(n) 12.278765 12.18267 12.325836
## FPE(n) 26884.987787 20262.21223 21744.415690
var.a <- vars::VAR(GP,
lag.max = 8,
ic = "AIC",
type = "none")