Re: Compute a weighted correlation



youngjin.michael@xxxxxxxxx wrote:
Hello,

Is there a way to assign weights to data before compute a simple
correlation?
I was googling, but not able to find any answer to this.
Thanks in advance.

Young-Jin

Weighted Mean:
m[x;w] = (sum_i w_i*x_i)/(sum_i w_i)

Weighted Covariance:
c[x,y;w] = (sum_i w_i*(x_i - m[x;w])*(y_i - m[y;w]))/(sum_i w_i)

Weighted Correlation:
r[x,y;w] = c[x,y;w]/sqrt(c[x,x;w]*c[y,y;w])

.