crosstable_test_args {crosstable} | R Documentation |
Default arguments for calculating and displaying tests in crosstable()
Description
This is the starting point for refining the testing algorithm used in crosstable. Users can provide their own functions for test.~.
Usage
crosstable_test_args(
test_summarize = test_summarize_auto,
test_tabular = test_tabular_auto,
test_correlation = test_correlation_auto,
test_survival = test_survival_logrank,
test_display = display_test,
plim = 4,
show_method = TRUE
)
Arguments
test_summarize |
a function of two arguments (continuous variable and grouping variable), used to compare continuous variable. Must return a list of two components: |
test_tabular |
a function of two arguments (two categorical variables), used to test association between two categorical variables. Must return a list of two components: |
test_correlation |
a function of three arguments (two continuous variables plus the correlation method), used to test association between two continuous variables. Like |
test_survival |
a function of one argument (the formula |
test_display |
function used to display the test result. See |
plim |
number of digits for the p value. |
show_method |
whether to display the test name (logical). |
Value
A list with test parameters
Author(s)
Dan Chaltiel
See Also
test_summarize_auto
, test_tabular_auto
, test_survival_logrank
, test_summarize_linear_contrasts
, display_test
Examples
library(dplyr)
my_test_args=crosstable_test_args()
my_test_args$test_summarize = test_summarize_linear_contrasts
iris %>%
mutate(Petal.Width.qt = paste0("Q", ntile(Petal.Width, 5)) %>% ordered()) %>%
crosstable(Petal.Length ~ Petal.Width.qt, test=TRUE, test_args = my_test_args)