我试图在程序中包括一种显示存储在矩阵foo
中的结果的方法。
例如:
matrix list foo
foo[3,4]
income94 income95 income96 income97
Leonardo_P~e 28933.207 31086.043 22887.057 13892.101
Anastasia_~n 22675.248 25079.514 31893.809 25042.568
Yaretzi_Hu~n 36232.047 33241.23 30130.705 30281.227
但是,行名不完整,应为:
Leonardo_Payne
Anastasia_Burton
Yaretzi_Huffmando
如何完整显示它们?
答案 0 :(得分:1)
要显示Stata矩阵的内容,总是最好使用matlist
命令而不是matrix list
。前者提供了几个选项来控制矩阵的显示格式。
在这种情况下,您需要选项twidth()
:
matrix foo = J(3, 4, 31086.043)
matrix colnames foo = income94 income95 income96 income97
matrix rownames foo = Leonardo_Payne Anastasia_Burton Yaretzi_Huffmando
matlist foo, twidth(20)
| income94 income95 income96 income97
---------------------+--------------------------------------------
Leonardo_Payne | 31086.04 31086.04 31086.04 31086.04
Anastasia_Burton | 31086.04 31086.04 31086.04 31086.04
Yaretzi_Huffmando | 31086.04 31086.04 31086.04 31086.04
在Stata的命令提示符下键入help matlist
,以获取更多详细信息。