Dear Statalister,
many commands automatically store results in r(), either scalar, local or matrices. I focus in the latter case.
I'd like to access directly to some values in the matrix stored. See the example below :
The matrix of the correlation coefficient is store under the name r(C).
However any direct use of r(C) doesn't work. See :
However, I've get this information using an intermediate matrix m set equal to r(C). And now the commands that didn't work directly on r(C) work on m
I've done :
Is there a way to get this info without creating m?
Thanks,
Charlie
Ps : I know that concerning correlation coefficient I could have simply done two by two correlations, which directly store in the local r(rho) avoiding a matrix, but this was for illustrational purposes. Indeed I use corrci command, which returns only matrixes.
many commands automatically store results in r(), either scalar, local or matrices. I focus in the latter case.
I'd like to access directly to some values in the matrix stored. See the example below :
Code:
sysuse auto.dta,clear corr mpg price trunk return list
However any direct use of r(C) doesn't work. See :
Code:
matrix list r(C) local b1=r(C)[1,2] di `b1'
I've done :
Code:
matrix m=r(C) matrix list m local c1=m[1,2] di `c1' local c2=m[1,3] di `c2'
Thanks,
Charlie
Ps : I know that concerning correlation coefficient I could have simply done two by two correlations, which directly store in the local r(rho) avoiding a matrix, but this was for illustrational purposes. Indeed I use corrci command, which returns only matrixes.
Comment