Dünya bankasından veri indirmek

library(WDI)

AG.LND.AGRI.ZS AG.LND.ARBL.ZS

data <- WDI(indicator= c("AG.LND.AGRI.ZS","AG.LND.ARBL.ZS"))

kesit veri

2005

library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.4     ✔ readr     2.1.5
## ✔ forcats   1.0.0     ✔ stringr   1.5.1
## ✔ ggplot2   3.5.1     ✔ tibble    3.2.1
## ✔ lubridate 1.9.3     ✔ tidyr     1.3.1
## ✔ purrr     1.0.2     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
data2005 <- data %>% filter(year==2005)

zaman serisi

dataTR <- data %>% filter(country=="Turkiye")
library(ggplot2)
ggplot(dataTR, aes(year, AG.LND.AGRI.ZS)) + geom_line()
## Warning: Removed 3 rows containing missing values or values outside the scale range
## (`geom_line()`).

ggplot(dataTR, aes(year, AG.LND.ARBL.ZS )) + geom_line()
## Warning: Removed 3 rows containing missing values or values outside the scale range
## (`geom_line()`).

Regresyon

model <- lm(AG.LND.AGRI.ZS ~ AG.LND.ARBL.ZS, data = dataTR)
summary(model)
## 
## Call:
## lm(formula = AG.LND.AGRI.ZS ~ AG.LND.ARBL.ZS, data = dataTR)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.8282 -0.9894 -0.1915  1.0122  3.1537 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)    46.53673    2.54678  18.273   <2e-16 ***
## AG.LND.ARBL.ZS  0.12504    0.08319   1.503    0.138    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.526 on 59 degrees of freedom
##   (3 observations deleted due to missingness)
## Multiple R-squared:  0.03688,    Adjusted R-squared:  0.02056 
## F-statistic: 2.259 on 1 and 59 DF,  p-value: 0.1382