# What values to choose for correlation?

To work out correlation I'm using the online calculator : http://easycalculation.com/statistics/correlation.php

Data set 'A' :
value1 = 1;
value2 = 1;
value3 = 1;
value4 = 1;

Data set 'B' :
value1 = 1;
value2 = 1;
value3 = 1;
value4 = 1;


For these values the correlation between 'A' & 'B' is 'invalid'

For correlation I need to assign each value a unique number ? How do I decide these values and how they should increase, or does it matter what these values are as long as they are unique ?

Something like :

Data set 'A' :
value1 = 1;
value2 = 2;
value3 = 3;
value4 = 4;

Data set 'B' :
value1 = 1;
value2 = 2;
value3 = 3;
value4 = 4;


or :

Data set 'A' :
value1 = 1;
value2 = 1.1;
value3 = 1.2;
value4 = 1.3;

Data set 'B' :
value1 = 1;
value2 = 1.1;
value3 = 1.2;
value4 = 1.3;


The reason I can choose the values is that I am basing it group of users and words associated with them. For example here is a dataset that contains usernames and they words associated with those users :

username, associated words
user1   , test1,test2,test3
user2   . test3,test4


Can I associate any value with these words as long each value is distinct and is the same for each user ? Each word has a distinct value, test3 has value 3, so the above dataset becomes :

username, associated word values
user1   , 1,2,3
user2   . 3,4


But I can also change these values, so test3 now has a value of 6 and should not affect correlation since I have changed the value from 3 to 6 for bother user1 & user2 ? :

username, associated word values
user1   , 1,2,6
user2   . 6,4

• You need at least two distinct numbers in each group for the formula to be well-defined. See this. If all observations are the same in one group, then the corresponding term in the denominator is $0$. – Stefan Hansen Apr 18 '13 at 11:44
• @Stefan Hansen ok so it not does affect correlation between the 'associated words' as long as each number is distinct in the group and each number in groupA is same for groupB when the associated word is equal ? – blue-sky Apr 18 '13 at 11:56
• I don't think I said that. I was just responding to why the online calculator said the correlation was invalid. As for the rest I don't what you mean. Maybe you should try and reformulate your question so it becomes more clear. – Stefan Hansen Apr 18 '13 at 12:00
• @StefanHansen I have updated my question from text 'The reason I can choose the values ..... ' I hope this better explains what I am trying to achieve. – blue-sky Apr 18 '13 at 12:12
• So, you want some kind of measure of similarity of words between two users? Then you shouldn't use correlation at all. Correlation can be interpreted when there is a linear relationship between two continuous variables. This is not the case here. – Stefan Hansen Apr 18 '13 at 12:24

The Pearson correlation is used to measure the strength of linear relationship between two continuous variables $X$ and $Y$, and hence it does not fit the purpose here.