Learn R Programming

simitation (version 0.0.7)

sim.chisq.test.ind: sim.chisq.test.ind

Description

sim.chisq.test.ind

Usage

sim.chisq.test.ind(
  simdat.chisq.ind,
  correct = TRUE,
  experiment.name = "experiment",
  group.name = "variable",
  value.name = "value"
)

Value

A data frame with results of the chi-squared tests for each experiment.

Arguments

simdat.chisq.ind

Data for use in chi squared tests of independence across one or more experiments. Structure is in the form returned by the function simitation::sim.chisq.ind().

correct

See help(chisq.test).

experiment.name

A character value providing the name of the column identifying the experiment.

group.name

A character value providing the name of the column of the group labels.

value.name

A character value providing the name of the column identifying the values.

Examples

Run this code

n <- c(50, 75, 100)
values <- LETTERS[1:4]
group.names <- paste0("group_", 1:3)
probs <- matrix(data =
c(0.25, 0.25, 0.25, 0.25, 0.4, 0.3, 0.2, 0.1, 0.2, 0.4, 0.2, 0.2),
 nrow = length(n), byrow = TRUE)
simdat.chisq.ind <- sim.chisq.ind(n = c(50, 75, 100),
 values = LETTERS[1:4], probs = probs, num.experiments = 2,
  experiment.name = "exp_id", group.name = "treatment_group",
  group.values = paste0("group_", 1:3), value.name = "category", seed = 31)


test.statistics.chisq.test.ind <- sim.chisq.test.ind(simdat.chisq.ind =
simdat.chisq.ind, correct = TRUE, experiment.name = "exp_id",
group.name = "treatment_group", value.name = "category")

Run the code above in your browser using DataLab