TableOfDifferences: 'Table of differences'

View source: R/tableofdifferences.R

TableOfDifferencesR Documentation

Table of differences

Description

Creates a html table allowing comparison between values in two tables with the same row/column labels.

Usage

TableOfDifferences(
  table1,
  table2,
  means.test = "tTest",
  means.bessel = TRUE,
  proportions.test = "zTest",
  proportions.bessel = FALSE,
  output = c("widget", "qtable"),
  show = c("Primary statistic of Table 2 with differences"),
  cond.shade = c("None", "Cell colors", "Arrows", "Boxes")[2],
  cond.shade.cutoffs = c(0.05, 0.1),
  cond.shade.ub.colors = c("#82A5CB", "#A9C0DA"),
  cond.shade.lb.colors = c("#E99598", "#E5C8C4"),
  cond.shade.ub.bordercolors = cond.shade.ub.colors,
  cond.shade.lb.bordercolors = cond.shade.lb.colors,
  cell.fill = "#FFFFFF",
  font.color = "#2C2C2C",
  font.size = 10,
  font.unit = "px",
  font.family = "Arial",
  legend.show = TRUE,
  legend.sep = " ",
  legend.fill = "transparent",
  legend.font.family = font.family,
  legend.font.color = font.color,
  legend.font.size = font.size,
  legend.lineheight = 2,
  legend.decimals = 1,
  format.statistic.decimals = NULL,
  format.statistic.prefix = "",
  format.statistic.suffix = "",
  format.statistic.font.autocolor = TRUE,
  format.statistic.font.color = "#2C2C2C",
  format.statistic.font.size = font.size,
  format.statistic.font.family = font.family,
  format.difference.decimals = NULL,
  format.difference.prefix = "",
  format.difference.suffix = "",
  format.difference.sign = TRUE,
  format.difference.font.autocolor = TRUE,
  format.difference.font.color = font.color,
  format.difference.font.size = font.size,
  format.difference.font.family = font.family,
  cond.arrow.size = font.size,
  cond.box.radius = 0,
  cond.box.borderwidth = 2,
  cond.box.padding.right = 5,
  cond.box.padding.left = 0,
  cond.box.padding.top = 0,
  cond.box.padding.bottom = 0,
  row.names.to.remove = "NET, Total, Sum",
  column.names.to.remove = "NET, Total, Sum",
  design.effect.constant = 1,
  ...
)

Arguments

table1

A Q Table containing a primary statistic, "Standard Error", and "n" or "Count". The output table will compare table1 and table2, with values to highlight cells which are significantly different.

table2

A Q Table with the same labels as table1.

means.test

The type of test used to compare a table of means (i.e. from numeric variable). One of "tTest", "zTest", "Nonparametric". More details available in the Q Wiki. The Standard R output will use the value in QSettings$StatisticalAssumptions.

means.bessel

Logical, specifying whether Bessel's correction is used to compare means. The Standard R output will use the value in QSettings$StatisticalAssumptions.

proportions.test

The type of test used to compare a table of proportions (i.e. from PickOne or PickAny variable). One of "tTest", "zTest", "Nonparametric". More details available in the Q Wiki. The Standard R output will use the value in QSettings$StatisticalAssumptions.

proportions.bessel

Logical, specifying whether Bessel's correction is used to compare proportions. The Standard R output will use the value in QSettings$StatisticalAssumptions.

output

The type of output to return. The default is "htmlwidget" that visualizes the significance levels of the differences. The alternative is "qtable" which is a 3d array containing the primary statistic of table2, the differences, and the p-values of the differences.

show

Controls text shown in the output table. Select one of "Primary statistic of Table 2 with differences", "Primary statistic of Table 2" or "Differences".

cond.shade

Controls which elements are colored differently to show significance. Select one of "None", "Cell colors", "Arrows", "Boxes".

cond.shade.cutoffs

A vector of significance levels; cells will be colored if the p-value is smaller than one of the cutoffs.

cond.shade.ub.colors

A vector of colors the same length as cond.shade.cutoffs. Cells will be colored if table2 is significantly less than table1.

cond.shade.lb.colors

A vector of colors the same length as cond.shade.cutoffs. Cells will be colored if table2 is significantly greater than table1.

cond.shade.ub.bordercolors

A vector of colors the same length as cond.shade.cutoffs. Cells will be colored if table2 is significantly less than table1. These will be used to color the borders when cond.shade == "Boxes".

cond.shade.lb.bordercolors

A vector of colors the same length as cond.shade.cutoffs. Cells will be colored if table2 is significantly greater than table1 These will be used to color the borders when cond.shade == "Boxes"..

cell.fill

The default background color of cells in the table.

font.color

Default font color of the cells in the table.

font.size

Default font size.

font.unit

One of "px" or "pt".

font.family

Default font family of the cells in the table.

legend.show

Logical; whether or not to show legend at the bottom of the table.

legend.sep

Character; the string used to separate entries in the legend.

legend.fill

Background color of the region behind the legend.

legend.font.family

Font family of text in the legend.

legend.font.color

Font color of text in the legend.

legend.font.size

Font size of text in the legend.

legend.lineheight

Numeric; controls the spacing between lines in the legend. It is applied as a multiple of the font size.

legend.decimals

Numeric; the number of decimal places to show for confidence levels in the legend.

format.statistic.decimals

Numeric; The number of decimals shown if the primary statistic is shown in the cells.

format.statistic.prefix

Optional text that will be prepended to the primary statistic if it is shown in the cells.

format.statistic.suffix

Optional text that will be appended to the primary statistic if it is shown in the cells.

format.statistic.font.autocolor

Whether the font of the primary statistic should be automatically set to black or white to maximise the contrast to the cell fill. Overrides format.statistic.font.color.

format.statistic.font.color

Font color of primary statistic if it is shown in the cell.

format.statistic.font.size

Font size of primary statistic.

format.statistic.font.family

Font family of primary statistic.

format.difference.decimals

Numeric; The number of decimals shown if the difference is shown in the cells.

format.difference.prefix

Optional text that will be prepended to the difference if it is shown in the cells.

format.difference.suffix

Optional text that will be appended to the difference if it is shown in the cells.

format.difference.sign

Logical; whether a +/- sign should always be prepended to the difference.

format.difference.font.autocolor

Whether the font of the difference should be automatically set to black or white to maximise the contrast to the cell fill. Overrides format.difference.font.color.

format.difference.font.color

Font color of difference if it is shown in the cell.

format.difference.font.size

Font size of difference.

format.difference.font.family

Font family of difference.

cond.arrow.size

Size of the arrows in font units.

cond.box.radius

Numeric; roundness of box corner when cond.shade == "Boxes" (e.g. 0 for sharp corners, 50 for oval).

cond.box.borderwidth

Numeric; line width of box when cond.shade == "Boxes".

cond.box.padding.right

Number; controls how far the box extends from the text when cond.shade == "Boxes".

cond.box.padding.left

Number; controls how far the box extends from the text when cond.shade == "Boxes".

cond.box.padding.top

Number; controls how far the box extends from the text when cond.shade == "Boxes".

cond.box.padding.bottom

Number; controls how far the box extends from the text when cond.shade == "Boxes".

row.names.to.remove

Character vector or delimited string of row labels specifying rows to remove from the returned table.

column.names.to.remove

Character vector or delimited string of column labels specifying columns to remove from the returned table.

design.effect.constant

A constant used to account for the expected sampling error in a survey. More details available in the Q Wiki. The Standard R output will use the value in QSettings$StatisticalAssumptions.

...

Other parameters passed to CreateCustomTable.


NumbersInternational/flipAnalysisOfVariance documentation built on Feb. 26, 2024, 4:52 a.m.