In the cov.wt function in R is it possible to get only the Correlation matrix?
cov.wt = Returns a list with estimates of the weighted covariance matrix and the mean of the data, and optionally of the (weighted) correlation matrix .
In the cov.wt function in R is it possible to get only the Correlation matrix?
cov.wt = Returns a list with estimates of the weighted covariance matrix and the mean of the data, and optionally of the (weighted) correlation matrix .
Reading the source code of the cov.wt
vi references to functions cov2cor
and cor
. If these functions do not return the exact same result of the above function you can implement your own solution by reusing the linked source code. Of course you can also simply dismiss the remaining results and only have the correlation matrix:
cor <- cov.wt(xy, wt = w1, method = "ML", cor = TRUE)$cor