numSummary: Summary Statistics for Numeric Variables

View source: R/numSummary.R

numSummaryR Documentation

Summary Statistics for Numeric Variables

Description

Summary Statistics for Numeric Variables

Usage

numSummary(
  data,
  statistics = c("mean", "sd", "se(mean)", "var", "cv", "IQR", "quantiles", "skewness",
    "kurtosis"),
  type = c("2", "1", "3"),
  quantiles = c(0, 0.25, 0.5, 0.75, 1),
  groups
)

## S3 method for class 'numSummary'
print(x, ...)

Arguments

data

a numeric vector, matrix, or data frame.

statistics

any of "mean", "sd", "se(mean)", "var", "cv", "IQR", "quantiles", "skewness", or "kurtosis", defaulting to c("mean", "sd", "quantiles", "IQR").

type

definition to use in computing skewness and kurtosis; see the skewness and kurtosis functions in the e1071 package. The default is "2".

quantiles

quantiles to report; default is c(0, 0.25, 0.5, 0.75, 1).

groups

optional variable, typically a factor, to be used to partition the data.

x

object of class "numSummary" to print, or for CV, a numeric vector or matrix.

...

arguments to pass down from the print method.

Details

numSummary creates neatly formatted tables of means, standard deviations, coefficients of variation, skewness, kurtosis, and quantiles of numeric variables. CV computes the coefficient of variation.

Value

numSummary returns an object of class "numSummary" containing the table of statistics to be reported along with information on missing data, if there are any.

Author(s)

John Fox

See Also

mean, sd, cv, quantile, skewness, kurtosis.

Examples

data(Prestige)
Prestige[1, "income"] <- NA
print(numSummary(Prestige[,c("income", "education")],
                 statistics=c("mean", "sd", "quantiles", "cv", "skewness", "kurtosis")))
print(numSummary(Prestige[,c("income", "education")], groups=Prestige$type))


RcmdrMisc documentation built on Jan. 8, 2026, 9:06 a.m.