stats.default: Compute some basic descriptive statistics.

Description Usage Arguments Value Examples

View source: R/table1.R

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

1
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

1
2
3
4
5
6
7
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))

table1 documentation built on June 7, 2021, 1:07 a.m.