I. Correlation coefficient:

  • The correlation coefficient: Examine the degree of correlation between two variables. The value range of correlation coefficient is -1 to 1. The closer the absolute value is to 1, the greater the degree of correlation between the two variables is. The closer the absolute value is to 0, the smaller the correlation between the two variables is, as shown in the following figure:

Ii. Pearson correlation Coefficient:

  • 1. Formula derivation is given first:

    • ① According to the definition of Pearson’s correlation coefficient,

    • ② Here, the numerator cov represents the covariance and the denominator represents the standard deviation (take two variables as examples) :

    Why is this n minus 1 in the denominator instead of n? It is to enable us to better approximate the population with smaller samples, that is, to achieve the effect of “unbiased estimation”, see:Blog.csdn.net/hearthougan…

    • (3) Pearson’s correlation coefficient can be calculated by:
  • 2. Pearson correlation coefficient can be used to measure the degree of linear correlation between variables, but it has certain application conditions:

Spearman correlation coefficient

  • 1. In general, Spearman’s correlation coefficient was calculated in the same way as Pearson’s correlation coefficient, except that the real value of the feature was replaced by the rank of the feature. For example, given three values: 30, 50 and 10, their levels are 2,3,1, respectively. The values of 30, 50 and 10 are replaced by levels 2,3,1

  • 2. As usual, first give the formula (two kinds) :

    • A formula:

    • Formula 2:

  • 3. Application scope:

    • ① Compared with Pearson correlation coefficient, Spearman correlation coefficient is insensitive to data errors and extreme values.
    • (2) the spearman rank correlation coefficient to the requirement of data conditions without strict Pearson correlation coefficient, as long as the observed values of two variables is pairs of rating data, or by continuous variable observation data for the level of information, regardless of the overall distribution of the two variables, morphology, the size of the sample size, can use spearman rank correlation coefficient for research.