sim.chisq.gf {simitation} | R Documentation |
sim.chisq.gf
Description
Simulate data for chi-squared tests of goodness of fit across experiments.
Usage
sim.chisq.gf(
n,
values,
prob = NULL,
num.experiments = 1,
experiment.name = "experiment",
value.name = "x",
seed = 91,
vstr = "3.6"
)
Arguments
n |
A numeric value indicating the number of observations in each experiment. |
values |
A numeric vector specifying the possible values (sample space). |
prob |
A numeric vector of probabilities corresponding to the values for simulation. If not provided, equal probabilities are assumed for all values. |
num.experiments |
An integer indicating the number of simulated experiments to conduct. |
experiment.name |
A character string specifying the column name for identifying each experiment in the output. |
value.name |
A character string specifying the column name for the simulated values in the output. |
seed |
An integer specifying the seed for reproducibility. Default is 91. |
vstr |
A numeric or character string specifying the seed for random number generation to ensure reproducibility. Default is "3.6". For more details, refer to |
Value
A 'data.table' containing the simulated experiments with specified column names.
Examples
simdat.chisq.gf <- sim.chisq.gf(n = 100, values = LETTERS[1:4],
prob = c(0.4, 0.3, 0.2, 0.1), num.experiments = 2, experiment.name =
"experiment_id", value.name = "classification", seed = 31)