Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Specify the number of decimals in a matrix


From   Vincent Koppelmans <[email protected]>
To   [email protected]
Subject   st: Specify the number of decimals in a matrix
Date   Wed, 19 Feb 2014 12:22:59 -0500

Dear stata users,

I use plotmatrix (ssc install plotmatrix) to create heat maps. Plotmatrix allows to print the correlation coefficients in the cells, but there is no option to specify the number of decimal places within the plotmatrix syntax.

I was wondering how and where I could manipulate the number of decimals in the correlation matrix in the following syntax:

* 1) Creating the correlation matrix:
local vars DS_sec_ CaR_sec_ CaR_per_ PPB_sec_ RFT_sec_ RFT_med_ RFT_mea_ CuR_sec_ FMT_tot_ FMT_1st_ FMT_2nd_
matrix accum R = `vars' , nocons dev
matrix R = corr(R)
mat list R

* 2) Plotting the heat map:
plotmatrix, m(R) s(-1.01(0.25)1.01) allcolors(green*1 green*0.8 green*0.6 green*0.4 red*0.4 red*0.6 red*0.8 red*1.0 ) maxt(12) freq legend(off)

Thanks for your help!

best,

Vincent
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index