#Veri seti OEDC puanlarına göre EĞitim Politiklarına ilişkin değişkenleri incelemektedir.

##Genel pakletler

library(dplyr)
## Warning: package 'dplyr' was built under R version 4.4.3
## 
## 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(tidyverse)
## Warning: package 'tidyverse' was built under R version 4.4.3
## Warning: package 'ggplot2' was built under R version 4.4.3
## Warning: package 'tidyr' was built under R version 4.4.3
## Warning: package 'forcats' was built under R version 4.4.3
## Warning: package 'lubridate' was built under R version 4.4.3
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ forcats   1.0.0     ✔ readr     2.1.5
## ✔ ggplot2   4.0.0     ✔ stringr   1.5.1
## ✔ lubridate 1.9.4     ✔ tibble    3.2.1
## ✔ purrr     1.0.2     ✔ tidyr     1.3.1
## ── 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
library(ggplot2)

##Diğer paketler ve veri setine bakış

library(ggpubr) 
## Warning: package 'ggpubr' was built under R version 4.4.3
head(edu_data)
## # A tibble: 6 × 10
##   Country Education_Budget_Incre…¹ Average_Years_of_Sch…² Female_Enrollment_Rate
##   <chr>                      <dbl>                  <dbl>                  <dbl>
## 1 Turkey                        22                    9.6                     93
## 2 Norway                        15                   13.2                     99
## 3 USA                           10                   13.4                     98
## 4 Finland                       18                   13.1                     99
## 5 Japan                         12                   12.8                     98
## 6 Germany                       11                   12.6                     99
## # ℹ abbreviated names: ¹​Education_Budget_Increase_Percent,
## #   ²​Average_Years_of_Schooling
## # ℹ 6 more variables: Education_Inequality_Index <dbl>,
## #   Student_Performance_Index <dbl>, Unemployment_Rate <dbl>,
## #   Youth_Unemployment_Rate <dbl>, Human_Development_Index <dbl>,
## #   Education_Reform_Index <dbl>

##Saçılım grafiği

ggplot(edu_data, aes(x = Education_Reform_Index,
                     y = Student_Performance_Index)) +
  geom_point(color = "steelblue", size = 3) +             
  geom_smooth(method = "lm", se = TRUE, color = "darkred", linetype = "dashed") +  
  stat_cor(method = "pearson",          
           label.x.npc = "left",        
           label.y.npc = "top",         
           size = 5) +                  
  labs(title = "Effect of Education Reform on Student Performance",
       x = "Education Reform Index (0–10)",
       y = "Student Performance Index (0–100)") +
  theme_minimal(base_size = 13)
## `geom_smooth()` using formula = 'y ~ x'

grafikta eğitim reformu ile öğrenci performanası arasında pozitif doğrurasal bir ilişki görülmektedir. İkişkinin düzeyi yüksek düzeydedir ve anlamlıdır [r ≈ 0.91, p < 0.01]

##Bar grafiği, gözlem sayısı az olduğu için box grafiği anlamlı olmadı.

library(ggplot2)

ggplot(edu_data, aes(x = Country, y = Student_Performance_Index, fill = Country)) +
  geom_col(alpha = 0.8) +
  labs(title = "Student Performance by Country",
       x = "Country",
       y = "Student Performance Index (0–100)") +
  theme_minimal(base_size = 13) +
  theme(legend.position = "none")

Bar grafiğine bakıldığında öğrenci başarı indeksi güney kore ve finlandiya diğer ülkelerden daha üsttedir. Türkiye ise daha düşük seviyededir.

##Kolerasyon Haritasi

library(ggcorrplot)
## Warning: package 'ggcorrplot' was built under R version 4.4.3
num_data <- edu_data[, sapply(edu_data, is.numeric)]

cor_matrix <- cor(num_data, use = "complete.obs")

ggcorrplot(cor_matrix,
           method = "circle",
           type = "lower",
           lab = TRUE,
           lab_size = 3,
           colors = c("red", "white", "steelblue"),
           title = "Correlation Matrix of Education Policy Variables",
           ggtheme = theme_minimal())
## Warning: `aes_string()` was deprecated in ggplot2 3.0.0.
## ℹ Please use tidy evaluation idioms with `aes()`.
## ℹ See also `vignette("ggplot2-in-packages")` for more information.
## ℹ The deprecated feature was likely used in the ggcorrplot package.
##   Please report the issue at <https://github.com/kassambara/ggcorrplot/issues>.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.

Burada veri steinin bütün değişkenleri arasındaki ilişki gösteren kolersayon haritası verilmiştir. Education_Reform_Index, Student_Performance_Index ve Human_Development_Index arasında çok güçlü (r ≈ 0.9 ve üzeri) pozitif korelasyonlar var.Bu, eğitim reformlarının ülkelerin hem insani gelişmişlik düzeyine hem de öğrenci başarısına önemli katkı sağladığını gösteriyor.Average_Years_of_Schooling ile Female_Enrollment_Rate de benzer şekilde güçlü pozitif ilişkide (r ≈ 0.88 civarında). Eğitim süresi arttıkça kız öğrenci katılım oranı da artıyor.