相关系数计算公式(Correlation coefficient calculation
formula)
Introduction of statistical correlation coefficient
Since the correlation coefficients of statistics are relatively frequent, this is a simple introduction to the coefficients.
Correlation coefficient: to examine the correlation between two things (in the data we call variables).
If there are two variables: X and Y, the meanings of the relevant coefficients calculated in the end can be understood as follows:
(1) when the correlation coefficient is 0, X and Y are unrelated.
(2) when the value of X increas (decreas), the Y value increas (decreas), the two variables are positive correlation, and the correlation coefficient is between 0.00 and 1.00.
(3) when the value of X increas (decreas), the Y value decreas (increas), the two variables are negative correlation, and the correlation coefficient is between -1.00 and 0.00.
The greater the absolute value of the correlation coefficient, the stronger the correlation, the clor the correlation韩国语
coefficient is to 1 or -1, the stronger the correlation, the clor the correlation coefficient is to 0, the weaker the correlation coefficient.万圣节的英文
The relative strength of variables is usually determined by the following values:
Correlation coefficient 0.8-1.0 strongly correlated
0.6 0.8 strong correlation
The moderate degree of 0.4-0.6 is related
0.2 0.4 weak correlation
0.0-0.2 extremely weak correlation or no correlation
Pearson (Pearson) correlation coefficient
1, the introduction of
Pearson correlation is also known as product difference correlation (or product moment correlation), which is a method of calculating linear correlation propod by the British statistician Pearson in the 20th century.
Assuming there are two variables, X and Y, the Pearson correlation coefficient between the two variables can be calculated by the following formula:柚子的英文
A formula:
Formula 2:
Three formula:
Formula of four:
The four formulas listed above are equivalent, where E is the mathematical expectation, cov means covariance, N is the number of variables.
2. Scope of application
妈的英语
情商是什么意思
When the standard deviation of two variables is not zero, the correlation coefficient is defined and Pearson correlation coefficient applies to:
(1) the linear relationship between two variables is continuous data.
(2) the general distribution of the normal distribution or the normal distribution of the two variables is a normal distribution.
(3) the obrved values of two variables are paired, and each pair is independent of each other.
3. Matlab
Pearson correlation coefficient Matlab implementation (bad on formula four implementation) :
(CPP) view plaincopy
Function coeff = myPearson (X, Y)
The calculation of Pearson correlation coefficient is realized by %
independence%
% input:
汽车玻璃划痕% X: the input value quence
% Y: the input value quence
%
% output:
% coeff: the correlation coefficients of two input values, X, Y
%
If length (X) ~ = length (Y)
Error (" the dimension of two numeric columns is not equal ");
The return;
雅思词汇胜经pdf
The end
Fenzi = sum (X) * Y) - (sum sum (X) * (Y))/length (X);
Fenmu = SQRT ((sum (X.
^ 2) - the sum (X) ^ 2 / length (X)) * (sum (Y) ^ 2) - the sum (Y) ^ 2 / length (X)));
Coeff = fenzi/fenmu;
End % function myPearson is over
The Pearson correlation coefficient can also be calculated using the existing functions in Matlab:burden
(CPP) view plaincopy
Coeff = corr (X, Y);
4. References
Spearman Rank correlation coefficient
1, the introduction of
kindaIn statistics, the Spearman rank correlation coefficient is named after Charles Spearman and is often reprented by the Greek letter rho (rho). The spillman class correlation coefficient is ud to estimate the correlation between two variables, X and Y, and the correlation between variables can