Correlation Matrix in R (cov.wt)

2

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 .

    
asked by anonymous 12.08.2014 / 22:24

1 answer

1

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
    
13.08.2014 / 01:36