help t2docx

Title

t2docx -- Report Mean Comparison for a lot of variables between two groups with formatted table output in DOCX file.

Syntax

t2docx varlist [if] [in] using filename , [options] by(varlist:groupvar)

varlist is a list of numerical variables to be tested.

t2docx can report a standard t-test to compare mean difference between two groups Users can also append the output from t2docx to other docx documents,
which is more likely to be generated by putdocx, reg2docx, sum2docx and corr2docx, either using the append option or the command can be as following:

`"putdocx append d:/mytable0.docx d:/mytable1.docx d:/mytable2.docx, saving(d:/mytable.docx,replace)"'

Options for t2docx

by(groupvar) variable defining the groups

diff(value1 value2) select two values of the groupvar if groupvar has more than 2 values

replace permits to overwrite an existing file.

append[(apopts)] permits to append the output to an existing file and change style definitions along with page break, header, and footer settings.

margin(type, #[unit]) set page margins for the document.

title(string) specify the title of the table. The default is title("T-test Table").

pagesize(psize) sets the page size of the document. psize may be letter, legal, A3, A4, or B4JIS. The default is pagesize(A4).

font(fontname[, size[, color]]) sets the font, font size, and font color for the document. Note that the font size and font color may be specified individually without specifying fontname.
Use font("", size) to specify font size only. Use font("", "", color) to specify font color only. The default is font("Times New Roman").

landscape changes the document orientation from portrait to landscape.

note(string[, cell_fmt_options]) adds notes under the table.

layout(putdocx_table##layouttype:layouttype) adjust column width.

fmt(fmt) specify the display format for group means and their difference; default format is %9.3f.

varname output variables' names in the first column of the table.

varlabel output variables' labels instead of names in the first column of the table.

not do not output t-value.

p output p-value instead of t-value.

se output standard error instead of t-value.

nostar do not output significance stars.

star[(symbol level [...])] output significance of the coefficients.

staraux the significance stars be printed next to the t-statistics (or standard errors, etc.) instead of the coefficient.

starsps set the format of symbols to be superscript.

unequal unpaired data have unequal variances.

welch use Welch's approximation.

Example

`"sysuse auto, clear"'

Report Mean Comparison for variables price weight length mpg between foreign group with formatted table output in DOCX file.

`"t2docx price weight length mpg using 1.docx, replace by(foreign)"'

Add table tile

`"t2docx price weight length mpg using 1.docx, replace by(foreign) title("this is the t-test table")"'

Add format for t-test table %9.2f

`"t2docx price weight length mpg using 1.docx, replace by(foreign) fmt(%9.2f) title("this is the t-test table") "'

Use the option append to append the output to an existing file

`"t2docx price weight length mpg turn using 1.docx, append by(foreign) fmt(%9.2f) title("this is the t-test table")"'

Change the significance of the coefficients and the significance stars

auto.dta")"'

Output coefficients without significance stars

`"t2docx price weight length mpg rep78 headroom trunk using 1.docx, replace by(foreign) nostar title("this is the t-test table")"'

Output table without t-value

`"t2docx price weight length mpg rep78 headroom trunk using 1.docx, replace by(foreign) not title("this is the t-test table")"'

Output table with p-value

`"t2docx price weight length mpg rep78 headroom trunk using 1.docx, replace by(foreign) p title("this is the t-test table")"'

Author

Chuntao LI

China Stata Club(爬虫俱乐部)

Wuhan, China

chtl@zuel.edu.cn

Zijian LI

China Stata Club(爬虫俱乐部)

Wuhan, China

jeremylee_41@163.com

Yuan XUE

China Stata Club(爬虫俱乐部)

Wuhan, China

xueyuan19920310@163.com

Also see

reg2docx (if installed) ssc install reg2docx (to install)

sum2docx (if installed) ssc install sum2docx (to install)

corr2docx (if installed) ssc install corr2docx (to install)