*! version 2.0.0 10oct2013

help partchart

Title

partchart -- participant characteristics table export

Syntax

partchart varlist [if] [in]
, file(string)
[sheet(string)
catcut(integer)
catsep("string", nopercent)
cattest(exact)
constats(string)
conprec(integer)
consep("string")
contest(kwallis)
nobase(varlist)
by(varname)]

Description

partchart exports a "raw" "Participant Characteristics" table into a specified file format.
This "raw" table can then be formatted into a publication quality table. partchart eases
the burden of either entering summary statistics by hand or using multiple lines of code to
automate the process. partchart allows the user to export a table very close to publication
quality with one command.

partchart automatically parses the varlist into continuous variables and categorical variables,
but offers the user the ability to control these as well. The output table contains means and standard deviations by
default for continuous variables, but will output user defined summary statistics with the constats
option. Counts and percentages are output for categorical variables. Sample sizes are displayed in the last
row of the table. With the by(varname) invoked,
the numeric suffix on the column headers corresponds to the numeric values of varname.

Options

file(string) is required and indicates the filename that is output to the active directory.
Subdirectories are also supported. This file must be closed before running partchart.
Supported file formats include: .xlsx, .xls, .csv, .txt (tab-delimited), and .tex, with .xlsx being the default.

sheet(string) indicates the sheet name in filename for the output if .xlsx or .xls file
formats are used. If sheet is not specified, the sheet will be named "partchartraw".

catcut(integer) specifies the cutoff number of categories for partchart
to separate continuous variables from categorical variables. This is usually only a problem for small
datasets (missclassifying continuous as categorical) or when categoricals variables have a large number
of categories. For example, with the default (10), any variable with less than 10 unique values is
considered categorical.

catsep("string", nopercent) specifies the string used to encapsulate
categorical variables. The string must be surrounded by quotation marks, and only string lengths of
1 or 2 are valid. The default is "()". , nopercent tells partchart to not include the "%"
in the output.

cattest(exact) tells partchart that instead of performing a chi-square test for differences in
categorical variables, perform Fisher's exact test and report the corresponding p-values.
This option is only valid if the option by(varname) is invoked.

constats(string) tells partchart what descriptive statistics to report
for continuous variables. It must be specified in the form constats(stat1 stat2),
where stat1 and stat2 can be anything from the list of statistics from tabstat,
excluding "q". The default is constats(mean sd).

conprec(integer) specifies the precision for continuous variables indicated as number
of decimal places. Only positive integers are valid and the default is 2.

consep("string") functions the same as catsep except nopercent isn't valid.

contest(kwallis) tells partchart that instead of performing ANOVA (t test) for differences in
continuous variables, perform a Kruskal-Wallis (Mann-Whitney U) test and report the corresponding p-values.
This option is only valid if the option by(varname) is invoked.

nobase(varlist) provides the user the opportunity to exclude rows from the table. The base level of any variable in
nobase's varlist will be excluded from the table. This only applies to categorical variables.

by(varname) splits the table into a twoway table, by varname. If the by
option is not included, partchart outputs a oneway table.
The varname must be categorical with a reasonably small number of categories. In addition, values for varname
must be sequential integers starting with either 0 or 1. Also, the
by option outputs p-values for differences. These p-values are based on ANOVA or t tests for continuous
variables and chi-square tests for categorical variables (unless otherwise specified by
contest(kwallis) or cattest(exact)).

Comments

It is always a good idea to know what directory you are working from.

The following are .ado files needed to run partchart and can be downloaded and installed with
ssc install:
unique
mat2txt
lstrfun
tabcount
dataout

Examples

. sysuse auto

. partchart price mpg foreign trunk rep78, file(partchart) sheet(onewayref)

. partchart price mpg rep78 trunk, by(foreign) file(partchart) sheet(twowayref)

. partchart price mpg foreign trunk, by(rep78) file(partchart) sheet(twowaynonpararef2) cattest(exact) contest(kwallis)

. partchart price rep78 mpg foreign, file(tablestest.txt) sheet(partchart-ref1) catcut(4) conprec(1) nobase(rep78 foreign)

. partchart price rep78 mpg foreign, file(tablestest) sheet(partchart-ref1) consep("--") catsep("{}", nopercent)

. partchart price rep78 mpg foreign, file(tablestest) sheet(partchart-ref1) consep("`=char(177)'") catsep("_")

Author

Seth T. Lirette, University of Mississippi Medical Center

slirette2@umc.edu