Home  /  Stata News  /  Vol 38 No 3  /  In the spotlight: Tables of descriptive statistics in Stata 18
The Stata News

«Back to main page

In the spotlight: Tables of descriptive statistics in Stata 18

In Stata 17, we introduced new commands for creating and customizing tables, including etable, which easily creates and exports a table of estimation results. We are excited to announce that Stata 18 offers another new command, dtable, that easily builds and exports a table of descriptive statistics, often called Table 1 in publications. Now generating tables of descriptive statistics for both categorical and continuous variables is easier than ever!

For instance, simply type

. dtable price weight mpg i.rep78

and get a table reporting means and standard deviations of continuous variables, as well as frequencies and percentages for levels of categorical variables.

. dtable price weight mpg i.rep78

Summary
N 74 Price 6,165.257 (2,949.496) Weight (lbs.) 3,019.459 (777.194) Mileage (mpg) 21.297 (5.786) Repair record 1978 1 2 (2.9%) 2 8 (11.6%) 3 30 (43.5%) 4 18 (26.1%) 5 11 (15.9%)

In addition to being so easy to use, the dtable command is also very powerful. In my blog, Creating tables of descriptive statistics in Stata 18: The new dtable command, I demonstrate how to create simple tables like the one above and more complex tables that display statistics by group, tests for differences across groups, and more. I also show how you can use the collect suite of commands, which is designed for customizing any type of table, to further customize the look of your tables and how to include tables created with dtable in complete reports.

— by Mia Lv
Staff Statistician

«Back to main page