View source: R/report.chitest.R
report.chitest | R Documentation |
This function conducts Chi-square tests for independence between pairs of categorical variables. It provides the option to use Monte Carlo simulations for the p-value computation and to calculate Cramer's V.
report.chitest(
varNamesX,
varNamesY,
data,
simulate.p.value = TRUE,
cramer = FALSE,
language = "english",
...
)
varNamesX |
A vector of strings representing the names of the X variables in the data frame. |
varNamesY |
A vector of strings representing the names of the Y variables in the data frame. |
data |
A data frame or an object of class |
simulate.p.value |
A logical value indicating whether to compute p-values by Monte Carlo simulation. Default is TRUE. |
cramer |
A logical value indicating whether to compute Cramer's V for the pairs. Default is FALSE. |
language |
The language used for displaying the statistics in the frequency table. This parameter accepts two values: |
... |
Additional arguments to be passed to the chisq.test function. |
A matrix with rows representing each pair of variables, and columns representing: 1) variable pair, 2) Chi-square statistic, 3) p-value (calculated by simulation or classic method, based on 'simulate.p.value'), 4) degrees of freedom (if 'simulate.p.value' is FALSE), 5) Cramer's V (if 'cramer' is TRUE).
Marjan Cugmas
report.chitest(varNamesX = c("cyl", "vs", "am"),
varNamesY = "gear", data = mtcars, simulate.p.value = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.