tone - Type-appropriate bivariate associations (Table One)

Syntax

tone varname [varelist] [if] [in] [, options]

Modifiers Description

(continuous) Treat as continuous variable.

(categorical) Treat as categorical variable.

(dichotomous [expression]) Treat as dichotomous variable.

Example: tone mainvar (cat) a w z (con)d-h

would treat variables a, w, and z as categorical and variables d to h as continuous.

univar Report only overall summary. (treats varname as part of varelist)

catcut Set cutoff # of levels to define as categorical variable.

decimal Extend percentages to 1 tenth of a percent.

stdiff Report standardized differences instead of p-values

hi(value) Highlight low p-values or high standardized diffs

section(details) Break varelist into sections

publication Adjusts the formatting to more closely match common publication requirements.

Description

For each variable of varelist, tone summarizes the variable, broken down by levels of varname, and includes a statistical test of association with varname (but see univar, below).

The display and statistics for each variable of varelist depend on its type: continuous, categorical, or dichotomous. The type is determined by the modifier,
if present, or as described in Remarks, below.

Modifiers

For continuous variables, the mean and sd are reported, along with a p-value from a one-way anova.

For categorical variables, percent at each value is reported, along with a p-value from a chi-squared.

For dichotomous variables, the percent "true" is shown, along with a p-value from a chi-sqaured.

By default, "true" is any value other than zero or missing; however, "true" can be defined in the attached expression.

If an expression is appended, nonzero, nonmissing values of expression will be treated as true. expression can include #V as a placeholder for the relevant variable. For example:

o- tone dv date(di !mi(#V)) will treat date as a dichotomous variable, with true defined as not missing.

o- tone likert(di #V>=3) will treat likert as a dichotomous variable, with true defined as likert>=3.

Options

univar treats varname as part of varelist, and simply summarizes all variables overall, with no separate categories, and no p-values or standardized differences.

catcut(integer) defines a cutoff for the number of unique values, below which a variable will be treated as categorical. See Remarks, below.

decimal will expand percentages to tenths of a percent.

stdiff reports standardized differences instead of p-values. For categorical variables, a difference is reported for each value of the variable.
If there are more than 2 levels of varname, the greatest difference beween means is used, and the variance is pooled across all levels.

hi(value) will highlight p-values or standardized differences that cross the specified threshold: p-values less than or equal to value, or st-diffs greater than or equal to value are highlighted.

section(details) can be specified multiple times to divide the display into multiple sections. The syntax for details is:

[text]:section var

where text will be displayed as a heading before section var, and section var must be a variable from varelist.

publication adjusts the formatting: drops the overall N (not missing) for each variable; puts the category-n or sd in parentheses; adds row legends; drops column legends; uses one text color.

nl1 governs the stub (row headings) and nl2 governs the column headings.

vl1 governs the stub (row headings) and vl2 governs the column headings.

Remarks

String variables are always treated as type cat. The type of numeric variables is determined as follows:

1. Any types set with modifiers on the command line are used.

If catcut(integer) is specified, then:

2. Variables for which the only non-missing values are 0 and 1 will get the type di

3. Those which have less than or equal to integer (non-missing) unique values will get the type cat

4. Those remaining will get the type con

Otherwise:

2. Any types assigned by (a prior) tone are used.

3. Variables for which the only non-missing values are 0 and 1 will get the type di

4. Those which have a labeled non-missing value will get the type cat

5. Those remaining will get the type con

type assignments are stored with the variables.

types can also be used to exclude variables from tone output: Variables with types other than those listed above are dropped from varelist.
For example, if ID variables etc. were assigned the type admin, they would not be included in the command, even if varelist were *.
(The comparison variable, varname, is also ignored as part of varelist.)

The output headings use the symbols mu and sigma as shorthand to indicate means and standard deviations, without implying the usual exact statistical meanings.
Even more egregiously, Stata output uses ó as a stand-in for sigma.

Examples

.tone gender age height weight1-weight5 bdate

.tone gender age(cat) (con) weight*, hi(.05)

.tone gender *