I have two variables, let's say, Variable A and B. Variable A contains marks of all subjects and variable B contains marks of a specific subject. Number of student (sample) is 50. I have to calculate correlation between A and B using Pearson / Spearman depending on normality test.

What I have found?

I have read Article 1, Article 2 and some research papers regarding Correlation coefficient, specially this one. However, I have not got the answer of this question explicitly.

Including value of B in A and excluding value of B from A shows different results.

My Question

For each student, since A value (total marks) contains value of B (specific subject marks), should I exclude B value from A for each of the student at the time of correlation coefficient calculation?

  • 1
    $\begingroup$ In other words, you have something like $A = Drama + Algebra + Virology + English$ that you want to compare to $B = English$? $\endgroup$
    – Dave
    Oct 2, 2019 at 18:47
  • $\begingroup$ Can you clarify Variable A and Variable B? Is Variable A the sum of all the students' marks at different points in time and Variable B is just one student's marks at the same points in time? $\endgroup$ Oct 2, 2019 at 18:47
  • 1
    $\begingroup$ @SabbirAhmed Then you're not comparing $A$ and $B$. Yes, there a dependence between $A$ and $B$, but that's okay for correlation. What can get you in trouble is if observations of $A$ depend on other observations of $A$, such as if you're tracking how a particular student does over time, but that does not appear to be the case here. Just calculate $cor(A,B)$. $\endgroup$
    – Dave
    Oct 2, 2019 at 19:03
  • 1
    $\begingroup$ Agree with @Dave. But, it also depends on the question you care about. If the question is "how much does a student's scores in other subjects correlate to their score in English?" then you should do $cor(A - B, B)$ $\endgroup$ Oct 2, 2019 at 19:06
  • 1
    $\begingroup$ @SabbirAhmed Is your goal to see how $English$ correlated with $Drama + Algebra + Virology$? Then you would do $cor(A-B,B)$. If you are interested in how $English$ is correlated with $Drama + Algebra + Virology + English$, the you want $cor(A,B)$. $\endgroup$
    – Dave
    Oct 2, 2019 at 19:12

1 Answer 1


Let's get an answer posted instead of leaving an answer in the comments.

The setup: there are 50 students, each measured on their scores in Drama class, Algebra class, Virology class, and English class. Call variable $A$ the sum of all four scores: $A = Drama + Algebra + Virology + English$. Call variable $B$ the English score.

We are potentially interested in two correlation problems. First is how the score in English class correlates with the overall score. In this case, we want to calculate $cor(A,B)$. Second is how the score in English class correlates with the scores in the other classes. In this case, we want to calculate $cor(A-B,B)$.

It is fine that the $A$ and $B$ variables are related (dependent). In fact, we kind of count on there being a relationship if we're bothering to calculate correlation!


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.