Learn R Programming

compareGroups (version 4.9.0)

strataTable: Stratify descriptive table in stratas.

Description

This functions re-build a descriptive table in stratas defined by a variable.

Usage

strataTable(x, strata, strata.names = NULL, max.nlevels = 5)

Value

An object of class 'cbind.createTable'.

Arguments

x

an object of class 'createTable'

strata

character specifying the name of the variable whose values or levels defines strata.

strata.names

character vector with as many components as stratas, or NULL (default value). If NULL, it takes the names of levels of strata variable.

max.nlevels

an integer indicating the maximum number of unique values or levels of strata variable. Default value is 5.

References

Isaac Subirana, Hector Sanz, Joan Vila (2014). Building Bivariate Tables: The compareGroups Package for R. Journal of Statistical Software, 57(12), 1-16. URL https://www.jstatsoft.org/v57/i12/.

See Also

compareGroups, createTable, descrTable

Examples

Run this code

require(compareGroups)

# load REGICOR data
data(regicor)

# compute the descriptive tables (by year)
restab <- descrTable(year ~ . - id - sex, regicor, hide.no="no")

# re-build the table stratifying by gender
strataTable(restab, "sex")

Run the code above in your browser using DataLab