ChisqSimSlow function

Chi Square Resampler (One at a Time)

Chi Square Resampler (One at a Time)

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.

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.)

Returns

Graphical and numerical output

Examples

## Not run: ChisqSimSlow(~weather+crowd.behavior,data=ledgejump,effects="fixed") ## End(Not run)

Author(s)

Homer White hwhite0@georgetowncollege.edu

  • Maintainer: Homer White
  • License: GPL (>= 3)
  • Last published: 2020-06-15

Useful links