powered by
Display table with comparison of the partition with categorical variables.
table_categorical( data, partition.name, vars.cat, vars.cat.names = NULL, na.value = "", nb.dec = 1, text.pval = FALSE )
The dataset.
string. Name of the partition (in data). The partition variable should be a factor.
vector of strings. variables to compare to (categorical only).
Optional. Names for displaying the categorical variables. (in the same order than vars.cat)
vars.cat
Value to use for the empty cases (e.g. "" or NA).
""
NA
digit. Number of decimals for the percentage.
boolean. Set to TRUEto display "p=", to FALSE to display only the value.
TRUE
"p="
FALSE
table with n and percentage values per level of the partition and chi square test p-values.
# NOT RUN { data(cancer, package = "survival") cancer$status <- factor(cancer$status) table_categorical(data = cancer, partition.name = "status", vars.cat = c("sex", "ph.ecog")) # }
Run the code above in your browser using DataLab