Hello everyone,

I was wondering if there is a way to assign weights (or something similar like standard deviations (SD)) to individual values of a matrix used for a correlation analysis.

So for example we have the mtcars data matrix and use the corr and ggcorrplot function to do the correlation analysis:

# get input matrix

data(mtcars)

# do correlation analysis

corr <- cor(mtcars)

# show results

head(corr[, 1:6])

But what I would like to do is to assign an individual weight to each value of the mtcars matrix before using it for the correlation analysis. So lets say this is our data:

...then for example I would like to assign "mpg" of "Mazda Rx4" with a SD of 1 and the "disp" of "Mazda Rx4" with a SD of 0.7. And so on.

In the correlation analysis, the individual SD should then be regarded (e.g. vaules with a higher assigned SD should have less impact on the correlation analysis).

Is there some way to do this? All correlation analysis functions I was able to find only accepted the input matrix as... well... input. But no input on individual SD or something like that.

Any ideas?