Korelasi Pearson

Persiapan Data

x <- c(22, 17, 19, 21, 25, 22, 15, 17, 19, 23, 23, 20, 15, 25, 18)
y <- c(78, 70, 77, 76, 82, 80, 69, 72, 69, 74, 78, 74, 70, 85, 75)

Korelasi Pearson

cor(x, y, method = "pearson")