Ekilebilir arazi (arazi alanının yüzdesi) ve Ekilebilir arazi (kişi
başı hektar)
library(WDI)
df = WDI(indicator=c(eyuz='AG.LND.ARBL.ZS', ehek='AG.LND.ARBL.HA.PC' ), country=c('TR'), start=1992, end=2020)
library(dynlm)
## Zorunlu paket yükleniyor: zoo
##
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
##
## as.Date, as.Date.numeric
df.ts <- ts(df, start=c(1992), end=c(2020),frequency=1)
df.ts<-df.ts[,c("eyuz","ehek")]
plot(df.ts[,"eyuz"], ylab="arazi alaninin yuzdesi")

plot(df.ts[,"ehek"], ylab="kisi basi hektar")

gecikmelieyuz <- data.frame(cbind(df.ts[,"eyuz"], lag(df.ts[,"eyuz"],-1)))
names(gecikmelieyuz) <- c("eyuz","eyuz1gec")
head(gecikmelieyuz)
## eyuz eyuz1gec
## 1 31.85167 NA
## 2 31.80879 31.85167
## 3 32.09984 31.80879
## 4 32.03357 32.09984
## 5 31.85167 32.03357
## 6 31.56972 31.85167
ekilebilirarazi <- df.ts[,"ehek"]
deltahektar <- diff(df.ts[,"eyuz"])
plot(ekilebilirarazi)

plot(deltahektar)

phillips.reg <- dynlm(ekilebilirarazi~deltahektar)
summary(phillips.reg)
##
## Time series regression with "ts" data:
## Start = 1993, End = 2018
##
## Call:
## dynlm(formula = ekilebilirarazi ~ deltahektar)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.09172 -0.06383 0.01261 0.05217 0.09060
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.34291 0.01364 25.144 <2e-16 ***
## deltahektar 0.03264 0.02668 1.223 0.233
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.06144 on 24 degrees of freedom
## (0 observations deleted due to missingness)
## Multiple R-squared: 0.05868, Adjusted R-squared: 0.01945
## F-statistic: 1.496 on 1 and 24 DF, p-value: 0.2332
uhat <- resid(phillips.reg)
plot(uhat)

acf(uhat)

library(lmtest)
bgtest(phillips.reg, order=1, type="F")
##
## Breusch-Godfrey test for serial correlation of order up to 1
##
## data: phillips.reg
## LM test = 114.84, df1 = 1, df2 = 23, p-value = 2.04e-10
library(lmtest)
bgtest(phillips.reg, order=1, type="Chisq")
##
## Breusch-Godfrey test for serial correlation of order up to 1
##
## data: phillips.reg
## LM test = 21.662, df = 1, p-value = 3.252e-06
library(sandwich)
## Warning: package 'sandwich' was built under R version 4.1.3
coeftest(phillips.reg, vcov.=vcovHAC(phillips.reg))
##
## t test of coefficients:
##
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.342915 0.025623 13.3830 1.266e-12 ***
## deltahektar 0.032638 0.021508 1.5175 0.1422
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
coeftest(phillips.reg, vcov.=NeweyWest(phillips.reg))
##
## t test of coefficients:
##
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.342915 0.073086 4.6919 9.089e-05 ***
## deltahektar 0.032638 0.031695 1.0298 0.3134
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
coeftest(phillips.reg, vcov.=kernHAC(phillips.reg))
##
## t test of coefficients:
##
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.342915 0.069958 4.9017 5.334e-05 ***
## deltahektar 0.032638 0.031784 1.0269 0.3147
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1