Create and Export Tables Using Stata

In Create and Export Tables Using Stata, Michael Mitchell teaches you how to expertly craft custom, publication-quality tables of summary statistics, regression results, and more. Mitchell examined hundreds of published journal articles from many disciplines, searching for commonly used table layouts. This book breaks down how to create the most popularly used tables by guiding you through examples using Stata’s tabledtable, and etable commands, as well as the collect suite of commands.

 

This book begins with 24 sample tables, including 6 examples of a Table 1, 8 examples of regression models, 4 examples with Student’s t tests, and an example of reporting results from a pretest–posttest design. Each sample table is illustrated step by step, showing you how to create it, customize it, and export it as a Word document. You’ll also learn how you can export your table as a PDF or an Excel spreadsheet.

 

After the quick examples, the book takes a more thorough look at the process of creating a Table 1—a table of descriptive statistics that optionally includes a comparison across groups. This discussion also includes extensive instruction on how to create different types of composite results to include in your table; composite results combine multiple statistics into one cell, such as the mean (SE) or median (IQR).

 

Next Mitchell focuses on creating tables from regression models, such as multiple regression, multivariate regression, logistic, and multinomial logistic models, and illustrates how to make tables that combine results from several models.

 

The book ends with a look under the hood, describing what a collection looks like and the steps used by the collect suite of commands for creating a table and filling it in based on the contents of the collection. This information can help you more deeply understand the process of creating tables and help you make more complex tables using Stata.

 

Create and Export Tables Using Stata is integral to anyone reporting data characteristics or analysis. You will learn how to create tables with the layout, formatting, and style you need. Optimize your workflow by using your styles to automate the creation of any future tables. You will take this book off your shelf over and over again as it quickly becomes your go-to reference for creating tables in Stata.

Acknowledgments
List of figures
Preface (PDF)
1 Introduction
1.1 Read me first
1.2 Overview of creating tables in Stata
1.3 Overview of this book
1.4 Introduction to making and exporting tables
1.5 Using Unicode characters
1.6 Useful Stata concepts and commands

1.6.1 Display formatting
1.6.2 Stata macros
1.6.3 Accessing results stored from Stata commands
1.6.4 Repeating commands by looping over variables
2 Twenty-four sample tables
2.1 Sample 1: Regression with model statistics in the footer
2.2 Sample 2: Regression with multiple outcomes
2.3 Sample 3: Regression with multiple groups
2.4 Sample 4: Regression with multiple models
2.5 Sample 4b: Regression with multiple models using etable
2.6 Sample 5: Regression with multiple outcomes and multiple groups
2.7 Sample 6: Regression with multiple models and multiple groups
2.8 Sample 7: Regression with multiple outcomes and multiple models
2.9 Sample 8: Regression with multiple outcomes, multiple models, and multiple groups
2.10 Sample 9: Student’s t test
2.11 Sample 10: Student’s t test with Cohen’s d
2.12 Sample 11: Student’s t test with difference in means
2.13 Sample 12: Student’s t test with Cohen’s d and difference in means
2.14 Sample 13: Columns of correlations
2.15 Sample 14: Column of correlations: Two groups
2.16 Sample 15: Correlation matrix
2.17 Sample 16: Correlation matrix with mean and SD in columns
2.18 Sample 17: Correlation matrix with mean and SD in rows
2.19 Sample 18: Pretest–posttest randomized controlled trial
2.20 Sample 19: Table 1 showing all categorical variables, one group
2.21 Sample 20: Table 1 showing categorical variables by two groups
2.22 Sample 21: Table 1 showing categorical variables by two groups, with p-values
2.23 Sample 22: Table 1 showing categorical and continuous variables by two groups
2.24 Sample 23: Table 1 showing categorical and continuous variables by two groups, with p-values
2.25 Sample 24: Table 1 showing categorical variables, only “yes” responses
3 Creating tables of descriptive statistics with dtable

3.1 Exploring how to make tables with dtable

3.1.1 Exporting to a Word document with collect commands
3.1.2 Exporting to a Word document with the export option

3.2 Customizing variable labels and factor labels

3.2.1 Customizing variable labels
3.2.2 Customizing labels of the levels of factor variables
3.2.3 Reordering the levels of factor variables
3.2.4 Summary

3.3 Customizing the numeric format
3.4 Customizing the string format
3.5 Selecting the variable statistics

3.5.1 Statistics for continuous variables
3.5.2 Statistics for factor variables

3.6 Composite results

3.6.1 Composite 1: [minimum-maximum]
3.6.2 Composite 2: mean±SD
3.6.3 Composite 3: mean±SD and sometimes [minimum-maximum]

3.7 Customizing titles, notes, and display of the sample frequency

3.7.1 Column header for summary statistics
3.7.2 Titles and notes
3.7.3 The sample frequency

3.8 Grouping results with the by() option

3.8.1 Adding and customizing tests comparing groups
3.8.2 Customizing display of the sample frequency
3.8.3 Customizing the column order of the by-groups

3.9 Adding row headers

3.9.1 Row headers for all variables
3.9.2 Row headers for some variables
3.9.3 Row headers with by-groups, tests, and N as separate labels
3.9.4 Row headers with by-groups, placing total first
3.9.5 Showing yes-only responses

3.10 Complete examples

3.10.1 Table of summary statistics, one group
3.10.2 Summary statistics, by two groups, with p-values
3.10.3 Composite results, by two groups, with p-values
3.10.4 Summary statistics, by two groups, with p-values, headers, and yes-only responses
4 Creating and exporting regression tables
4.1 The big picture of creating regression tables
4.2 Multiple regression models
4.3 Several models (model 1, model 2, and model 3)
4.4 Multivariate models

4.4.1 Multivariate regression
4.4.2 Multivariate regression using sem command

4.5 Tables with multiple multivariate models
4.6 Models including factor variables
4.7 Models including interactions of factor variables
4.8 Logistic and other nonlinear models

4.8.1 Logistic regression
4.8.2 Poisson regression

4.9 Models with multiple equations

4.9.1 Multinomial logistic regression
4.9.2 Zero-inflated models

4.10 Customizing regression tables

4.10.1 Formatting p-values
4.10.2 Titles, notes, and stars
4.10.3 Composite results
4.10.4 Standardized coefficients
4.10.5 Customizing labels and headers
4.10.6 Adding customized headers
4.10.7 Making tables that include model statistics
4.10.8 Results you can access via the result dimension
4.10.9 Using autolevels
4.10.10 Customizing cells
4.10.11 Custom styles
5 Creating tables: Under the hood
5.1 Multiple regression
5.2 Regression tables with multiple models
5.3 Correlations with summary statistics in the rows
5.4 Correlations with summary statistics in the columns
Appendixes
A More on exporting tables

A.1 More on exporting tables to Word

A.1.1 Controlling the table width and column widths
A.1.2 Adding and customizing text
A.1.3 Adding formatted titles and formatted notes
A.1.4 Multiple lines of formatted notes
A.1.5 Dropping a row
A.1.6 Titles, notes, and stars with regression results

A.2 More on exporting PDF files

A.2.1 Specifying the table width and relative column widths
A.2.2 Adding and customizing text
A.2.3 Adding formatted titles and formatted notes
A.2.4 Multiple lines of formatted notes
A.2.5 Dropping a row
A.2.6 Titles, notes, and stars with regression results

A.3 More on exporting Excel files

A.3.1 Create a simple table; export it to Excel
A.3.2 Adding titles and notes
A.3.3 Export via putexcel
A.3.4 Adding and customizing text
B Creating tables of estimation results using etable
B.1 Multiple regression
B.2 Tables based on multiple estimation commands
B.3 Multivariate regression
C Tips for handling common errors
C.1 Forgetting collect clear
C.2 Forgetting the modify option
C.3 Changing the wrong label
C.4 Ignoring notes or warnings
C.5 Forgetting to display the label
D Making reusable code: Nested regression

D.1 Table of model statistics

D.1.1 Attempt 1
D.1.2 Attempt 2
D.1.3 Recap: nestreg1.do

D.2 Table with regression coefficients and model statistics

D.2.1 Recap: nestreg2.do
Author: Michael N. Mitchell
ISBN-13: 978-1-59718-370-3
©Copyright: 2025
Versione e-Book disponibile

In Create and Export Tables Using Stata, Michael Mitchell teaches you how to expertly craft custom, publication-quality tables of summary statistics, regression results, and more. Mitchell examined hundreds of published journal articles from many disciplines, searching for commonly used table layouts. This book breaks down how to create the most popularly used tables by guiding you through examples using Stata’s tabledtable, and etable commands, as well as the collect suite of commands.