Hi guys,
I would appreciate it if you can help me with the following:
Is there any easy way to calculate UNCENTERED correlation in Stata?
In particular, I have a matrix and I am interested in calculating the
uncentered correlation between the different columns.
Currently, I have written a code that calculates the (regular -- i.e.,
Pearson's) correlation (fyi -- see below).
Thanks,
Gary
Calculating correlation in a matrix:
matrix B=J(43,43,0)
local i=1
while `i' <=43 {
local j=1
while `j'<= 43 {
corr mfctr`i' mfctr`j'
if r(rho) ~=. {matrix B[`i',`j']=r(rho)}
else {matrix B[`i',`j']=9}
local temp=0
local j=`j'+1
}
local i=`i'+1
}
svmat B
*
* 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/