Real-World Tables in Stata
Real-World Tables in Stata
The table
and collect
commands introduced in Stata 17 give Stata the ability to create complex tables in a reproducible way. You can think of them as defining a “grammar of tables” analogous to Leland Wilkinson’s grammar of graphics that underlies R’s ggplot. But this grammar can be challenging to learn.
This web book is the result of a request from a research group supported by the SSCC to help them learn how to make a specific set of challenging tables drawn from real-world papers, with the idea that if they know how to make those tables they’ll be able to make any other table they’re likely to need. Each chapter will present a “shortened” version of one of those tables, keeping the key features of the original but reducing repetitive elements. It will then show how to create that table, including estimating the statistical results.
The inclusion of a table in this collection does not necessarily mean it should be used as a model of a good table: some of them are challenging to make because they arguably try to do too much. Nor is it an endorsement of the statistics used. Note that all the data sets used in this book are fictional.
This book assumes you have some familiarity with Stata collections already, specifically what’s covered in our Tables in Stata. It will briefly introduce the dtable
and etable
commands added in Stata 18 to make it easier to create tables of descriptive statistics and estimation results respectively. But the main focus is using the various collect
commands to turn a collection of results into the table you need.