Title

smrfmn -- Produces table of summary statistics filtered by one or more indicator variables in an active docx using putdocx.

Syntax

smrfmn [varname] [varlist], desc("Optional descriptive table title")

Where [varname] is a continous variable and [varlist] is one or more indicator variables.

Main
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

smrfmn produces a table of summary statistics filtered by one or more indicator variables. For each dummy/indicator variable smrfmn will generate a table row of statistics filtered by that indicator. smrfmn places the indicator variable label (or variable name) in column one, the number of observations where the indicator is equal to 1 in column two, the mean meadian and standard deviation in column three, the 25th and 75th percential in column four, the trimmed mean, median, and standard deviation in column five, and the overall minumum and maximum in column six.

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

. // Generate indicator variables and interactions.

. tab race, gen(race_ind)

. tab collgrad, gen(col_ind)

. gen white_grad = (race_ind1 == 1 & col_ind2 == 1)

. gen black_grad = (race_ind2 == 1 & col_ind2 == 1)

. gen other_grad = (race_ind3 == 1 & col_ind2 == 1)

. label variable white_grad "race==white & grad == true"

. label variable black_grad "race==black & grad == true"

. label variable other_grad "race==other & grad == true"

. // 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 ("The following is a tabulation of age summary statistics filtered by selected indicator variables.")

. // Demonstrate smrfmn.

. smrfmn age race_ind1 white_grad race_ind2 black_grad race_ind3 other_grad, desc("Filtered descriptives of age.")

. putdocx save "smrfmnDemo.docx"

Author

Adam Ross Nelson

https://github.com/adamrossnelson