dsctable: Generate html table of descriptive statistics for data

Description Usage Arguments Value

View source: R/dsctable.R

Description

Generate html table of descritive statistics for data

Usage

1
2
3
dsctable(dataframe, num, char, grp, title = "Table", label.option = F,
  mean.option = F, option = F, digit = 1, num.test = "None",
  char.test = "None")

Arguments

dataframe

Data to be used

num

A vector of numeric variable names

char

A vector of categorical variable names

grp

"None" or Group names, limited to one name

title

Title of the table

label.option

Default is 'FALSE'.'TURE' uses variable label rather than variable name

mean.option

Default is 'FALSE'.'TURE' calculates mean for numeric variabls, 'FALSE' calculates median for numeric variables

option

Default is 'FALSE'. 'TRUE' uses min and max for numeric variable and percentage for categorical variable

digit

Round the numeric statistics except for p-value. P-value always had 2 decimals.

num.test

A character string specifying the test method for numeric variable among groups, must be one of "None", "ANOVA", "Wilcoxon/Kruskal". "Wilcoxon/Kruskal" means if the group variable has two groups, then use Wilcoxon sum rank test, if has more than two groups, use Kruskal-Wallis test.

char.test

A character string specifying the test method for categorical variable among groups, must be one of "None", "Chi", "Fisher".

Value

Desciptive tables for selected variables. Median (min-max) for numeric variable; N(%) for characteristic variables. ANOVA for numeric variables with normality assumption; Wilcoxon test for non-parametric variable and two groups; Kruiskal test for more than two groups (excluding missing group level); Chi-square test and Fisher's exact test for categorical variables (excluding missing levels, both variable and group)


tqchen07/ctool documentation built on Sept. 3, 2019, 8:36 a.m.