R demo | Correlation Matrix | How to conduct, visualise and interpret
5.2 هزار بار بازدید -
3 سال پیش
-
Having several numeric variables, we
Having several numeric variables, we often wanna know which of them are correlated and how. Correlation Matrix seems to be a good solution for it. But drawing conclusions from plain correlation coeffitients and p-values is dangerous, if we don’t visualize the data. Let’s learn a better way to produce a correlation matrix.
Here is a quick R code:
install.packages("PerformanceAnalytics")
library("PerformanceAnalytics")
chart.Correlation(iris[, 1:3])
install.packages("tidyverse")
library(tidyverse) # for "aes()"
install.packages("GGally")
library(GGally)
ggpairs(iris,
columns = 1:3,
aes(colour=Species),
lower = list(continuous = "smooth"),
upper = list(continuous = wrap("cor",
method = "pearson")))
If you only want more code (or want to support me), consider join the channel (join button below any of the videos), because I provide the code upon members requests.
Enjoy! 🥳
Here is a quick R code:
install.packages("PerformanceAnalytics")
library("PerformanceAnalytics")
chart.Correlation(iris[, 1:3])
install.packages("tidyverse")
library(tidyverse) # for "aes()"
install.packages("GGally")
library(GGally)
ggpairs(iris,
columns = 1:3,
aes(colour=Species),
lower = list(continuous = "smooth"),
upper = list(continuous = wrap("cor",
method = "pearson")))
If you only want more code (or want to support me), consider join the channel (join button below any of the videos), because I provide the code upon members requests.
Enjoy! 🥳
3 سال پیش
در تاریخ 1400/10/19 منتشر شده
است.
5,264
بـار بازدید شده