tabStats | R Documentation |
Determines if variable is continuous or categorical and returns the appropriate summary statistics.
tabStats(
x,
BY,
digits = 3,
conFunc1 = conDataFun1,
conFunc2 = conDataFun2,
catFunc = catDataFun,
digits.categorical = 1,
parName,
na.rm = FALSE
)
x |
numeric vector to summarize |
BY |
stratification argument |
digits |
number of significant digits in continuous data summaries |
conFunc1 |
defaults to conDataFun1 |
conFunc2 |
defaults to conDataFun2 |
catFunc |
defaults to catDataFun |
digits.categorical |
passed to catFunc |
parName |
is automatically populated but the parameter name can be specified here by the user. |
na.rm |
passed to conFunc1 and conFunc2 |
Appropriate statistic for x
This function is primarily used for demographics tables
conDataFun1
, conDataFun2
, conDataFun3
, catDataFun
, tabSummarize
pkpdData = example.pkpdData()
ok = duplicated(pkpdData$id) == FALSE
tabStats(x = pkpdData$race[ok], BY = list(dose = pkpdData$dose[ok]))
tabStats(x = pkpdData$race[ok], BY = list(dose = pkpdData$dose[ok]),
parName = "Race", digits.categorical = 0)
tabStats(pkpdData$sex[ok], list(dose = pkpdData$dose[ok]))
tabStats(x = pkpdData$wt, BY = list(dose = pkpdData$dose))
tabStats(x = pkpdData$bmi, BY = list(dose = pkpdData$dose))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.