chisq_test | R Documentation |
Tests whether the distribution of infector-infectee pairs differs between sets of transmission trees.
chisq_test(..., method = c("chisq", "fisher"), test_args = list())
... |
Two or more sets of transmission trees. Each set is a list of data frames with columns |
method |
Test to use: |
test_args |
A list of additional arguments for |
An htest
object with the test results.
set.seed(1)
# No difference in the sets
setA <- replicate(10, igraph::as_long_data_frame(
make_tree(n_cases = 10, R = 2, stochastic = TRUE)
),
simplify = FALSE
)
setB <- replicate(10, igraph::as_long_data_frame(
make_tree(n_cases = 10, R = 2, stochastic = TRUE)
),
simplify = FALSE
)
chisq_test(setA, setB)
# Difference in the sets
setC <- replicate(10, igraph::as_long_data_frame(
make_tree(n_cases = 10, R = 4, stochastic = TRUE)
),
simplify = FALSE
)
chisq_test(setA, setB, setC)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.