Statalist


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

st: saving output of -correlate, c- in two submatrixes for later use


From   [email protected]
To   [email protected]
Subject   st: saving output of -correlate, c- in two submatrixes for later use
Date   Tue, 06 Nov 2007 17:41:00 +0100

I have a panel of some dozens of variables: ns x* z*. I would like to:
(1) save some of the output of -correlate x* z*, c- in two matrixes, X (containing only that portion of the output about the (co)variances between the x* variables and themselves) and Z (containing only that portion of the output about the covariances between the x* variables and the z* variables), e.g.
   x1 x2 ... xn z1 ... zn
x1 XXXXXXXXXXXX ZZZZZZZZZ  
x2 XXXXXXXXXXXX ZZZZZZZZZ
...XXXXXXXXXXXX ZZZZZZZZZ
xn XXXXXXXXXXXX ZZZZZZZZZ
z1 .......useless........
..........portion........
zn ..of...the...output...
Why can't I find the output with -ereturn list-, such as after -mean()-?
(2) and then to find the matrix A such that Z*A=X/sq where sq is the scalar given by the sum of the squares of the values contained in variable ns. (I know that A is -matrix A= inv(Z)*X/sq-, but has Stata 9 any simple command to calculate sq? And can I save the value of sq in some variable for later use in a for i=1...sq statement?)

Thanks in advance,
Nicola 

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index