Title

putdocxcrosstab -- Produces count twoway tables with putdocx.

Syntax

putdocxcrosstab varlist [if], [noROWSum] [noCOLsum] [MIssing]

Description

produces a twoway crosstabulation of the two variables in varlist.

Syntax

varlist must contain two variables

Options:

noROWSum : drops the last column containing row sums

noCOLsum : drops the last row containing column sums

MIssing : includes missing values

row : gives percentages by row

col : gives percentages by column

pformat : numeric format for percentages

Example

. sysuse auto, clear

. egen pricecat = cut(price), at(0,5000,10000,999999) label

. label variable pricecat "Price (categorical)"

. tab pricecat

. // 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 one-way frequency tabulation of price by categories.")

. // Demonstrate putdocxcrosstab.

. putdocxcrosstab pricecat foreign

. putdocx save "putdocxcrosstab.docx"

Author

Jan Brogger

https://github.com/janbrogger/putdocxcrosstab