table_values {sjstats} | R Documentation |
Expected and relative table values
Description
This function calculates a table's cell, row and column percentages as well as expected values and returns all results as lists of tables.
Usage
table_values(tab, digits = 2)
Arguments
tab |
Simple |
digits |
Amount of digits for the table percentage values. |
Value
(Invisibly) returns a list with four tables:
-
cell
a table with cell percentages oftab
-
row
a table with row percentages oftab
-
col
a table with column percentages oftab
-
expected
a table with expected values oftab
Examples
tab <- table(sample(1:2, 30, TRUE), sample(1:3, 30, TRUE))
# show expected values
table_values(tab)$expected
# show cell percentages
table_values(tab)$cell
[Package sjstats version 0.19.0 Index]