library(readxl)
library(ggplot2)

Dataset 1

data1 <- read_excel("Dataset 1 dan 2 Regnon.xlsx",
                    sheet = "Dataset 1")

data1
## # A tibble: 9 × 4
##       Y    X1    X2    X3
##   <dbl> <dbl> <dbl> <dbl>
## 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      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.3   30.3
## 9  69.2   102  3.71  28.7

1a. Scatter Plot X1 terhadap Y

ggplot(data1, aes(x = X1, y = Y)) +
  geom_point(size = 3) +
  geom_smooth(method = "lm", se = FALSE) +
  labs(
    title = "Scatter Plot X1 terhadap Y - Dataset 1",
    x = "X1",
    y = "Y"
  ) +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

1b. Scatter Plot X2 terhadap Y

ggplot(data1, aes(x = X2, y = Y)) +
  geom_point(size = 3) +
  geom_smooth(method = "lm", se = FALSE) +
  labs(
    title = "Scatter Plot X2 terhadap Y - Dataset 1",
    x = "X2",
    y = "Y"
  ) +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

1c. Scatter Plot X3 terhadap Y

ggplot(data1, aes(x = X3, y = Y)) +
  geom_point(size = 3) +
  geom_smooth(method = "lm", se = FALSE) +
  labs(
    title = "Scatter Plot X3 terhadap Y - Dataset 1",
    x = "X3",
    y = "Y"
  ) +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'