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: RE: decimal points after tabulate,summarise( )
From
Nick Cox <[email protected]>
To
"'[email protected]'" <[email protected]>
Subject
st: RE: decimal points after tabulate,summarise( )
Date
Fri, 18 Nov 2011 18:21:21 +0000
Change the display format of -var2-.
. sysuse auto, clear
(1978 Automobile Data)
. tab rep78, su(mpg)
Repair | Summary of Mileage (mpg)
Record 1978 | Mean Std. Dev. Freq.
------------+------------------------------------
1 | 21 4.2426407 2
2 | 19.125 3.7583241 8
3 | 19.433333 4.1413252 30
4 | 21.666667 4.9348699 18
5 | 27.363636 8.7323849 11
------------+------------------------------------
Total | 21.289855 5.8664085 69
. d mpg
storage display value
variable name type format label variable label
--------------------------------------------------------------------------
mpg int %8.0g Mileage (mpg)
. format mpg %4.2f
. tab rep78, su(mpg)
Repair | Summary of Mileage (mpg)
Record 1978 | Mean Std. Dev. Freq.
------------+------------------------------------
1 | 21.00 4.24 2
2 | 19.13 3.76 8
3 | 19.43 4.14 30
4 | 21.67 4.93 18
5 | 27.36 8.73 11
------------+------------------------------------
Total | 21.29 5.87 69
Nick
[email protected]
Nikolaos Pandis
Is there a way to limit the decimal after the command:
tabulate var1,summarise(var2)
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/