Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

table2d_summary

Summary of a 2-way Table


Description

Prints a 2-way contingency table along with percentages, marginal, and conditional distributions.

Usage

table2d_summary(object, margins = TRUE, percentages = FALSE,
  conditionals = c("none", "row", "column"), chisq.test = TRUE, ...)

Arguments

object

a r x c-contingency table

margins

if TRUE, marginal distributions are computed.

percentages

if TRUE, relative frequencies are computed.

conditionals

if not "none", the conditional distributions, given the row/column factor, are computed.

chisq.test

if TRUE, a chi-squared test of independence is carried out.

...

currently not used.

Value

Returns invisibly a r x c x k table, k depending on the amount of choices (at most 3).

Author(s)

See Also

Examples

data("UCBAdmissions")
table2d_summary(margin.table(UCBAdmissions, 1:2))

vcd

Visualizing Categorical Data

v1.4-10
GPL-2
Authors
David Meyer [aut, cre], Achim Zeileis [aut] (<https://orcid.org/0000-0003-0918-3766>), Kurt Hornik [aut], Florian Gerber [ctb], Michael Friendly [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.