View source: R/descriptiveTable.R
descriptiveTable | R Documentation |
Descriptive table for continuous, categorical, and date variables.
descriptiveTable(
formula,
data,
guess.categorical = 5,
add.groupAll = TRUE,
add.groupNA = TRUE,
add.groupVariable = FALSE,
FCT.center = "mean",
FCT.spread = "sd",
test.categorical = NULL,
test.continuous = NULL
)
formula |
[formula] A formula where the left hand side (lhs) describe potential subgroups and the right hand side (rhs) the variable to be described. |
data |
[data.frame/data.table] Dataset |
guess.categorical |
[integer,>0] When the type of the variables is not specified, numeric variables with number of unique values lower than the specified value are treated as categorical variabels. |
add.groupAll |
[logical] should the descriptives of the whole dataset be computed? |
add.groupNA |
[logical] should the descriptives of the observations where the group variable is missing be computed? |
add.groupVariable |
[logical] should the name of the variable used to generate the sub-groups be printed in the table. |
FCT.center |
[function] function used to assess the center of the distribution. |
FCT.spread |
[function] function used to assess the spread of the distribution. |
test.categorical |
[function] function used to compute the p-value when comparing the categorical outcomes across sub-groups. |
test.continuous |
[function] function used to compute the p-value when comparing the continuous outcomes across sub-groups. |
data(veteran, package = "survival")
descriptiveTable( ~ celltype + time + status +karno,
data = veteran)
descriptiveTable(trt ~ celltype + time + status +karno,
data = veteran)
tt <- descriptiveTable(trt ~ celltype + time + status +karno,
data = veteran, test.continuous = t.test)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.