Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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)

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.

Value

An object of class 'cbind.createTable'.

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

Examples

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")

compareGroups

Descriptive Analysis by Groups

v4.5.1
GPL (>= 2)
Authors
Isaac Subirana [aut, cre] (<https://orcid.org/0000-0003-1676-0197>), Joan Salvador [ctb]
Initial release
2021-03-29

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.