numSummary: Summary Statistics for Numeric Variables

Description Usage Arguments Value Author(s) See Also Examples

Description

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

Usage

1
2
3
4
5
6
7
numSummary(data, 
	statistics=c("mean", "sd", "IQR", "quantiles", "cv", "skewness", "kurtosis"),
	type=c("2", "1", "3"),
    quantiles=c(0, .25, .5, .75, 1), groups)
    
## S3 method for class 'numSummary'
print(x, ...)

Arguments

data

a numeric vector, matrix, or data frame.

statistics

any of "mean", "sd", "quantiles", "cv" (coefficient of variation — sd/mean), "skewness", or "kurtosis", defaulting to the first three.

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.

...

arguments to pass down from the print method.

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 jfox@mcmaster.ca

See Also

mean, sd, quantile, skewness, kurtosis.

Examples

1
2
3
4
5
6
7
8
9
	## Not run: 
data(Prestige, package="car")
Prestige[1, "income"] <- NA
numSummary(Prestige[,c("income", "education")], 
	statistics=c("mean", "sd", "quantiles", "cv", "skewness", "kurtosis"))
numSummary(Prestige[,c("income", "education")], groups=Prestige$type)
remove(Prestige)
	
## End(Not run)

Rcmdr205 documentation built on May 2, 2019, 5:52 p.m.