'stats.by' computes statistics for variables that are divided into subgroups.
Its arguments are:
'X' must be a numeric vector, a matrix, or a dataframe.  If 'X' is a matrix
or dataframe, statistics are computed for each column of 'X'; if it is
a vector, then statistics are computed for this vector.
'Index' is a factor, list of factors or a dataframe whose combinations
determine the strata over which the statistics will be computed.  If 'Index'
is NA (default), then the statistics are computed for the entire sample
without regard to any strata.
'Fun' is a list of functions.  Each function computes a statistic.  If 'Fun'
is set to 'default', then statistics will be computed for the median, mean,
standard deviation, sample size, and number of missing cases.
If 'data' is not NA, then it must be a dataframe.  'stats.by' attaches
'data' to the search path in position 2.  Variables that are references
in 'X' and 'Index' refer to variables in 'data'.  If 'data' is not assigned,
it defaults to NA in which case 'X' and 'Index' must refer to objects
on the search path.
'stat.names' is an optional character vector that lists the abbreviations
that are used to create names for the statistical results, e.g., 'stat.names =
`mn`' causes 'mn.' to be prefixed to each variable name.
'miss.byvar = TRUE' if cases with missing values are excluded separately for
each dependent variable (in the 'X' argument); 'miss.byvar = FALSE' if cases
are excluded that are missing on any of the dependent variables (listwise
exclusion); cases are always excluded if they are missing on any of the 'Index'
variables.
'out.bystat = TRUE' if stats are grouped by variable within each statistical
function, e.g., means for all variables are grouped together, then sd's for
all variables are grouped together, etc.  If 'out.bystat = FALSE' (default),
all stats for each variable are grouped together.
If 'case.selectors = TRUE', the output is a list.  Its first component is
a dataframe that contains the statistical results; its second component is
a dataframe that contains the variables that selected the cases to be used
in this analysis.  If 'case.selectors = FALSE', the output is a single
dataframe that contains the statistical results.
If 'simplify.factor.levels' is a positive integer k, then the factor levels
of all 'Index' factors are truncated to the smallest integer > k-1 such that
the truncated level names remain distinct from each other.
'digITS' determines the rounding of stat output.  If 'digITS = NA', then
the R default digits will be displayed.  If 'digITS' is a numeric vector
of the same length as 'Fun', then each component of 'digITS' determines
the rounding of the corresponding stat in 'Fun'.  If 'digITS' has length 1,
then every stat is rounded to this number of digits.