0
$\begingroup$

I have 2 numeric vectors:

A = [1] 0.09112019 0.01648917 0.09959314 0.18508083 0.43382979 0.47615469 0.02759358 0.20501685 0.11723475
[10] 0.25235056 1.01360047 0.23293548 0.02809754 0.18917008 0.12235214 0.25779546 1.11210158 0.29427705
[19] 0.46955788 0.34303692 0.26483973 0.12400529 0.77529471 0.05599909 0.08754854 0.16293734 0.20511528
[28] 0.64192924 0.15366982 0.57283905 0.29810925 0.54156768 0.06472627 0.06320937 0.07423829 0.05349911
[37] 0.45069070 0.58086056 0.17868721 0.12797566 0.18313978 0.38640191 0.09796483 0.15190912

B = [1] 1586  200  315  489  200 2044  306  271  253  610  282  200  799  200  200  200  400  628  289  447  258
[22]  200  200  375  200  200  200  280  609  779  200  200  200  200  703  200  309  200  200  200  200  200
[43]  886  412

My hypothesis is that when A goes up, B also goes up, and I want to calculate the correlation between these two vectors and visualize it.

These two vectors are not normally distributed.

The scatterplot does not clearly show the correlation, it is very hard to infer anything from it. Pearson correlation gave me a negative correlation, while Spearman gave me a postivie correlation. Both of them gave very hight p-value, about 0.9, so both of them are not significant.

Hence, I cant figure it out.. I just need to find the correlation score, the right way.

This is the scatterplot:

enter image description here

$\endgroup$
6
  • 1
    $\begingroup$ Neither Spearman nor Pearson correlations make any assumptions about normality. You can always compute them provided each of the variables exhibits at least two distinct values. As always, you are best off by first examining the scatterplot. $\endgroup$
    – whuber
    Jun 23 at 20:59
  • $\begingroup$ As you have rightly observed, the scatter plot indicates no correlation. This is confirmed by the correlation coefficient $r_{xy}$, which is 0.05: values close to zero mean no correlation. The confidence interval for $r_{xy}$ is much wider (-0.25, 0.34), but it includes zero, which also inidcates that there is no correlation. $\endgroup$
    – cdalitz
    Jun 24 at 7:48
  • 1
    $\begingroup$ A correlation coefficient will add very little information and does not provide a useful description of these data. What do you really want to accomplish with your analysis? $\endgroup$
    – whuber
    Jun 24 at 14:26
  • $\begingroup$ For a better understanding of the data, I suggest plotting the transformed (e.g. log) values. There maybe more visible correlations afterward. $\endgroup$ Jun 24 at 14:56
  • $\begingroup$ @whuber well these two vectors are features in wide cancer study. There is a hypothesis that when one vector goes up, it makes the seond one go up also. We are trying to test that. $\endgroup$
    – PythonNoob
    Jun 25 at 9:39

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.