related analysis
Two variables, X, Y
Variable X | Variable Y | Correlation |
---|---|---|
Increases | Increases | Positive correlation |
Increases | Reduced | Negative correlation |
Increases | Ignore | irrelevant |
Seeking association
协方差
方差
Is used to measure the extent of a single random discrete variable
协方差
is generally used to characterize the degree of similarity of two random variables
Covariance> 0 | X, Y positive correlation |
---|---|
Covariance <0 | X, Y negative correlation |
Covariance = 0 | X, Y independent and unrelated |
pearson相关系数
r in the range [-1, 1]
r value | relativity |
---|---|
0.8-1.0 | Extremely relevant |
0.6-0.8 | Strong correlation |
0.4-0.6 | Moderate related |
0.2-0.4 | Weak correlation |
0-0.2 | No |
Correlation analysis function
method | Explanation |
---|---|
.These () | Covariance matrix |
.corr() | Calculating a correlation coefficient matrix, Pearson, Spearman, Kendall et coefficient |