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?