# Binary variable: split data into separate sets, or use binary as independent variable

Let's say I have a classic dataset containing some data about participants. The data includes gender, weight, length, area code, income. Let's also assume that gender is binary encoded, whereas weight, length, income are numeric/continuous variables and the area codes are categorical.

I am trying to find some correlations between these variables with a simple Pearson test for each possible combination. You'll get the following pairs for which Pearson's is calculated:

gender - weight
gender - length
gender - income
gender - area
weight - length
weight - income
weight - area
length - income
length - area
income - area


When I showed these pairs (and their respective r-correlations and p-values), my promoter told me it seemed more logical to them to split up the dataset based on the binary variable, i.e., build two sets one where gender == 0 and one where gender == 1, and then calculate correlations for the remaining variables. So for each set, that would mean the following remaining pairs:

weight - length
weight - income
weight - area
length - income
length - area
income - area


When we have done this, we could then compare the results of both tests, they said. But I am confused, why would you do it like this? What is the benefit?

How I see it, in my approach you calculate the correlation between the gender variable and the other variables. You get a detailed analysis (r and p) so you know how big a role the gender variable plays for each variable. The proposed approach simply calculates something different: it will show whether the variables are correlated when gender is 0, and when it is 1 - but there is no information on how large the role is that the gender variable plays.

My question, then, is: what is the best approach if you are simply trying to find correlations between a set of independent variables? When should I split up my dataset in smaller datasets? And if I have split up my datasets, is there a way to find the impact of splitting up (i.e., the impact of the binary variable)?