Performs classical categorical tests on two columns of a
data frame.
Per default, will perform chisq.test
or fisher.test on the
contingency table created by var1 and var2.
A function receiving the matrix to test and
returning a named vector with the test function to use. The default uses
fisher.test if one count is 5 or lower, otherwise chisq.test.
Test functions must return a value with at least one component named "p.value".
...
Passed on to the test function
Value
A one-row data frame with the columns:
"var1,var2": The tested variables
"test": Label of the test function (default: fisher or chisq)
"p-value": P value
"result": List column with full result object (default: htest)
"contingency_table": List column with contingency table data frame
as return by contingency_table_by
Details
Returns a one-line data frame as result and thus plays nicely
with for example map_dfr.