nice_chi_test_table.Rd
Creates a chi.squared test table for multiple dependent variables
A data frame with the dependent variables or a character vector when argument data is set.
A data frame or vector with the independent variable or a character if argument data is set.
A data frame.
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.
Vector with the reference level for each dependent variable. Values are repeated if length of levels vector is smaller than number dependent variables.
A character vector of length two with labels for the dependent variables.
If TRUE, p values are printed in a nice format.
Number of digits for rounding mean and sd values
Either "12" or "21" depicting whether group two is compared to group one or vice versa.
Either "df" for data frame or "html" for html table.
Further arguments passed to nice_table()
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")
)
Table
Chi-squared test
no_sen
sen
Difference
no_sen
sen
Note. One degree of freedom for all tests.