ChisqSimSlow {tigerstats} | R Documentation |
Chi Square Resampler (One at a Time)
Description
An app to illustrate use of the chi-square statistic to test for a relationship between two categorical variables. The P-value is computed by resampling, and the resamples are done one at a time. A histogram of resampled chi-square statistics is displayed after each resample, and summary information is output to the console.
Usage
ChisqSimSlow(form,data,effects=c("random","fixed"))
Arguments
form |
a formula of the form ~x+y. When using fixed effects (see below for explanation), x should be the variable that is considered the predictor variable. |
data |
A data frame from which x and y are drawn. |
effects |
When effects="fixed", the re-sampling is performed under the condition that the row sums in the re-sampled two-way table (with x for rows) are the same as the row sums in the two-way table based on the original data. When effects="random", then both row and column sums in the re-sampled table may vary: only the sum of the counts is constant. (Note: in the re-sampling procedure for chisq.test in the stats package of R, both row and column sums are required to equal the corresponding sums for the original data.) |
Value
Graphical and numerical output
Author(s)
Homer White hwhite0@georgetowncollege.edu
Examples
## Not run:
ChisqSimSlow(~weather+crowd.behavior,data=ledgejump,effects="fixed")
## End(Not run)