I am trying to get a summary table in Stata using the Estout package. However, I want to specify the number of decimals displayed per variable (NOT per summary statistic).
The following example is similar to my actual dataset:
As you can see in my code example, I know how to control the decimals for a summary statistic as a whole (The mean is displayed with no decimals for example).
What I want to do is specify the format per variable:
- the 'length' variable has to be of the format 175 (no decimals)
- the 'weight' variable has to be formatted such as 60.545
Here an example. In reality, I use more variables. I split up the code to make it more readable.
Code:
* Summary statistics
Code:
eststo clear
Code:
estpost tabstat length weight, stat(mean median sd min max n) columns(statistics)
Code:
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
0 Response to Question about estpost/esttab: Control decimals per variable in summary table
Post a Comment