table_categorical {doMIsaul}R Documentation

Display table with comparison of the partition with categorical variables.

Description

Display table with comparison of the partition with categorical variables.

Usage

table_categorical(
  data,
  partition.name,
  vars.cat,
  vars.cat.names = NULL,
  na.value = "",
  nb.dec = 1,
  text.pval = FALSE
)

Arguments

data

The dataset.

partition.name

string. Name of the partition (in data). The partition variable should be a factor.

vars.cat

vector of strings. variables to compare to (categorical only).

vars.cat.names

Optional. Names for displaying the categorical variables. (in the same order than vars.cat)

na.value

Value to use for the empty cases (e.g. "" or NA).

nb.dec

digit. Number of decimals for the percentage.

text.pval

boolean. Set to TRUEto display "p=", to FALSE to display only the value.

Value

table with n and percentage values per level of the partition and chi square test p-values.

Examples

data(cancer, package = "survival")
cancer$status <- factor(cancer$status)
table_categorical(data = cancer, partition.name = "status",
                  vars.cat = c("sex", "ph.ecog"))

[Package doMIsaul version 1.0.1 Index]