Description Usage Arguments Examples
This function is wraps the chisq.test
function
from the stats
package to automatically simulate the
p-value if the data provided does not comply with the assumptions
of the Chi-square test, specifically that there is at least
one cell with less than 5 expected counts.
1 | chisq_wrap(x, y = NULL, ...)
|
x |
a numeric vector or matrix. x and y can also both be factors. |
y |
a numeric vector; ignored if x is a matrix. If x is a factor, y should be a factor of the same length. |
... |
passes options to the function |
1 2 3 4 5 6 7 8 | chisq_wrap(testdata$extortion_victim, testdata$size)
# x is a matrix or an object that can be coerced into a matrix
t <- table(testdata$extortion_victim, testdata$size)
chisq_wrap(t)
# Pass number of replicates to be used if simulation is required
chisq_wrap(t, B = 1000)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.