I am trying to get a summary table in Stata using the community-contibuted command estout
.
However, I want to specify the number of decimals displayed per variable as opposed to the default which is per summary statistic.
As you can see in my code below, I know how to control the decimals for a summary statistic as a whole (e.g. the mean is displayed with no decimals):
* Summary statistics
eststo clear
estpost tabstat length weight, stat(mean median sd min max n) columns(statistics)
esttab using summstat1.rtf, cells("mean(label(Mean) fmt(2)) p50(label(Median)
fmt(0)) sd(label(ST. Dev) fmt(2)) min(label(Min) fmt(2)) max(label(Max) fmt(2))
count(label(N) fmt(0))") label title("Summary Statistics") nonumbers lines noobs replace
What I want specifically is the following:
- the
length
variable to be of the format175
(i.e. no decimals) - the
weight
variable to be formatted such as60.545
(i.e. three decimals)
Of course, I could try to scale my variables by dividing or multiplying times a factor 10
, but this is not my problem and it something not desirable.