Marc Bernard
2006-Feb-21 17:15 UTC
[R] Compute a correlation matrix from an existing covariance matrix
Dear All, I am wondering if there is an R function to convert a covariance matrix to a correlation matrix. I have a covariance matrix sigma and I want to compute the corresponding correlation matrix R from sigma. Thank you very much, Bernard --------------------------------- [[alternative HTML version deleted]]
Liaw, Andy
2006-Feb-21 17:27 UTC
[R] Compute a correlation matrix from an existing covariance matrix
See ?cov2cor. Andy From: Marc Bernard> > Dear All, > > I am wondering if there is an R function to convert a > covariance matrix to a correlation matrix. I have a > covariance matrix sigma and I want to compute the > corresponding correlation matrix R from sigma. > > Thank you very much, > > Bernard > > > --------------------------------- > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html > >
Peter Dalgaard
2006-Feb-21 17:34 UTC
[R] Compute a correlation matrix from an existing covariance matrix
Marc Bernard <bernarduse1 at yahoo.fr> writes:> Dear All, > > I am wondering if there is an R function to convert a covariance matrix to a correlation matrix. I have a covariance matrix sigma and I want to compute the corresponding correlation matrix R from sigma.You mean something like cov2cor()? (BTW, why doesn't the page for cor/var/cov/cov2cor show up on help.search("covariance") or help.search("correlation") for me??) -- O__ ---- Peter Dalgaard ??ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
Kjetil Brinchmann Halvorsen
2006-Feb-21 17:35 UTC
[R] Compute a correlation matrix from an existing covariance matrix
Marc Bernard wrote:> Dear All, > > I am wondering if there is an R function to convert a covariance matrix to a correlation matrix. I have a covariance matrix sigma and I want to compute the corresponding correlation matrix R from sigma. >Does cov2cor do what you want? Kjetil> Thank you very much, > > Bernard > > > --------------------------------- > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >
Reasonably Related Threads
- Singular matrix
- Converting variance covariance matrix to correlation matrix
- constructing arbitrary (positive definite) covariance matrix
- generating random covariance matrices (with a uniform distribution of correlations)
- Simulating from a Multivariate Normal Distribution Using a Correlation Matrix