summaryStats {s20x}R Documentation

Summary Statistics

Description

Produces a table of summary statistics for the data. If the argument "group" is missing, calculates a matrix of summary statistics for the data in "data". If "group" is present, the elements of "group" are interpreted as group labels and the summary statistics are displayed for each group separately.

Usage

summaryStats(x, ...)
## Default S3 method:
summaryStats (x, group = rep("Data", length(x)), data.order = TRUE, digits = 2, ...)
## S3 method for class 'formula':
summaryStats (x, data, data.order = TRUE, digits = 2, ...)

Arguments

x either a single vector of values, or a formula of the form data~group.
data an optional data frame containing the variables in the model.
group a vector of group labels.
data.order if T, the group order is the order which the groups are first encountered in the vector "group". If F, the order is alphabetical.
digits the number of decimal places to display.
... Optional arguments.

Value

Returns a matrix containing the following components:

Minimum value
Maximum value
Mean value the average value.
Median the middle value when the batch is ordered.
Upper quartile
Lower quartile
Variance the average of the squares of the deviations of the data values from the sample mean.
Standard deviation the square root of the variance.
Midspread (IQR) the range spanned by central half of data; the interquartile range
Skewness indicates how skewed the data set is. Positive values indicate right-skew data.
Symmetry statistic(alpha=0.05) another symmetry measure, values close to 0.5 correspond to reasonably symmetric data.
Symmetry statistic(alpha=0.10) alpha by default.
Number of data values size of the data set.

Examples

## STATS20x data:
data(course.df)
attach(course.df)
summaryStats(Exam)
detach(course.df)

summaryStats(Exam~Stage1, course.df)

## Note this usage is deprecated.
attach(course.df)
summaryStats(Exam,Stage1)
detach(course.df)

[Package s20x version 3.1-5 Index]