Description Usage Arguments Value Examples
Example data from "https://www.rivm.nl/en/novel-coronavirus-covid-19/children-and-covid-19"
1 | chi_and_bin(x)
|
x |
A matrix-like object with two columns: success and fail |
Print outs results of chisq.test and binom.test. Returns result of binom.test as a tibble with fields: "estimate", "statistic", "p.value", "parameter", "conf.low", "conf.high", "method", "alternative"
1 2 3 4 5 6 7 8 | data <- structure(list(Age = structure(c(2L, 7L, 3L, 4L, 5L, 6L, 8L, 9L, 10L, 1L),
.Label = c(">=80", "0-4", "13-18", "19-29", "30-39", "40-49", "5-12", "50-59",
"60-69", "70-79"), class = "factor"),
Infected.contacts = c(0L, 0L, 0L, 5L, 2L, 12L, 22L, 3L, 7L, 4L),
Non.infected.contacts = c(2L, 29L, 12L, 64L, 44L, 152L, 209L, 47L, 67L, 28L)),
class = "data.frame", row.names = c(NA, -10L))
chi_and_bin(data[,2:3])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.