In this report, we explore the relationship between public sector innovation and AI capability. Various factors such as research and development funding, data governance, ethics, and international collaboration play significant roles in shaping AI development across countries. This report aims to identify key trends and impacts.
```{r} # Load necessary libraries library(dplyr) library(ggplot2)
data <- read.csv(“path_to_your_merged_data.csv”)
head(data)
# Correlation analysis between selected variables cor(data$AI_Capability, data$R_and_D_Funding)
# Perform regression analysis model <- lm(AI_Capability ~ R_and_D_Funding + Data_Governance + Ethics, data = data) summary(model)
# Perform clustering analysis using k-means kmeans_result <- kmeans(scale(data[, c(“AI_Capability”, “R_and_D_Funding”)]), centers = 3)
clusplot(data, kmeans_result$cluster, color = TRUE, shade = TRUE, labels = 2, lines = 0)
# Trend analysis over time (if time variable is present) ggplot(data, aes(x = Date, y = AI_Capability)) + geom_line() + labs(title = “AI Capability over Time”)
# Visualize the impact of specific policies on AI Capability ggplot(data, aes(x = Policy, y = AI_Capability)) + geom_bar(stat = “identity”, fill = “lightblue”) + labs(title = “Policy Impact on AI Capability”)