stats.default {table1}R Documentation

Compute some basic descriptive statistics.

Description

Values of type factor, character and logical are treated as categorical. For logicals, the two categories are given the labels 'Yes' for TRUE, and 'No' for FALSE. Factor levels with zero counts are retained.

Usage

stats.default(x, quantile.type = 7, ...)

Arguments

x

A vector or numeric, factor, character or logical values.

quantile.type

An integer from 1 to 9, passed as the type argument to function quantile.

...

Further arguments (ignored).

Value

A list. For numeric x, the list contains the numeric elements:

If x is categorical (i.e. factor, character or logical), the list contains a sublist for each category, where each sublist contains the numeric elements:

Examples

x <- exp(rnorm(100, 1, 1))
stats.default(x)

y <- factor(sample(0:1, 99, replace=TRUE), labels=c("Female", "Male"))
y[1:10] <- NA
stats.default(y)
stats.default(is.na(y))


[Package table1 version 1.4.3 Index]