Hi everyone,
I am trying to export a descriptive statistics table using estpost tabstat and esttab but I keep getting numeric values when using the by(group) option even though the variable group is a string. I am using this code:
eststo av: estpost tabstat A B C D E F G, ///
statistics(mean median sd max min n) by(region) columns(statistics)
esttab av using "${path}/statistics.tex", label noobs booktabs nonumber nodepvars nomtitles ///
cells("Mean(pattern(1 1 0) fmt(2)) p50(fmt(0)) SD(pattern(1 1 0)) Min(fmt(0)) Max(fmt(0)) count(fmt(0))") ///
collabels("Mean" "Median" "Std. Dev." "Min." "Max." "N") replace
And I get:
Region | e(Mean) e(p50) e(SD) e(Max) e(Min) e(count)
-------------+------------------------------------------------------------------
1 |
A | 3.5 3 .9718253 5 2 10
B | .6 1 .5163978 1 0 10
C | .8 1 .421637 1 0 10
D | .1 0 .3162278 1 0 10
E | 0 0 0 0 0 10
F | 0 0 0 0 0 10
G | 0 0 0 0 0 10
-------------+------------------------------------------------------------------
2 |
A | 2.833333 3 .3892495 3 2 12
B | .9166667 1 .2886751 1 0 12
C | 1 1 0 1 1 12
.
.
.
I want in the table the values of the region variable (Europe, Asia, Africa, America...) instead of numbers (1, 2, 3, 4...).
Many thanks,
Tessa
Related Posts with Labels in by group variable using estpost tabstat
New package predsurv on SSCThanks as always to Kit Baum, a new package predsurv is now available for download from SSC. In Stat…
How to generate a new multivariable?generate prodvars= logY3a logY4a logY3asq invalid 'logY4a' …
Levenshtein Distance (fuzzy matching) with a loopHello guys, I am currently trying to do fuzzy matching of two "string" variables (var1 and var2) in…
Problem with creating subgroups based on age variableI have a panel data of companies and their ages and returns for a period of 20 years. as a control f…
Inequality analysisHi, I’am new in the forum, I don’t know if I posted in good place for my question, this is my first …
Subscribe to:
Post Comments (Atom)
0 Response to Labels in by group variable using estpost tabstat
Post a Comment