Subdividing a dataset I know I can subdivide a dataset by socio-demographic factors such as gender, age, income level etc. and analyse the responses for each set separately and then compare the results.
For example, I am testing the relationship between Variable A (hours of study) and Variable B (exam marks), and I have a dataset made up of 400 students. I have subdivided the dataset by gender and have 220 male students and 180 female students. I can run Pearson correlation on hours of study and exam marks separately for male students and for female students.
While the above is fairly straight forward, my difficulty is in dividing my dataset by a factor that is not a socio-economic factor. I want to divide my dataset by two locations as follows:


*

*School (hours of study vs. exam marks)

*Home (hours of study vs. exam marks)


To do this, I included a simple statement in my questionnaire that asked "where do you generally do most of your assignments?". The answer is either "home" (coded as "1") or "school" (coded as "2"). 
This is a forced statement and I have deliberately made this nominal coding to avoid correlating it with the two variables I am testing. In my mind (which is not very statistically-orientated!), this statement functions like the socio-demograhic factors as above i.e. is a constant because I have deliberately coded it that way. 
At the end of the day, and depending on my findings, I want to say something like "The relationship between hours of study and exam marks is stronger for students who completed their assignments in school".
Is this a risky approach?
 A: I'm not sure what model you are running, but let's see if I can alleviate your fears.
You are looking at the relationship between reported hours of study and exam marks. You are looking at this relationship within four different groups.


*

*Males who report mostly working at home.

*Females who report mostly working at home.

*Males who report mostly working at school.

*Females who report mostly working at school.


You might say that you are stratifying or blocking by gender and location.
The sort of conclusion that you would like to make does not reference gender, so let's combine the groups.


*

*Students who report mostly working at home.

*Students who report mostly working at school.


Let's make an indicator variable for school and then regress exam marks on hours of study, location and their interaction.
$mark=\beta_0+\beta_1\times hours+\beta_2 \times school+\beta_3\times hours \times school$
If $\beta_1$ is significantly different from zero, you can say that there is a relationship between hours of study and exam marks.
If $\beta_2$ is significantly different from zero, you can say that students who work at school have higher/lower (higher if the sign of $\beta_2$ is positive) marks, on average, than students who work at home.
If $\beta_3$ is significantly different from zero, you could say that the relationship between hours of study and exam marks is stronger/weaker (stronger if $\beta_3$ has the same sign as $\beta_2$) for students who completed their assignments in school. But this is a bit unclear because people might use "strength" of a relationship to refer to $R^2$ rather than $\beta$, so I would try to say it more concretely.
I'm having trouble coming up with a good way to say it without implying causality, so here's a way that implies causality, just to give you an idea of what I mean by"concretely": "An additional hour of study has more/less of an impact on exam mark among students who report working mostly at school."
And plot all four of these groups on the same graph (maybe a color-coded scatterplot) if you haven't already.
