strataTable {compareGroups} | R Documentation |
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
compareGroups
, createTable
, descrTable
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")
[Package compareGroups version 4.8.0 Index]