library(ggplot2)
data <- read.csv("dataset2.csv", sep = ";")
head(data)
## X1 X2 X3 X4 X5 X6 Y
## 1 12.10 34.05 8.50 2.22 64.81 40.2 73.84
## 2 12.45 44.19 10.13 2.20 68.65 32.9 76.87
## 3 13.39 38.66 8.99 1.68 69.07 29.7 77.19
## 4 14.38 26.30 10.04 2.16 69.18 23.6 69.08
## 5 17.86 23.36 10.27 1.46 68.34 33.4 78.27
## 6 13.38 10.06 10.87 1.38 70.14 30.1 84.72
#Scatterplot X1 terhadap Y
ggplot(data, aes(x = X1, y = Y)) +
geom_point(
color = "#F4B400",
alpha = 0.65,
size = 2.5
) +
geom_smooth(
method = "lm",
se = TRUE,
color = "#B7791F",
fill = "#FDE68A",
linewidth = 1
) +
labs(
title = "Scatterplot Variabel X1 terhadap Y",
x = "X1",
y = "Y"
) +
theme_minimal() +
theme(
plot.title = element_text(
face = "bold",
size = 14
),
axis.title = element_text(
face = "bold"
),
panel.grid.minor = element_blank()
)
## `geom_smooth()` using formula = 'y ~ x'

#Scatterplot X2 terhadap Y
ggplot(data, aes(x = X2, y = Y)) +
geom_point(
color = "#F4B400",
alpha = 0.65,
size = 2.5
) +
geom_smooth(
method = "lm",
se = TRUE,
color = "#B7791F",
fill = "#FDE68A",
linewidth = 1
) +
labs(
title = "Scatterplot Variabel X2 terhadap Y",
x = "X2",
y = "Y"
) +
theme_minimal() +
theme(
plot.title = element_text(
face = "bold",
size = 14
),
axis.title = element_text(
face = "bold"
),
panel.grid.minor = element_blank()
)
## `geom_smooth()` using formula = 'y ~ x'

#Scatterplot X3 terhadap Y
ggplot(data, aes(x = X3, y = Y)) +
geom_point(
color = "#F4B400",
alpha = 0.65,
size = 2.5
) +
geom_smooth(
method = "lm",
se = TRUE,
color = "#B7791F",
fill = "#FDE68A",
linewidth = 1
) +
labs(
title = "Scatterplot Variabel X3 terhadap Y",
x = "X3",
y = "Y"
) +
theme_minimal() +
theme(
plot.title = element_text(
face = "bold",
size = 14
),
axis.title = element_text(
face = "bold"
),
panel.grid.minor = element_blank()
)
## `geom_smooth()` using formula = 'y ~ x'

#Scatterplot X4 terhadap Y
ggplot(data, aes(x = X4, y = Y)) +
geom_point(
color = "#F4B400",
alpha = 0.65,
size = 2.5
) +
geom_smooth(
method = "lm",
se = TRUE,
color = "#B7791F",
fill = "#FDE68A",
linewidth = 1
) +
labs(
title = "Scatterplot Variabel X4 terhadap Y",
x = "X4",
y = "Y"
) +
theme_minimal() +
theme(
plot.title = element_text(
face = "bold",
size = 14
),
axis.title = element_text(
face = "bold"
),
panel.grid.minor = element_blank()
)
## `geom_smooth()` using formula = 'y ~ x'

#Scatterplot X5 terhadap Y
ggplot(data, aes(x = X5, y = Y)) +
geom_point(
color = "#F4B400",
alpha = 0.65,
size = 2.5
) +
geom_smooth(
method = "lm",
se = TRUE,
color = "#B7791F",
fill = "#FDE68A",
linewidth = 1
) +
labs(
title = "Scatterplot Variabel X5 terhadap Y",
x = "X5",
y = "Y"
) +
theme_minimal() +
theme(
plot.title = element_text(
face = "bold",
size = 14
),
axis.title = element_text(
face = "bold"
),
panel.grid.minor = element_blank()
)
## `geom_smooth()` using formula = 'y ~ x'

#Scatterplot X6 terhadap Y
ggplot(data, aes(x = X6, y = Y)) +
geom_point(
color = "#F4B400",
alpha = 0.65,
size = 2.5
) +
geom_smooth(
method = "lm",
se = TRUE,
color = "#B7791F",
fill = "#FDE68A",
linewidth = 1
) +
labs(
title = "Scatterplot Variabel X6 terhadap Y",
x = "X6",
y = "Y"
) +
theme_minimal() +
theme(
plot.title = element_text(
face = "bold",
size = 14
),
axis.title = element_text(
face = "bold"
),
panel.grid.minor = element_blank()
)
## `geom_smooth()` using formula = 'y ~ x'
