tabi: Immediate Contingency Tables

View source: R/immediate.R

tabiR Documentation

Immediate Contingency Tables

Description

Creates an immediate contingency table from typed counts. The immediate mode uses the same calculation engine as the corresponding R4VN analyses when values are supplied directly, for example tab(sex, outcome, data = dat, chi = TRUE).

Usage

tabi(
  ...,
  row.names = NULL,
  col.names = NULL,
  percent = c("none", "row", "col", "total"),
  row = FALSE,
  col = FALSE,
  cell = FALSE,
  total = FALSE,
  exp = FALSE,
  chi = TRUE,
  fisher = FALSE,
  lr = FALSE,
  residual = FALSE,
  adjresidual = FALSE,
  correct = FALSE,
  digits = 1,
  p_digits = 3,
  workspace = 2e+05,
  show = TRUE,
  console = FALSE
)

Arguments

...

Numeric row vectors, a matrix, or a table. For anovai(), each argument is a group summary in the form c(n, mean, sd).

row.names, col.names

Optional row and column labels.

percent

Percentage denominator: "none", "row", "col", or "total".

row, col, cell, total

Logical shortcuts for row, column, or total-cell percentages. Only one may be TRUE.

exp

Show expected counts.

chi

Show Pearson's chi-squared test.

fisher

Show Fisher's exact test.

lr

Show the likelihood-ratio chi-squared test.

residual

Show Pearson residuals.

adjresidual

Show adjusted residuals.

correct

Apply Yates's correction for a 2 by 2 Pearson test.

digits

Number of decimal places for estimates.

p_digits

Number of decimal places for p-values.

workspace

Workspace passed to stats::fisher.test().

show

Logical; open the formatted result in the Viewer. Default TRUE.

console

Logical; also print the traditional text result in the Console. Default FALSE.

Value

Invisibly returns an object of class r4vn_stat.

Examples

tabi(c(2, 3), c(5, 6), c(8, 9), row = TRUE,
     exp = TRUE, chi = TRUE, fisher = TRUE)

R4VN documentation built on Sept. 30, 2026, 5:13 p.m.