List of lists, should contain a "Type" entry with a function to determine type of vector passed in. Next entries are keyed off returned types from function, and represent the type of a row. The returned list should contain the same list of types, and represents the type of a column. Thus it now returns a function to process the intersection of those two types. There are additionally a list of cell tranforms that can be overridden and a default footnote if none is specified.
summarize_kruskal_horz(
table,
row,
column,
cell_style,
pformat = NULL,
msd = FALSE,
quant = c(0.25, 0.5, 0.75),
overall = NULL,
test = FALSE,
...
)summarize_kruskal_vert(
table,
row,
column,
cell_style,
collapse_single = TRUE,
pformat = NULL,
msd = FALSE,
test = FALSE,
...
)
summarize_chisq(
table,
row,
column,
cell_style,
pformat = NULL,
collapse_single = TRUE,
overall = NULL,
test = FALSE,
row_percents = FALSE,
useNA = "no",
...
)
summarize_spearman(
table,
row,
column,
cell_style,
pformat = NULL,
test = FALSE,
...
)
hmisc
The modified table object
An object of class list
of length 5.
The table object to modify
The row variable object to use (numerical)
The column variable to use (categorical)
list; cell styling functions
numeric, character or function; A formatting directive to be applied to p-values
logical; Include mean and standard deviation with quantile statistics
numeric; Vector of quantiles to include. Should be an odd number since the middle value is highlighted on display.
logical or character; Include overall summary statistics for a categorical column. Character values are assumed to be true and used as column header.
logical or function; include statistical test results. Function signature must be function(row, col, cell_style, ...)
absorbs additional arugments. Unused at present.
logical; default TRUE. Categorical variables with a two values collapse to single row.
logical; use denominator across rows instead of columns.
character; Specifies whether to include NA counts in the table. The allowed values correspond to never "no" (Default), only if the count is positive "ifany" and even for zero counts "always". An NA column is always excluded.
Given a row and column object apply a Kruskal test and output the results horizontally. 1 X (n + no. categories + test statistic)
Given a row and column object from the parser apply a Kruskal test and output the results vertically (#Categories+1) X (N, Summary, Statistic)
Given a row and column object from the parser apply a chi^2 test and output the results
Given a row and column object from the parser apply a Spearman test and output the results in a 1X3 format.
hmisc <- list(
Type = hmisc_data_type,
Numerical = list(
Numerical = summarize_spearman,
Categorical = summarize_kruskal_horz
),
Categorical = list(
Numerical = summarize_kruskal_vert,
Categorical = summarize_chisq
),
Cell = hmisc_cell,
Footnote = "N is the number of non-missing value. ^1^Kruskal-Wallis. ^2^Pearson. ^3^Wilcoxon."
)
hmisc_data_type
, tangram
, hmisc_cell