numSummary | R Documentation |
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.
numSummary(data,
statistics=c("mean", "sd", "se(mean)", "var", "CV", "IQR",
"quantiles", "skewness", "kurtosis"),
type=c("2", "1", "3"),
quantiles=c(0, .25, .5, .75, 1),
groups)
CV(x, na.rm=TRUE)
## S3 method for class 'numSummary'
print(x, ...)
data |
a numeric vector, matrix, or data frame. |
statistics |
any of |
type |
definition to use in computing skewness and kurtosis; see the
|
quantiles |
quantiles to report; default is |
groups |
optional variable, typically a factor, to be used to partition the data. |
x |
object of class |
na.rm |
if |
... |
arguments to pass down from the print method. |
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. CV
returns the coefficient(s) of variation.
John Fox jfox@mcmaster.ca
mean
, sd
, quantile
,
skewness
, kurtosis
.
if (require("carData")){
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))
remove(Prestige)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.