Correlation Matrix in R (cov.wt)

Asked

Viewed 1,606 times

2

In the cov.wt function in R it is possible to obtain as a result only the Correlation Matrix ?

cov.wt = Returns a list containing estimates of the Weighted covariance Matrix and the Mean of the data, and Optionally of the (Weighted) correlation Matrix.

1 answer

1


Reading the source code of function cov.wt vi references to the functions cov2cor and cor. If these functions do not return the exact same function result above you can implement your own solution by reusing the linked source code. Of course you can also simply discard the other results and stick to the correlation matrix only:

cor <- cov.wt(xy, wt = w1, method = "ML", cor = TRUE)$cor
  • That’s it there was just put $color at the end, thank you. cov.wt serves best for what I want which is an exponentially adjusted correlation.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.