wrap.chi | R Documentation |
Performs one-way goodness-of-fit and two-way contingency tests. The
function delegates the primary operations to chisq.test
.
wrap.chi(dv1, iv1 = NULL, p = rep(1/nlevels(dv1), nlevels(dv1)), correct = F)
dv1 |
Column vector containing the categorical dependent variable |
iv1 |
Column vector containing the categorical independent variable (contingency tests, only) |
p |
A vector of probabilities representing expected cell frequencies (goodness-of-fit tests, only). By default, the function assumes equal expected cell frequencies for all levels of the dependent variable. |
correct |
A logical argument: If FALSE, the function does not apply Yates's correction for 2x2 contingency tables; if TRUE, the function applies Yates's correction for 2x2 contingency tables. |
chisq.test
## One-way goodness-of-fit test wrap.chi(dv1 = bdata$DV2) ## Two-way contingency test wrap.chi(dv1 = bdata$DV2, iv1 = bdata$IV2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.