# Packages
library(ggplot2)

# Memanggil Data
data <- read.csv("dataset1.csv",sep = ";")
# Scatterplot X1 terhadap Y
ggplot(data, aes(x = X1, y = Y)) +
  geom_point(
    color = "#2563EB",
    alpha = 0.7,
    size = 3
  ) +
  geom_smooth(
    method = "lm",
    se = TRUE,
    color = "#1E3A8A",
    fill = "#93C5FD",
    linewidth = 1
  ) +
  labs(
    title = "Scatterplot variabel X1 terhadap Y",
    subtitle = "Hubungan antara X1 dan Y",
    x = "X1",
    y = "Y"
  ) +
  theme_minimal() +
  theme(
    plot.title = element_text(face = "bold", size = 14),
    plot.subtitle = element_text(size = 10),
    axis.title = element_text(face = "bold")
  )
## `geom_smooth()` using formula = 'y ~ x'

# Scatterplot X2 terhadap Y
ggplot(data, aes(x = X2, y = Y)) +
  geom_point(
    color = "#2563EB",
    alpha = 0.7,
    size = 3
  ) +
  geom_smooth(
    method = "lm",
    se = TRUE,
    color = "#1E3A8A",
    fill = "#93C5FD",
    linewidth = 1
  ) +
  labs(
    title = "Scatterplot variabel X2 terhadap Y",
    subtitle = "Hubungan antara X2 dan Y",
    x = "X2",
    y = "Y"
  ) +
  theme_minimal() +
  theme(
    plot.title = element_text(face = "bold", size = 14),
    plot.subtitle = element_text(size = 10),
    axis.title = element_text(face = "bold")
  )
## `geom_smooth()` using formula = 'y ~ x'

# Scatterplot X3 terhadap Y
ggplot(data, aes(x = X3, y = Y)) +
  geom_point(
    color = "#2563EB",
    alpha = 0.7,
    size = 3
  ) +
  geom_smooth(
    method = "lm",
    se = TRUE,
    color = "#1E3A8A",
    fill = "#93C5FD",
    linewidth = 1
  ) +
  labs(
    title = "Scatterplot variabel X3 terhadap Y",
    subtitle = "Hubungan antara X3 dan Y",
    x = "X3",
    y = "Y"
  ) +
  theme_minimal() +
  theme(
    plot.title = element_text(face = "bold", size = 14),
    plot.subtitle = element_text(size = 10),
    axis.title = element_text(face = "bold")
  )
## `geom_smooth()` using formula = 'y ~ x'