2017-05-24 77 views
0

我有一些結果總結/列表。如何更改數字?

enter image description here

從在Stata的tabulate命令,但他們似乎有過於詳細,如0.4988995數字。

我想更改summarizetabulate命令的輸出位數。例如,我想看到0.0499而不是0.4988995。

有沒有辦法減少顯示的位數?

回答

0

你不給你使用的代碼。

沒有一個開關來做到這一點,只是各種設備。這裏有一個:

. sysuse auto, clear 
(1978 Automobile Data) 

. tab for rep78, su(mpg) nost nofreq 

          Means of Mileage (mpg) 

      |    Repair Record 1978 
    Car type |   1   2   3   4   5 |  Total 
-----------+-------------------------------------------------------+---------- 
    Domestic |  21  19.125   19 18.444444   32 | 19.541667 
    Foreign |   .   . 23.333333 24.888889 26.333333 | 25.285714 
-----------+-------------------------------------------------------+---------- 
    Total |  21  19.125 19.433333 21.666667 27.363636 | 21.289855 

. egen mean = mean(mpg), by(for rep78) 

. tabdisp for rep78, c(mean) format(%2.1f) 

---------------------------------------------- 
      |   Repair Record 1978   
Car type | 1  2  3  4  5  . 
----------+----------------------------------- 
Domestic | 21.0 19.1 19.0 18.4 32.0 23.3 
    Foreign |    23.3 24.9 26.3 14.0 
---------------------------------------------- 

進一步注意到tabstat產生summarize樣的結果,但有一個選項format()