*! version 1.0 11 September 2024

help for pretty_text Version 1.0 11 September 2024

Author

Georgia McRedmond & Rafael Gafoor
University College London, London UNITED KINGDOM
r.gafoor@ucl.ac.uk

Version Date Comments
1.0 11 September 2024	First release

Syntax

pretty_text
[if]
[,
options]

Required
string(varlist) - string variables to be summarised.

Optional
by(varlist) - grouping variables.

saving(filename) - filename or path to save putdocx copy of table.

Description

pretty_text generates publication quality tables of string variables with or without grouping variables.

pretty_text can take multiple grouping variables. Grouping variables will group any specified string variables by repeating categories.

If multiple grouping variables are specified these will be nested in the order that they are passed to pretty_text.

pretty_text tables must be saved to preview, this will export the table using putdocx to the specified filename.

If you wish to embed the pretty_text table inside an already open putdocx, saving should not be used or it will cause the current file to be closed.

Examples

Setup

. sysuse auto, clear

. keep in 50/60

Basic table with one grouping variable

. pretty_text, string(make) by(foreign) sav("Example_Table")

Table with multiple grouping variables

. gen Colour = "White"

. replace Colour = "Black" in 5/10

. pretty_text, string(make) by(foreign) sav("Example_Table")