Learn R Programming

arsenal (version 0.5.0)

tableby.stats: tableby Summary Statistics Functions

Description

A collection of functions that will report summary statistics. To create a custom function, consider using a function with all three arguments and .... See the tableby vignette for an example.

Usage

meansd(x, na.rm = TRUE, weights = rep(1, length(x)), ...)

medianrange(x, na.rm = TRUE, weights = rep(1, length(x)), ...)

median(x, na.rm = TRUE, weights = rep(1, length(x)), ...)

range(x, na.rm = TRUE, ...)

Nevents(x, ...)

medSurv(x, ...)

q1q3(x, na.rm = TRUE, weights = rep(1, length(x)), ...)

medianq1q3(x, na.rm = TRUE, weights = rep(1, length(x)), ...)

Nmiss(x, levels = NULL, na.rm = TRUE, weights = rep(1, length(x)), ...)

N(x, levels = NULL, na.rm = TRUE, weights = rep(1, length(x)), ...)

count(x, levels = sort(unique(x)), na.rm = TRUE, weights = rep(1, length(x)), ...)

countpct(x, levels = sort(unique(x)), na.rm = TRUE, weights = rep(1, length(x)), ...)

Arguments

x

Usually a vector.

na.rm

Should NAs be removed?

weights

A vector of weights.

...

Other arguments.

levels

A vector of levels that character xs should have.

Value

Usually a vector of the appropriate numbers.

Details

Not all these functions are exported, in order to avoid conflicting NAMESPACES.