library(readxl)
## Warning: package 'readxl' was built under R version 4.4.2
TA <- read_excel("TA.xlsx")
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 4.4.2
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(tidyr)
library(tseries)
## Registered S3 method overwritten by 'quantmod':
##   method            from
##   as.zoo.data.frame zoo
adf.test(TA$Turk_Parasi)
## Warning in adf.test(TA$Turk_Parasi): p-value smaller than printed p-value
## 
##  Augmented Dickey-Fuller Test
## 
## data:  TA$Turk_Parasi
## Dickey-Fuller = -4.5444, Lag order = 3, p-value = 0.01
## alternative hypothesis: stationary
adf.test(TA$Yabanci_Para)
## 
##  Augmented Dickey-Fuller Test
## 
## data:  TA$Yabanci_Para
## Dickey-Fuller = -0.72339, Lag order = 3, p-value = 0.9598
## alternative hypothesis: stationary
adf_results <- list()

TOPLAM AKTİFLERE AİT ADF TESTİ

library(urca)
## Warning: package 'urca' was built under R version 4.4.3
adf_results$Turk_Parasi <- ur.df(diff(TA$Turk_Parasi), type = "drift", lags = 1)
summary(adf_results$Turk_Parasi)
## 
## ############################################### 
## # Augmented Dickey-Fuller Test Unit Root Test # 
## ############################################### 
## 
## Test regression drift 
## 
## 
## Call:
## lm(formula = z.diff ~ z.lag.1 + 1 + z.diff.lag)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1088728   -71491   -19944   117323   507234 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)
## (Intercept)  5.968e+04  5.837e+04   1.023    0.314
## z.lag.1     -1.321e-01  8.792e-02  -1.502    0.142
## z.diff.lag  -1.800e-02  2.505e-01  -0.072    0.943
## 
## Residual standard error: 275600 on 34 degrees of freedom
## Multiple R-squared:  0.06822,    Adjusted R-squared:  0.01341 
## F-statistic: 1.245 on 2 and 34 DF,  p-value: 0.3008
## 
## 
## Value of test-statistic is: -1.5023 1.1364 
## 
## Critical values for test statistics: 
##       1pct  5pct 10pct
## tau2 -3.58 -2.93 -2.60
## phi1  7.06  4.86  3.94
adf_results$Yabanci_Para <- ur.df(diff(TA$Yabanci_Para), type = "drift", lags = 1)
summary(adf_results$Yabanci_Para)
## 
## ############################################### 
## # Augmented Dickey-Fuller Test Unit Root Test # 
## ############################################### 
## 
## Test regression drift 
## 
## 
## Call:
## lm(formula = z.diff ~ z.lag.1 + 1 + z.diff.lag)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1374412  -188432   -75306   128091  1497679 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)   
## (Intercept)  1.783e+05  1.013e+05   1.760  0.08738 . 
## z.lag.1     -7.683e-01  2.500e-01  -3.073  0.00415 **
## z.diff.lag  -2.391e-01  1.991e-01  -1.201  0.23793   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 479100 on 34 degrees of freedom
## Multiple R-squared:  0.4467, Adjusted R-squared:  0.4141 
## F-statistic: 13.72 on 2 and 34 DF,  p-value: 4.27e-05
## 
## 
## Value of test-statistic is: -3.0734 4.7464 
## 
## Critical values for test statistics: 
##       1pct  5pct 10pct
## tau2 -3.58 -2.93 -2.60
## phi1  7.06  4.86  3.94
adf_results$Toplam <- ur.df(diff(TA$Toplam), type = "drift", lags = 1)
summary(adf_results$Toplam)
## 
## ############################################### 
## # Augmented Dickey-Fuller Test Unit Root Test # 
## ############################################### 
## 
## Test regression drift 
## 
## 
## Call:
## lm(formula = z.diff ~ z.lag.1 + 1 + z.diff.lag)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2763196  -147995   -22898   128080  1893404 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)  
## (Intercept)  1.677e+05  1.485e+05   1.129   0.2669  
## z.lag.1     -2.487e-01  1.447e-01  -1.719   0.0947 .
## z.diff.lag  -4.177e-01  2.304e-01  -1.813   0.0787 .
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 684000 on 34 degrees of freedom
## Multiple R-squared:  0.2278, Adjusted R-squared:  0.1824 
## F-statistic: 5.015 on 2 and 34 DF,  p-value: 0.01235
## 
## 
## Value of test-statistic is: -1.7188 1.4774 
## 
## Critical values for test statistics: 
##       1pct  5pct 10pct
## tau2 -3.58 -2.93 -2.60
## phi1  7.06  4.86  3.94