*! version 0.1.1beta 01Jul2018

Title

autosum -- Automatically summarise data using various statistical tests and present a comparison table

Syntax

Overview of Group formats

Long - Group format 1
+
+ Wide - Group format 2
|Subject Grouping Var | +
+
|
| | Subject Group A Group B |
| 1 A 31 | |
|
| 2 A 42 | | 1 31 23 |
| 3 B 42 | | 2 42 13 |
| 4 A 35 | +
+
+
+

Long format - grouping variable (groupvar)

autosum groupvar

Wide format (also used for paired data) - individual groups (groupA, groupB ...)

autosum groupA groupB

Basic syntax

Generate basic comparison table using single grouping variable

autosum groupvar
[if] [in]
,
[options]

Generate basic comparison table using selected variables in wide format

autosum groupA groupB
[if] [in]
,
[options]

options Description

paired* use paired group comparison for selected groups

exclude(varlist) exclude variables in varlist from analysis

cutoff(integer) define the number categories in variable before it is regarded as continuous (default number is 7)

sfrancia use Shapiro-Francia test to test for normality rather than default Shapiro-Wilk test

grouping manual input of grouping variable, if no other variables specified then all variables are included - see advanced syntax

continuous manual input of continuous variables - see advanced syntax

categorical manual input of categorical variables - see advanced syntax

export(filename) export comparison table to comma delimited file <filename> in working directory

pvalue(star) changes format of p values to make them more presentable (only works with exported file version)

* paired data is only supported in wide format (group format 2)

Advanced syntax

autosum, [grouping(varlist)] continuous(varlist) categorical(varlist)

Manual entry depends on whether grouping variable is present. If there is a grouping variable then long format (group format 1) is assumed.
If there is no grouping variable, then data is analysed as wide format (group format 2), in which case either continuous or categorical variables are allowed.
Paired option also works with manual entry of variables. Use the manual option if autosum is not correctly determining variable type

Description

autosum automatically detects variable type and performs statistical tests to compare between groups, then presents this in a comparison table
For more details on usage and grouping, visit the autosum blog

Options

paired ensure to specify this option if comparing between paired data i.e. observations for same subjects (versus unmatched data).

exclude(varlist) use this option to exclude variables that should not be analysed e.g. subject ID. autosum will automatically remove them from the analysis.

cutoff(integer) determine the number of group categories before a numeric integer variable is deemed to be continuous. Alter this if autosum is not correctly determining your variables, or alternatively use the manual entry option.

Remarks

Before using autosum, you need to determine whether the data is in long
or wide form (group formats 1 or 2). You also must determine the grouping variable if in long format; and whether data is paired or unmatched.
The user is strongly advised to check the output to ensure that variables are classified correctly
For more information on usage, please visit the autosum blog

Examples

Setup

. sysuse auto

List the data

. list

Summarise the data comparing between foreign and domestic groups

. autosum foreign

Export the data in comma delimited file with optimised format for p values

. autosum foreign, export(filename) pvalue(star)

Compare between variables: mpg and turn

. autosum mpg turn

Perform a paired group comparison between mpg and turn

. autosum mpg turn, paired

Manual entry of the following variables: group variable(foreign), compare between mpg and price

. autosum, grouping(foreign) continuous(mpg price)

Stored results

autosum stores the comparison table in the following matrix:
final