Hi,
My name is Roman and I'm new to this group. I'm working with some IMDB data and was wondering how to get correlations for multiple variables by group using tidyverse functions. For example, I can get correlations for two variables like below, but I don't know how to do it for more than two or even all the variables in the dataset.
I'd like to be able to see correlations for any number of selected variables by group i.e. if I wanted to see the correlation stats between gross, imdb_score, and budget grouped by content_rating for example.
movies %>% group_by(content_rating) %>%
summarise(cor = cor(gross,imdb_score))
content_rating cor
<chr> <dbl>
1 Approved 0.1279158
2 G 0.4070052
3 GP NA
4 M 1.0000000
5 NC-17 -0.7905857
6 Not Rated 0.2543184
7 Passed 0.9909737
8 PG 0.3130682
9 PG-13 0.3216226
10 R 0.2146594
11 Unrated 0.1831069
12 X 0.1597880
Attaching the data here. Thanks all for your time and help.