如何在 Stata 中使用四舍五入到小数点后两位创建相关矩阵?

How to create a correlation matrix using rounding to two decimal places in Stata?

我希望在相关矩阵中四舍五入到小数点后两位。我用于矩阵的代码是这样的:

corr RELATIONSHIP TotalOwnerCommission anxiety enjoyment BEH_SIM sptconf NEG_EFFICACY spteffort SPTEFFORT_OTHER SIM_VALUES COOP_MOTIV COMP_MOTIV

如何四舍五入矩阵中的小数位,使它们尾随?

. sysuse auto, clear
(1978 Automobile Data)

. ssc install cpcorr 

. cpcorr mpg weight price, format(%3.2f)
(obs=74)

           mpg  weight   price
   mpg    1.00
weight   -0.81    1.00
 price   -0.47    0.54    1.00