View source: R/nice_chi_test_table.R
nice_chi_test_table | R Documentation |
Creates a chi.squared test table for multiple dependent variables
nice_chi_test_table(
dv,
iv,
data,
conditions = levels(factor(iv))[1:2],
ref_levels = 2,
labels = NULL,
nice_p = TRUE,
digits = 2,
order = "12",
label_attr = TRUE,
type = "html",
...
)
chi_test_table(...)
dv |
A data frame with the dependent variables or a character vector when argument data is set. |
iv |
A data frame or vector with the independent variable or a character if argument data is set. |
data |
A data frame. |
conditions |
A character vector of length two with the names of the two conditions. Defaults to the first two levels of the independent variable 'iv' if applicable. |
ref_levels |
Vector with the reference level for each dependent variable. Values are repeated if length of levels vector is smaller than number dependent variables. |
labels |
A character vector of length two with labels for the dependent variables. |
nice_p |
If TRUE, p values are printed in a nice format. |
digits |
Number of digits for rounding mean and sd values |
order |
Either "12" or "21" depicting whether group two is compared to group one or vice versa. |
type |
Either "df" for data frame or "html" for html table. |
... |
Further arguments passed to |
A tibble or an html table
dat <- data.frame(
gender = factor(rbinom(100, 1, 0.3), labels = c("male", "female")),
glasses = factor(rbinom(100, 1, 0.3), labels = c("no", "yes")),
sen = factor(rbinom(100, 1, 0.5), labels = c("no_sen", "sen"))
)
chi_test_table(
c("gender", "glasses"), "sen", data = dat,
ref_levels = c("male", "no")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.