This post提供R中加权Pearson相关的函数,即function(x, y, weights)
。 Spearman等级相关系数是否有推论?
答案 0 :(得分:0)
乳胶:
\begin{align}
\bar{x} & = \frac{\sum_{i=1}^n{w_i x_i}}{\sum_{i=1}^n{w_i}} \quad
\bar{y} = \frac{\sum_{i=1}^n{w_i y_i}}{\sum_{i=1}^n{w_i}} \\
s_{x,y} & = \frac{\sum_{i=1}^n{w_i (x_i - \bar{x}_i) (y_i - \bar{y}_i)}}{\sum_{i=1}^n{w_i}} \quad
s_x = \frac{\sum_{i=1}^n{w_i (x_i - \bar{x})}}{w_i} \quad
s_y = \frac{\sum_{i=1}^n{w_i (y_i - \bar{y})}}{w_i} \\
r(x,y,w) & = \frac{s_{x,y}}{\sqrt{s_x s_y}}
\end{align}