Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: storing correlations


From   Kit Baum <baum@bc.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: Re: storing correlations
Date   Wed, 23 May 2007 07:52:57 -0400

sacrificial complex eigenvalue

No way to directly store a matrix of correlations in a variable, but you can store them as a matrix:

mat accum cov = var1 var2 var3, noco dev
mat corr = corr(cov)
mat list corr

Now if you really wanted them stored in a variable,

matvech corr veccorr (using matvech from dm79, by N J Cox)
svmat veccorr
list veccorr1 if veccorr1 < .

One could also do this in Mata very easily.


Kit Baum, Boston College Economics and DIW Berlin
http://ideas.repec.org/e/pba1.html
An Introduction to Modern Econometrics Using Stata:
http://www.stata-press.com/books/imeus.html


On May 23, 2007, at 2:33 AM, statalist-digest wrote:


I want to store the correlation coefficient into a
variable. After I run corr var1 var2 var3
i see the correlation coefficient output table. I
searched online and it is said the correlate result
should be stored in matrix rho(r), but when I tried in
stata 9. I can't find it. Could anyone please help me
on this. many thanks in advance
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index