#memanggil Dataset 1
data=read.table(file.choose(), header=T)
data
##      Y  X1   X2   X3
## 1 57.5  78 2.75 29.5
## 2 52.8  69 2.15 26.3
## 3 61.3  77 4.41 32.2
## 4 67.0  88 5.52 36.5
## 5 53.5  67 3.21 27.2
## 6 62.7  80 4.32 27.7
## 7 56.2  74 2.31 28.3
## 8 68.5  94 4.30 30.3
## 9 69.2 102 3.71 28.7
#memanggil library 
library(ggplot2)
#Scatter plot antara variabel X1 dan Y

ggplot(data, aes(x = X1, y = Y)) +
  geom_point(color = "purple4", size = 3) +
  geom_smooth(method = "lm", color = "goldenrod2",
              se = FALSE, linewidth = 1.3) +
  scale_x_continuous(breaks = seq(65, 105, by = 5)) +
  scale_y_continuous(breaks = seq(50, 70, by = 2)) +
  labs(
    title = "Scatter Plot X1 terhadap Y",
    x = "Variabel X1",
    y = "Variabel Y"
  ) +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

#Scatter plot antara variabel X2 dan Y

ggplot(data, aes(x = X2, y = Y)) +
  geom_point(color = "purple4", size = 3) +
  geom_smooth(method = "lm", color = "goldenrod2",
              se = FALSE, linewidth = 1.3) +
  scale_x_continuous(breaks = seq(2, 6, by = 0.5)) +
  scale_y_continuous(breaks = seq(50, 70, by = 2)) +
  labs(
    title = "Scatter Plot X2 terhadap Y",
    x = "Variabel X2",
    y = "Variabel Y"
  ) +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

#Scatter plot antara variabel X3 dan Y

ggplot(data, aes(x = X3, y = Y)) +
  geom_point(color = "purple4", size = 3) +
  geom_smooth(method = "lm", color = "goldenrod2",
              se = FALSE, linewidth = 1.3) +
  scale_x_continuous(breaks = seq(25, 40, by = 2)) +
  scale_y_continuous(breaks = seq(50, 70, by = 2)) +
  labs(
    title = "Scatter Plot X3 terhadap Y",
    x = "Variabel X3",
    y = "Variabel Y"
  ) +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'