I have a very basic question concerning how to compare the responses of two groups of subjects, group = A and group = B, to a same test. The responses are stored in x.
My starting dataset is in the following form:
id group x
1 A 15
2 A 17
3 A 22
...
50 B 22
51 B 12
52 B 13
...
My initial idea was to split x into two variables xA and xB, and then to sort both of them according to their group, like this:
xA xB
15 12
17 13
22 22
... ...
Then I wanted to run a simple Pearson's test between the newly created xA and xB.
To me this strategy seems rather artificial: I am sorting the variables before making the comaparison, which makes very likely to find some sort of linear dependence...
I am interested in evaluating whether there is some sort of accordance between the subjects of the two grous in answering to the test. I also thought to adopt a Wilcoxon test on the equality of the medians of the two variables.
Which strategy would you suggest?