Title

smrtbl -- Place a one- or two-way table in an active docx using putdocx.

Syntax

smrtbl [varlist] [if] [in] [, options]

Main
numlab Add variable label values to output. This option executes numlabel, add before producing output.

nocond Suppress output of if and in conditionals. Default behavior is to note each table with if and in conditionals applied.

description Provide a description for output. Default behavior is to provide a generic description.

title Provide a title for output. Default behavior is to provide a generic title.

Description

smrtbl produces a one-way table when there is one categorical variable in varlist. When two categorical variables specified in varlist, smrtbl produces a two-way table. This command will also work with categorical variables which remain as string data types; that have not been encoded as integers.

When an if or in condition is specified smrtbl will report that condition in the putdocx.

Example

. use http://www.stata-press.com/data/r15/nlswork.dta

. // Start putdocx, enter contextual information.

. capture putdocx clear

. putdocx begin

. putdocx paragraph, style(Title)

. putdocx text ("Demonstration Title")

. putdocx paragraph, style(Subtitle)

. putdocx text ("Demonstration Produced `c(current_date)'")

. putdocx paragraph

. putdocx text ("Following this paragraph will be a two-way tabulation of age and race.")

. // Demonstrate smrtble.

. smrtbl age race

. // Enter additional contextual information.

. putdocx paragraph

. putdocx text ("Following this paragraph will be two one-way tabulations of race and then age.")

. // Demonstrate smrtble.

. smrtbl race

. smrtbl age

. putdocx save "smrtblDemo.docx"

Author

Adam Ross Nelson

https://github.com/adamrossnelson