Learn R Programming

tangram (version 0.8.2)

summarize_kruskal_horz: Style Bundle for Hmisc defaults

Description

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.

Usage

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

Value

The modified table object

Format

An object of class list of length 5.

Arguments

table

The table object to modify

row

The row variable object to use (numerical)

column

The column variable to use (categorical)

cell_style

list; cell styling functions

pformat

numeric, character or function; A formatting directive to be applied to p-values

msd

logical; Include mean and standard deviation with quantile statistics

quant

numeric; Vector of quantiles to include. Should be an odd number since the middle value is highlighted on display.

overall

logical or character; Include overall summary statistics for a categorical column. Character values are assumed to be true and used as column header.

test

logical or function; include statistical test results. Function signature must be function(row, col, cell_style, ...)

...

absorbs additional arugments. Unused at present.

collapse_single

logical; default TRUE. Categorical variables with a two values collapse to single row.

row_percents

logical; use denominator across rows instead of columns.

useNA

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.

<code>summarize_kruskal_horz</code>

Given a row and column object apply a Kruskal test and output the results horizontally. 1 X (n + no. categories + test statistic)

<code>summarize_kruskal_vert</code>

Given a row and column object from the parser apply a Kruskal test and output the results vertically (#Categories+1) X (N, Summary, Statistic)

<code>summarize_chisq</code>

Given a row and column object from the parser apply a chi^2 test and output the results

<code>summarize_spearman</code>

Given a row and column object from the parser apply a Spearman test and output the results in a 1X3 format.

<code>hmisc</code>

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."
)

See Also

hmisc_data_type, tangram, hmisc_cell