0
$\begingroup$

I am new to Data Science and I have a python data frame with Number of days, CountofJobs, and AmountEarned what statistical method should I use to find a correlation between Days and AmountEarned.

NumberofDays     CountofJobs    AmountEarned
20                3                 50000
22                18                10000
35                10                80000
$\endgroup$
0
$\begingroup$

Whether to use pearson's correlation coefficient or Spearman's correlation coefficient depends on what you want to measure ? Pearson's correlation coefficient measures the strength of a linear relationship between two variables. The variables should be on an interval or ratio scale. Ordinal variables cannot be used in pearson's test. The variables should satisfy certain assumption before the pearson's product moment correlation is applied. They are:

  1. The variables should be approximately normally distributed
  2. There should be no significant outliers in the data
  3. The variables should have a linear relationship

In case, the variables do not satisfy these assumptions they can either be transformed to meet them or we can use the spearman's rank correlation coefficient to measure correlation. The Spearman's method is primarily used when the data can be ranked, therefore correlation between ordinal, interval and ratio variables can be measured using this method. Also, this method measures the strength of a monotonic relationship between two variables.

$\endgroup$

Your Answer

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

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