Calculates and adds a p-value comparing the two variables of a table
created with tbl_cross(). When the missing-value level is shown in the
table, it is included in the calculation. Called as add_p() on a
tbl_cross object.
Arguments
x(tbl_cross)
A table created withtbl_cross().test(string)
The test to perform. Default is"chisq.test.no.correct"when every expected cell count is 5 or more and"fisher.test"otherwise; see tests for the available tests.pvalue_fun(function)
Function that rounds and formats the p-value. Default islabel_style_pvalue(digits = 1), orlabel_style_pvalue(digits = 1, prepend_p = TRUE)whensource_note = TRUE.source_note(scalar logical)
Whether to show the p-value as a source note below the table rather than in a column. Default isFALSE.test.args(namedlist)
Additional arguments passed to the test, e.g.test.args = list(correct = TRUE)for a chi-squared test with a continuity correction....Not used.
See also
Other cross tables:
tbl_cross()